Skip to main content
llmwiki is provider-portable. Whether you have an Anthropic API key, a GitHub Copilot subscription, a locally-running Ollama server, or just a Claude Code login, you can point llmwiki at the right backend with a handful of environment variables - no config files required for most setups. Choose the provider that matches your existing credentials and infrastructure.

Configuration precedence

When you use the Anthropic provider (the default), llmwiki resolves credentials in this order:
  1. Shell environment variables or a .env file in your project directory
  2. Claude Code settings fallback - ~/.claude/settings.json → env block
  3. Built-in provider defaults (where applicable)
This means that if you already have Claude Code configured on your machine, you can run llmwiki compile without exporting a single variable.

Providers

The Anthropic provider uses the official @anthropic-ai/sdk to call Claude directly. It is the default when LLMWIKI_PROVIDER is unset.AuthenticationSet either ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN - either one satisfies authentication. You do not need both.ANTHROPIC_BASE_URL accepts any valid HTTP or HTTPS URL. Claude-style path endpoints such as https://api.example.com/coding/ are supported; trailing slashes are normalized automatically.Example
Zero-export usage with Claude CodeIf ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_BASE_URL are not set in your shell or .env, llmwiki automatically reads Anthropic-compatible values from the env block in ~/.claude/settings.json. That covers:
  • ANTHROPIC_API_KEY
  • ANTHROPIC_AUTH_TOKEN
  • ANTHROPIC_BASE_URL
  • ANTHROPIC_MODEL
If Claude Code is already configured on your machine, this works with no additional setup:
The Anthropic provider delegates embeddings to the Voyage API. Set VOYAGE_API_KEY to enable semantic search with llmwiki query. Without it, query falls back to lexical ranking. To route embeddings to a different backend instead, set LLMWIKI_EMBEDDING_PROVIDER - see Environment Variables.

Per-concept prompt budget

When many sources contribute to the same compiled concept, llmwiki enforces a character cap on the combined source content sent to the LLM so no single concept blows past the model’s context window. Each contributing source gets a fair share when truncation kicks in. Set LLMWIKI_PROMPT_BUDGET_CHARS to control the cap. The default is 200000 (~50k tokens), which fits modern context windows with headroom. Raise it for larger-context models; lower it for small-context local models.
A truncation warning prints to stderr when the cap fires, naming the concept that hit the budget.

Output language

Generated wiki content defaults to whatever language the model produces from the source material - typically English. You can override this two ways:
  • LLMWIKI_OUTPUT_LANG - applies to every prompt the compile and query pipelines make. For example: zh-CN, Chinese, ja, Japanese.
  • --lang <code> on llmwiki compile or llmwiki query - same effect, scoped to one invocation. Wins over the env var.

For a complete listing of every environment variable llmwiki reads, see the Environment Variables reference.