Skip to content

Configuration

Settings

Server environment

QINIU_API_KEY="sk-xxxxxxxxxxxxxxxx"
QINIU_BASE_URL="https://api.openai.com/v1"
QINIU_MODEL="gpt-4o-mini"
LLM_PROVIDER="openai"

HOST="127.0.0.1"
PORT="5000"
FLASK_ENV="production"
VULCAN_API_TOKEN=""
VULCAN_RATE_LIMIT_PER_MINUTE="60"
VULCAN_RATE_LIMIT_MAX_KEYS="10000"
VULCAN_TRUST_PROXY="false"
VULCAN_ALLOW_CUSTOM_LLM_BASE_URL="true"
MAX_PROMPT_LENGTH="4000"
MAX_TREE_LENGTH="32768"
MAX_CONTEXT_LENGTH="16384"
MAX_REPAIR_ATTEMPTS="1"
LLM_TIMEOUT="30"
LOG_LEVEL="INFO"
LOG_FILE="vulcan_server.log"

The QINIU_* names are historical: the first deployment used Qiniu Cloud. They only matter to config.py; LLM_PROVIDER selects the provider family.

Variable Default Purpose
QINIU_API_KEY none Provider API key
QINIU_BASE_URL none OpenAI-compatible base URL
QINIU_MODEL gpt-oss-120b Model name
LLM_PROVIDER openai Provider family: openai (chat completions) or anthropic (Messages API)
HOST 127.0.0.1 Bind address; use 0.0.0.0 only behind a trusted reverse proxy
PORT 5000 Server port
FLASK_ENV production Set to development to enable Flask debug mode
VULCAN_API_TOKEN none Optional bearer token required from clients
VULCAN_RATE_LIMIT_PER_MINUTE 60 Per-IP limit for the generate endpoint; 0 disables it
VULCAN_RATE_LIMIT_MAX_KEYS 10000 Upper bound on tracked client keys; oldest keys are evicted first
VULCAN_TRUST_PROXY false Trust one reverse-proxy hop for X-Forwarded-For and X-Forwarded-Proto
VULCAN_ALLOW_CUSTOM_LLM_BASE_URL true Allow per-request X-LLM-Base-URL overrides; set false on shared servers
MAX_LLM_API_KEY_LENGTH 512 Maximum accepted BYOK key length
MAX_LLM_BASE_URL_LENGTH 512 Maximum accepted custom base URL length
MAX_PROMPT_LENGTH 4000 Maximum prompt length in characters
MAX_TREE_LENGTH 32768 Maximum characters in a revision current_tree
MAX_CONTEXT_LENGTH 16384 Maximum characters in the document context
MAX_REPAIR_ATTEMPTS 1 Retries for a rejected model output; 0 disables self-repair
LLM_TIMEOUT 30 Upstream request timeout in seconds
LOG_LEVEL INFO Log level; prompts are logged by length only at INFO
LOG_FILE vulcan_server.log Rotating log file

Provider examples

Provider QINIU_BASE_URL Example model
OpenAI https://api.openai.com/v1 gpt-4o-mini
DeepSeek https://api.deepseek.com/v1 deepseek-chat
Qwen (DashScope compatible mode) https://dashscope.aliyuncs.com/compatible-mode/v1 qwen-plus
Ollama http://localhost:11434/v1 a model served locally
vLLM http://localhost:8000/v1 your served model
Anthropic https://api.anthropic.com/v1 with provider anthropic claude-opus-5-5

Use a model with strong instruction-following and reliable JSON output. Weak models produce the classic failure modes: markdown wrappers, prose before the JSON, or coordinates that overlap.

Client settings

The add-in is configured in its own dialog: click 设置 in the task pane or on the Vulcan AI tab.

Field Purpose
Server URL The Vulcan server, for example https://vulcan.example.com
Server token Matches VULCAN_API_TOKEN when the server requires a bearer token
LLM API Key Your own provider key; leave empty to use the server's key
LLM Base URL OpenAI-compatible base URL for your provider
LLM Provider openai or anthropic; selects the request shape sent to your provider
LLM Model Model name, for example gpt-4o-mini

The dialog also has 测试连接 (health check), 打开日志目录 (open the client log folder), 取消, and 保存. Settings are written to %APPDATA%\Vulcan\settings.json; ServerToken and LlmApiKey are encrypted with Windows DPAPI for the current user, so the file is not portable across machines or accounts and must never be committed.

Resolution order for the server URL is: explicit constructor argument → settings dialog → VULCAN_SERVER_URL → http://127.0.0.1:5000. The token follows the same order. The LLM overrides are sent to the server as X-LLM-API-Key, X-LLM-Base-URL, and X-LLM-Model; empty fields are omitted, so the server falls back to its own QINIU_* configuration.

The environment variables still work for scripted or shared deployments:

setx VULCAN_SERVER_URL "https://vulcan.example.com"
setx VULCAN_API_TOKEN "your-shared-token"

Non-loopback hosts must use HTTPS unless VULCAN_ALLOW_INSECURE=true is set for a trusted LAN.

Tuning

  • temperature 0.05, top_p 0.95, max_tokens 2048 in providers.py control the model call.
  • MAX_REPAIR_ATTEMPTS = 1 in config.py controls how many times a rejected output is fed back. 0 disables auto-repair.
  • LLM_TIMEOUT = 30 in config.py controls the server-side request timeout.
  • ApiClient uses a 120-second client timeout so the server can wait out a slow model response plus one repair attempt. Keep it above (MAX_REPAIR_ATTEMPTS + 1) * LLM_TIMEOUT.