Getting started
Configuration
Everything is configured through environment variables. Secrets stay in a .env file or the OS keyring, never in a prompt or a source file.
Where settings are read from
Vibe-Trading reads the first of these files that exists, and only that one:
~/.vibe-trading/.env— written byvibe-trading initagent/.envin a source checkout.envin the current directory
A variable exported in your shell always wins over the file. The Settings page of the web UI edits the model and data-source values for you.
Model provider
| Variable | Meaning |
|---|---|
LANGCHAIN_PROVIDER | Provider name: openrouter, deepseek, openai, anthropic, gemini, ollama, … (25 built in) |
LANGCHAIN_MODEL_NAME | Model id, for example deepseek-v4-pro |
<PROVIDER>_API_KEY | The key, for example DEEPSEEK_API_KEY |
<PROVIDER>_BASE_URL | The API endpoint |
LANGCHAIN_REASONING_EFFORT | Optional: none, low, medium, high or max |
LANGCHAIN_PROVIDER=deepseek
LANGCHAIN_MODEL_NAME=deepseek-v4-pro
DEEPSEEK_API_KEY=sk-xxx
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
- ChatGPT sign-in (Codex): set
LANGCHAIN_PROVIDER=openai-codexand runvibe-trading provider login openai-codex. NoOPENAI_API_KEYis used; the default model isgpt-6-sol. - GitHub Copilot:
pip install "vibe-trading-ai[copilot]", thenLANGCHAIN_PROVIDER=copilot; it signs in with yourghor Copilot CLI credentials. - Ollama: no key needed.
Choosing a model
Everything the agent does goes through tool calls, so the model decides whether it uses its tools or answers from memory. Use a strong tool-calling model for long research runs, swarms and multi-step backtests. Avoid *-nano, *-flash-lite and small distilled models: their tool calls are unreliable, and the answer will look fluent while no data was fetched.
Market-data keys (optional)
A-shares, Hong Kong, US, Canada, UK, India, Korea, crypto and forex all work without a key. Keys add sources or depth:
TUSHARE_TOKEN— richer A-share, fund and macro data.GILDATA_TOKEN— Hundsun Juyuan commercial A-share feed.- Finnhub, Alpha Vantage, Tiingo and FMP keys — extra US sources.
- Data partner: Gildata. Each Gildata feature requires a token and a separate opt-in in Settings.
See Data sources for which source serves which market.
Long runs and timeouts
| Variable | Default | Meaning |
|---|---|---|
VIBE_TRADING_CONTEXT_WINDOW | see below | Your model's context window in tokens. Without it, the window comes from a limit the provider reported during the run, else the built-in model catalog, else 128K. |
VIBE_TRADING_CONTEXT_MAX_TOKENS | 200000 | The most one request may send, whatever the window. It caps cost. |
TIMEOUT_SECONDS | 120 | Timeout of one model request. |
VIBE_TRADING_TOOL_TIMEOUT_SECONDS | 1800 | Hard timeout of a read-only tool or a backtest; 0 disables it. |
TOKEN_THRESHOLD was removed in 0.1.16. It is ignored with a warning; delete it from your .env.
Serving beyond your own machine
Without API_AUTH_KEY, the API answers sensitive requests only from the same machine. To use the web UI from another device, set a strong API_AUTH_KEY, send Authorization: Bearer <key> from clients, and enter the same key once in the web UI's Settings. VIBE_TRADING_EXTRA_CORS_ORIGINS adds allowed browser origins.
Shell tools are enabled only in the local interactive terminal. The API and the MCP server keep them off unless you set VIBE_TRADING_ENABLE_SHELL_TOOLS=1.
Files and folders
VIBE_TRADING_HOME— where runs, sessions, memory, connectors and the audit ledger live; default~/.vibe-trading.VIBE_TRADING_ALLOWED_FILE_ROOTS— extra folders, comma-separated, from which documents and broker journals may be imported.VIBE_TRADING_ALLOWED_RUN_ROOTS— extra folders in which generated strategy code may run.