Providers

Provider tiers

Librarium organizes its 24 built-in providers into four tiers based on capabilities, latency, and depth.

deep-research. Async deep research providers that take minutes to complete but produce comprehensive, multi-source reports. These providers may use a submit/poll/retrieve pattern. Best for thorough research on important topics.

ai-grounded. AI-powered search with inline citations. Returns results in seconds with good quality and source attribution. A solid middle ground between speed and depth.

raw-search. Traditional search engine results. Fast responses with many links and snippets, but no AI synthesis. Useful for broad link discovery and verifying specific facts.

llm. Ungrounded generic LLMs (Claude, OpenAI, Gemini, or anything via OpenRouter). These return the model’s direct answer to the research prompt with no web grounding and no citations, so they contribute zero sources to the deduplicated source set, sources.json, and the report tallies. They exist as an opt-in baseline/contrast layer: run them alongside grounded research to see what the model says on its own versus what grounded providers surface. Because they are ungrounded, they are excluded from every grounded default group (quick, fast, raw, deep, comprehensive, and all). Opt in explicitly via -p claude,openai-chat,..., a custom group, or --group llm. Each provider takes a cheap default model with a per-provider model config override.

Provider list

ProviderIDTierAPI key env var
Perplexity Sonar Deep Researchperplexity-sonar-deepdeep-researchPERPLEXITY_API_KEY
Perplexity Deep Researchperplexity-deep-researchdeep-researchPERPLEXITY_API_KEY
Perplexity Advanced Deep Researchperplexity-advanced-deepdeep-researchPERPLEXITY_API_KEY
OpenAI Deep Research (o4-mini)openai-deepdeep-researchOPENAI_API_KEY
OpenAI Deep Research (o3)openai-deep-o3deep-researchOPENAI_API_KEY
Gemini Deep Researchgemini-deepdeep-researchGEMINI_API_KEY
Perplexity Sonar Properplexity-sonar-proai-groundedPERPLEXITY_API_KEY
Gemini Grounded Searchgemini-groundedai-groundedGEMINI_API_KEY
ChatGPT Search (OpenRouter)openrouter-onlineai-groundedOPENROUTER_API_KEY
Brave AI Answersbrave-answersai-groundedBRAVE_API_KEY
Exa Searchexaai-groundedEXA_API_KEY
You.com Researchyou-researchai-groundedYOU_COM_API_KEY
Kagi FastGPTkagi-fastgptai-groundedKAGI_API_KEY
Perplexity Searchperplexity-searchraw-searchPERPLEXITY_API_KEY
Brave Web Searchbrave-searchraw-searchBRAVE_API_KEY
Jina AI Searchjina-searchraw-searchJINA_AI_API_KEY
SearchAPIsearchapiraw-searchSEARCHAPI_API_KEY
SerpAPIserpapiraw-searchSERPAPI_API_KEY
Tavily Searchtavilyraw-searchTAVILY_API_KEY
Firecrawl Searchfirecrawl-searchraw-searchFIRECRAWL_API_KEY
ClaudeclaudellmANTHROPIC_API_KEY
OpenAI Chatopenai-chatllmOPENAI_API_KEY
Gemini Chatgemini-chatllmGEMINI_API_KEY
OpenRouter Chatopenrouter-chatllmOPENROUTER_API_KEY

The llm tier (ungrounded baseline / contrast)

The llm tier is deliberately kept apart from the grounded tiers. Grounded providers earn their place in the source tallies by citing the web; ungrounded LLMs do not, so librarium never silently folds them into a grounded run. llm-tier rows in the live table and result output render a dim ungrounded in place of the source count, and the dedupe pipeline, sources.json, and report source totals are completely unaffected by their presence. Use the built-in llm group (--group llm) to run all four at once.

Opt-in, never auto-enabled. Several llm-tier providers share an API key with their grounded counterparts (OPENAI_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY; Claude uses ANTHROPIC_API_KEY). To keep a plain librarium run — which dispatches every enabled provider — from silently calling an ungrounded model, init treats the llm tier specially:

  • librarium init --auto does not enable llm-tier providers, even when their key is present. It prints them as found-but-ungrounded with a hint to opt in.
  • Interactive librarium init lists the llm-tier providers but leaves them unchecked (with an [ungrounded] marker), so you must tick them deliberately.

As a result they stay out of the default run unless you explicitly enable them in config. Reach for them on demand via -p claude,openai-chat,..., a custom group, or --group llm regardless of your init choices.

Default models per provider (each overridable with a per-provider model config key): claude uses claude-haiku-4-5, openai-chat uses gpt-5-mini, gemini-chat uses gemini-2.5-flash, and openrouter-chat uses openai/gpt-4o-mini.

Provider notes

Async submit/poll vs inline execution

Four providers use a true background submit/poll/retrieve pattern and return immediately in mixed or async mode:

  • perplexity-sonar-deep — uses Perplexity’s Async Sonar API (POST /v1/async/sonar, polled via GET /v1/async/sonar/{id}). Submits and returns a pending handle; poll with librarium status --wait --retrieve.
  • openai-deep and openai-deep-o3 — use OpenAI’s background deep research API. Same submit-and-poll flow.
  • gemini-deep — uses Google’s Interactions API (POST /v1beta/interactions with background: true). Submits and returns a pending handle; poll with librarium status --wait --retrieve.

Two Perplexity providers use the Agent API, which has no background mode. They complete inline even in mixed or async mode:

  • perplexity-deep-research
  • perplexity-advanced-deep

Usage and cost reporting

Librarium never estimates costs from pricing tables. Usage data comes only from what each provider’s API actually returns.

ProviderWhat the API reports
perplexity-sonar-pro, perplexity-search, perplexity-sonar-deepToken counts (prompt_tokens, completion_tokens) and cost.total_cost (USD) when present
openrouter-online, openrouter-chatToken counts and a flat cost field (USD)
exacostDollars.total (USD); no token counts
gemini-groundedusageMetadata token counts (promptTokenCount, candidatesTokenCount) only; no cost field
gemini-deepInteractions API token counts (total_input_tokens, total_output_tokens) only; no cost field

All other providers either return no usage data or return only token counts with no cost. The reported totals in summary.md and the live table cover only the providers that reported something — the displayed cost is always sourced from the API, never calculated.

Model overrides

gemini-deep accepts a model config key to select the Deep Research agent. It defaults to the deep-research-preview-04-2026 agent; set model to deep-research-max-preview-04-2026 for the heavier (and more expensive) variant:

{
  "providers": {
    "gemini-deep": {
      "apiKey": "$GEMINI_API_KEY",
      "enabled": true,
      "model": "deep-research-max-preview-04-2026"
    }
  }
}

The four llm-tier providers (claude, openai-chat, gemini-chat, openrouter-chat) also accept a per-provider model config override; see the llm tier for their defaults. No other built-in provider currently exposes a model override via config. The OpenRouter and Perplexity Agent-based grounded providers use fixed model identifiers in their adapter code.

ProviderEnv varGet a key
Anthropic (Claude)ANTHROPIC_API_KEYplatform.claude.com/docs/en/api/overview
PerplexityPERPLEXITY_API_KEYdocs.perplexity.ai/home
OpenAIOPENAI_API_KEYplatform.openai.com
Google GeminiGEMINI_API_KEYai.google.dev
BraveBRAVE_API_KEYbrave.com/search/api
ExaEXA_API_KEYexa.ai
You.comYOU_COM_API_KEYyou.com/docs/welcome
KagiKAGI_API_KEYhelp.kagi.com
Jina AIJINA_AI_API_KEYjina.ai
SearchAPISEARCHAPI_API_KEYsearchapi.io
SerpAPISERPAPI_API_KEYserpapi.com
TavilyTAVILY_API_KEYdocs.tavily.com
FirecrawlFIRECRAWL_API_KEYdocs.firecrawl.dev
OpenRouterOPENROUTER_API_KEYopenrouter.ai

Run librarium init --auto to discover which keys are already present in your environment and enable their matching providers automatically. Note that init never auto-enables llm-tier providers, even when their key is present — see the llm tier.

Async behavior notes

perplexity-sonar-deep uses Perplexity’s Async Sonar API (POST /v1/async/sonar, polled via GET /v1/async/sonar/{id}). In mixed and async modes it submits and returns immediately; librarium status --wait --retrieve polls and retrieves results like openai-deep tasks.

gemini-deep uses Google’s Interactions API (POST /v1beta/interactions with background: true). In mixed and async modes it submits and returns immediately; poll with librarium status --wait --retrieve.

perplexity-deep-research and perplexity-advanced-deep use Perplexity’s Agent API, which has no background mode. They complete inline even in mixed mode.

Legacy provider ID aliases

Perplexity provider IDs were renamed to match current product names:

  • perplexity-sonar renamed to perplexity-sonar-pro
  • perplexity-deep renamed to perplexity-sonar-deep

For backward compatibility, librarium still accepts legacy IDs in:

  • run --providers
  • provider config keys in ~/.config/librarium/config.json
  • custom group members
  • fallback targets

Legacy IDs are normalized to canonical IDs and emit a warning. Output files and run.json always use canonical IDs.

Custom providers

You can also add custom providers (npm modules or local scripts) via config. See Custom providers for the full implementation guide.