Model Providers
Codumentor works with any OpenAI-compatible LLM provider. You can use a cloud API or run your own inference server. This page covers both.
Cloud Providers
The simplest approach is to use a cloud LLM API. Set the model name, base URL, and API key in your codumentor.yaml:
| Provider | Base URL | Notes |
|---|---|---|
| OpenAI | https://api.openai.com/v1 (default) | Set OPENAI_API_KEY |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta/openai/ | OpenAI-compatible endpoint |
| OpenRouter | https://openrouter.ai/api/v1 | Aggregates multiple providers |
Example: Google Gemini
models:
agent: "gemini-2.0-flash"
agent_base_url: "https://generativelanguage.googleapis.com/v1beta/openai/"
agent_api_key: "${GOOGLE_API_KEY}"
embedding: "text-embedding-004"
embedding_base_url: "https://generativelanguage.googleapis.com/v1beta/openai/"
embedding_api_key: "${GOOGLE_API_KEY}"
Example: OpenAI
models:
agent: "gpt-4o"
agent_api_key: "${OPENAI_API_KEY}"
embedding: "text-embedding-3-small"
embedding_api_key: "${OPENAI_API_KEY}"
Example: OpenRouter
models:
agent: "anthropic/claude-sonnet-4"
agent_base_url: "https://openrouter.ai/api/v1"
agent_api_key: "${OPENROUTER_API_KEY}"
embedding: "text-embedding-004"
embedding_base_url: "https://generativelanguage.googleapis.com/v1beta/openai/"
embedding_api_key: "${GOOGLE_API_KEY}"
Self-Hosted LLM Server
Codumentor needs nothing but an OpenAI-compatible endpoint, so any inference
server that speaks that API works: vLLM,
llama.cpp's llama-server,
Ollama, or a LiteLLM proxy in
front of several of them. Install and run it following that project's own
documentation; Codumentor does not manage the server process.
Pick a model with reliable tool calling — the assistant works almost
entirely through tools — and enable the server's tool-call parser (for vLLM,
--enable-auto-tool-choice with the parser that matches the model).
Connecting Codumentor to a Local Server
Point models: at the server's /v1 base URL and use the model name the
server reports:
models:
agent: "qwen3"
agent_base_url: "http://localhost:8000/v1"
embedding: "text-embedding-model"
embedding_base_url: "http://localhost:8000/v1"
If the server needs no API key, set a placeholder such as
agent_api_key: "none" — the server refuses to start with it unset. The embedding
endpoint may be the same server or a different one.
SSH Tunnel for Remote LLM Server
If the LLM server runs on a remote machine (e.g., a GPU instance in the cloud), create an SSH tunnel to forward the server's port to the machine Codumentor runs on:
ssh user@<server-ip> -L 8000:localhost:8000
With the tunnel active, configure Codumentor to use http://localhost:8000/v1 as the base URL, just as with a local server.
For persistent tunnels, add to your SSH config:
Host llm-server
HostName <server-ip>
User user
LocalForward 8000 localhost:8000
See Also
- Configuration -- Full configuration reference including model settings
- User guide -- Getting started for end users