LLM configuration
This guide explains how to configure LLM providers in Papra. Once a provider is configured, it can be used to power AI features like document auto tagging.
Enabling AI features
Section titled “Enabling AI features”AI features are disabled by default. To enable them, set the master switch:
AI_IS_ENABLED=trueYou then need to configure at least one provider (see below) and pick a default model.
Model nomenclature
Section titled “Model nomenclature”In order to use different models from potentially different providers, Papra uses a specific nomenclature to identify a model: <adapter>://<model_name>.
For example:
openai://gpt-4o-miniollama://qwen3:8banthropic://claude-haiku-4-5mistral://mistral-small-latestopenrouter://openai/gpt-5.1
The <adapter> part is the id of one of the built-in adapters (see Supported providers).
Default model
Section titled “Default model”The AI_DEFAULT_MODEL variable defines which model is used by AI features when no more specific model is configured:
AI_DEFAULT_MODEL=openai://gpt-4o-miniIndividual features can override this. For example, auto tagging reads AUTO_TAGGING_MODEL first and falls back to AI_DEFAULT_MODEL if it is not set.
Supported providers
Section titled “Supported providers”Papra ships with adapters for the most common providers, plus support for any OpenAI-compatible API. Each adapter is configured with its own environment variables.
Don’t hesitate to reach out if you want to see a provider added to Papra.
OpenAI-compatible providers
Section titled “OpenAI-compatible providers”These adapters all speak the OpenAI API format and share the same two settings: a base URL and an API key. The defaults already point to each provider’s hosted API, so for the cloud providers you usually only need to set the API key.
Adapter (<adapter>) |
Provider | API key | Base URL (default) |
|---|---|---|---|
openai |
OpenAI | OPENAI_API_KEY |
OPENAI_BASE_URL (https://api.openai.com/v1) |
mistral |
Mistral | MISTRAL_API_KEY |
MISTRAL_BASE_URL (https://api.mistral.ai/v1) |
deepseek |
DeepSeek | DEEPSEEK_API_KEY |
DEEPSEEK_BASE_URL (https://api.deepseek.com/v1) |
openrouter |
OpenRouter | OPENROUTER_API_KEY |
OPENROUTER_BASE_URL (https://openrouter.ai/api/v1) |
cocore |
co/core | COCORE_API_KEY |
COCORE_BASE_URL (https://cocore.dev/api/v1) |
ollama |
Ollama | OLLAMA_API_KEY (default ollama) |
OLLAMA_BASE_URL (http://localhost:11434/v1) |
lmstudio |
LM Studio | LMSTUDIO_API_KEY (default lm-studio) |
LMSTUDIO_BASE_URL (http://localhost:1234/v1) |
vllm |
vLLM | VLLM_API_KEY (default not-needed) |
VLLM_BASE_URL (http://localhost:8000/v1) |
Anthropic
Section titled “Anthropic”Anthropic uses its own API and adapter (anthropic):
| Setting | Environment variable |
|---|---|
| API key | ANTHROPIC_API_KEY |
| Base URL (optional) | ANTHROPIC_BASE_URL |
Any other OpenAI-compatible provider
Section titled “Any other OpenAI-compatible provider”Because the OpenAI-compatible adapters are just a base URL and an API key, you can point any of them at another service. The most common approach is to reuse the openai adapter and override its base URL:
OPENAI_BASE_URL=https://your-provider.example.com/v1OPENAI_API_KEY=your-api-keyAI_DEFAULT_MODEL=openai://your-model-nameExamples
Section titled “Examples”OpenAI
Section titled “OpenAI”AI_IS_ENABLED=trueOPENAI_API_KEY=sk-...AI_DEFAULT_MODEL=openai://gpt-4o-miniAnthropic
Section titled “Anthropic”AI_IS_ENABLED=trueANTHROPIC_API_KEY=sk-ant-...AI_DEFAULT_MODEL=anthropic://claude-haiku-4-5Ollama (local)
Section titled “Ollama (local)”A local Ollama install is reachable on its default URL, so you only need to point Papra at the right adapter and model:
AI_IS_ENABLED=trueAI_DEFAULT_MODEL=ollama://qwen3:8bIf Ollama runs on another host or port, override the base URL (keep the /v1 suffix):
OLLAMA_BASE_URL=http://ollama:11434/v1