installation.mdx
August 7, 2026 ยท View on GitHub
llmwiki is a Node.js CLI that you install once globally with npm. After installation, you point it at an LLM provider by setting a handful of environment variables - or in some cases, no variables at all if you're already logged into Claude Code. This page covers the full installation process and every supported provider.
Requirements
- Node.js >= 24 (see warning above)
- npm (bundled with Node.js)
- Provider credentials - required for compile and query; ingest is credential-free (see Provider Setup below)
Install llmwiki
Install the llm-wiki-compiler package globally. The package registers the llmwiki binary on your PATH:
npm install -g llm-wiki-compiler
Verify the installation:
llmwiki --version
# or
llmwiki --help
Provider Setup
llmwiki calls an LLM during the compile and query phases. It does not require credentials for ingest, view, lint, status, or any other read-only operation. Configure your provider by setting the environment variables below - or place them in a .env file in your project directory and llmwiki will load them automatically.
```bash
export ANTHROPIC_API_KEY=sk-ant-...
# or, for Anthropic-compatible gateways that expect a different header:
export ANTHROPIC_AUTH_TOKEN=<token>
```
To use a custom proxy or Anthropic-compatible endpoint, set `ANTHROPIC_BASE_URL`:
```bash
export ANTHROPIC_API_KEY=sk-ant-...
export ANTHROPIC_BASE_URL=https://proxy.example.com
```
**Zero-export shortcut.** If you already have Claude Code configured, llmwiki falls back to reading `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_MODEL` from `~/.claude/settings.json` (the `env` block). If those values are present there, you can run `llmwiki compile` with no exports at all.
**Configuration precedence:**
1. Shell environment / local `.env`
2. Claude Code settings fallback (`~/.claude/settings.json` โ `env` block)
3. Built-in provider defaults
```bash
export LLMWIKI_PROVIDER=claude-agent
export LLMWIKI_MODEL=claude-sonnet-4-6 # optional; this is the default
llmwiki compile
```
**Notes:**
- Compile and structured extraction work off the local login with no extra credentials.
- `llmwiki query` uses semantic embeddings, which the Claude Agent SDK does not provide. Set `VOYAGE_API_KEY` to enable embeddings; otherwise `query` falls back to lexical ranking.
- Set `LLMWIKI_DEBUG=1` for a concise per-message trace, or `LLMWIKI_DEBUG=verbose` for the SDK's full verbose logging.
<Warning>
The `claude-agent` provider drives your Claude Code / Agent SDK session programmatically. Before using it, review Anthropic's current [Claude Code](https://www.anthropic.com/legal/consumer-terms) and Agent SDK terms to ensure your intended use complies with them.
</Warning>
```bash
export LLMWIKI_PROVIDER=openai
export OPENAI_API_KEY=sk-...
# For a custom or local endpoint:
export OPENAI_BASE_URL=http://localhost:8080/v1
```
To use a separate endpoint for embeddings (optional - defaults to the same base URL as chat):
```bash
export LLMWIKI_PROVIDER=openai
export LLMWIKI_MODEL=qwen3.6-35b
export LLMWIKI_EMBEDDING_MODEL=text-embedding-model
export OPENAI_API_KEY=sk-local # any non-empty value works for local servers
export OPENAI_BASE_URL=http://host_url:port/v1
export OPENAI_EMBEDDINGS_BASE_URL=http://host_url:port/v1
```
<Note>
`OPENAI_API_KEY` is required by the OpenAI SDK even for local servers that don't check authentication. Use any non-empty dummy value (e.g. `sk-local`) in that case.
</Note>
```bash
export LLMWIKI_PROVIDER=ollama
export LLMWIKI_MODEL=llama3.1
export LLMWIKI_EMBEDDING_MODEL=nomic-embed-text
export OLLAMA_HOST=http://localhost:11434/v1
# Optional: separate embeddings endpoint
export OLLAMA_EMBEDDINGS_HOST=http://localhost:11435/v1
```
<Note>
Local models often need more than the default 10-minute request timeout. Override with `OLLAMA_TIMEOUT_MS` (Ollama-specific, wins over `LLMWIKI_REQUEST_TIMEOUT_MS`) or set `LLMWIKI_REQUEST_TIMEOUT_MS` for a provider-agnostic override. Ollama's built-in default is 30 minutes.
</Note>
First, refresh your `gh` CLI token to include the required scope:
```bash
gh auth refresh --scopes copilot
```
Then configure the provider:
```bash
export LLMWIKI_PROVIDER=copilot
export GITHUB_TOKEN=$(gh auth token) # OAuth token required; PATs will not work
export LLMWIKI_MODEL=gpt-4o # optional; gpt-4o is the default
```
Available models (use dots, not dashes in names): `gpt-4o`, `gpt-4o-mini`, `claude-sonnet-4.5`, `claude-sonnet-4.6`, `claude-opus-4.5`, `gemini-2.5-pro`, and others - availability depends on your Copilot plan.
<Note>
The GitHub Copilot API does not expose an embeddings endpoint. `llmwiki query` will fall back to full-index lexical selection without semantic ranking. For embedding-dependent workflows, switch to the `openai` provider and supply `OPENAI_API_KEY`.
</Note>
Different backends for chat and embeddings
You can serve embeddings from a different provider than chat - for example, Claude Agent SDK for generation with a local vLLM instance serving vectors:
export LLMWIKI_PROVIDER=claude-agent
export LLMWIKI_EMBEDDING_PROVIDER=openai
export OPENAI_EMBEDDINGS_BASE_URL=http://localhost:8000/v1
export LLMWIKI_EMBEDDING_MODEL=<your-local-embedding-model>
A self-hosted endpoint needs no API key. Without OPENAI_EMBEDDINGS_BASE_URL, you must set OPENAI_API_KEY. If the endpoint belongs to a hosted service rather than your own machine, set OPENAI_EMBEDDINGS_API_KEY too - otherwise your OPENAI_API_KEY is sent there.
Switching an existing project to a different embedding backend re-embeds every page on the next llmwiki compile, because vectors from different backends are not comparable.
See Environment Variables for the full LLMWIKI_EMBEDDING_PROVIDER credential reference.
Overriding the Model
To use a different model than the provider's default, set LLMWIKI_MODEL:
export LLMWIKI_MODEL=claude-opus-4-5
This works with any provider and is applied globally to all compile and query calls in the current session.
Using a .env File
You can store provider configuration in a .env file at the root of your wiki project directory. llmwiki loads it automatically on every command:
# .env (in your wiki project directory)
ANTHROPIC_API_KEY=sk-ant-...
LLMWIKI_MODEL=claude-sonnet-4-6
Variables in the shell environment take precedence over .env values.
Next Steps
Upgrading an existing 0.11 project? Follow Upgrading from 0.11 to 1.0 for the compatibility checks and one-time embedding index transition.
For a full reference on every provider option, proxy configuration, request timeouts, and output language settings, see Provider Configuration.
Ready to compile your first wiki? Head to the Quickstart.