Research CommonsResearch Commons
docparser/Configuration

Configuration

Configure docparser's VLM providers and defaults via environment variables or a .env file.

docparser reads configuration from the environment (or a .env file in the working directory). Most settings control the VLM captioning provider — parsing itself needs no configuration.

.env variables

VarDefaultPurpose
DOCPARSER_VLM_PROVIDERopenrouteropenrouter / openai / gemini / local
OPENROUTER_API_KEYrequired for OpenRouterOpenRouter key (sk-or-...)
OPENROUTER_VLM_MODELanthropic/claude-sonnet-4any vision-capable OpenRouter model
OPENROUTER_BASE_URLhttps://openrouter.ai/api/v1override for a proxy
OPENROUTER_REFERER / OPENROUTER_TITLErepo URL / docparserOpenRouter attribution headers
OPENAI_API_KEY / OPENAI_VLM_MODELrequired for OpenAI / gpt-4o-miniOpenAI provider
GEMINI_API_KEY / GEMINI_VLM_MODELrequired for Gemini / gemini-1.5-flashGemini provider
DOCPARSER_VLM_BASE_URLhttp://localhost:11434/v1base URL for the local provider
DOCPARSER_VLM_API_KEY / DOCPARSER_VLM_MODEL— / llavakey + model for the local provider
DOCPARSER_LOCAL_VLM_MODELSalesforce/blip-image-captioning-largemodel for the transformers backend

Example .env

# OpenRouter (default provider)
OPENROUTER_API_KEY=sk-or-v1-...
OPENROUTER_VLM_MODEL=anthropic/claude-sonnet-4

Or for a fully-local Ollama-style server:

DOCPARSER_VLM_PROVIDER=local
DOCPARSER_VLM_BASE_URL=http://localhost:11434/v1
DOCPARSER_VLM_MODEL=llava

Precedence

CLI flags (--vlm-provider, --vlm-model) and library arguments (provider=, model=) override the environment, so you can set a sane default in .env and adjust per-run.

No keys needed for parsing

Configuration only matters when captioning is enabled. Run with --no-vlm (CLI) or use_vlm=False (library) to parse documents without any API keys.

Next