Repository navigation
AI Model Guide
DerivLab uses a provider-agnostic HTTP client. No provider SDK is required; OpenAI-compatible endpoints and Anthropic are supported.
| Role | Primary | Alternatives | Why |
|---|---|---|---|
| AlphaVanguard critic | OpenAI GPT-5 (if your organization is verified) | Claude Sonnet 4.5, Gemini 2.5 Pro, GPT-4.1 | Multi-metric reasoning, nuanced risk critique, strict Markdown. |
| NewsWire | OpenAI GPT-5 mini (if verified) | Claude Haiku 4.5, Gemini 2.5 Flash, GPT-4.1-mini | Latency and cost matter more than deep reasoning for four headlines. |
| Autonomous decisions | Deterministic local policy | GPT-4.1-mini with JSON mode, Claude Haiku 4.5, Qwen3-32B | Reproducible and auditable. LLM decisions are opt-in and validated. |
| Offline / private | Qwen3-32B via Ollama or vLLM | Llama 3.3 70B, Mistral Small 3 | Data stays local and there is no per-call cost. |
The project was tested with a real OpenAI key:
- OpenAI model list:
gpt-4.1andgpt-4.1-minireturned200. -
gpt-5andgpt-5-minireturned404: “Your organization must be verified to use the model.” - The live Arena was run with:
- critic:
gpt-4.1(HTTP 200, valid three-section report) - news:
gpt-4.1-mini(HTTP 200, four valid headlines) - decisions: local deterministic policy (default)
- critic:
This is the recommended fallback when GPT-5 is not available to your organization.
DERIVLAB_LLM_PROVIDER=openai
DERIVLAB_LLM_BASE_URL=https://api.openai.com/v1
DERIVLAB_LLM_API_KEY=sk-...
DERIVLAB_DECISION_MODEL=gpt-4.1-mini
DERIVLAB_CRITIC_MODEL=gpt-4.1
DERIVLAB_NEWS_MODEL=gpt-4.1-miniGPT-5 caveat: availability depends on organization verification and the models enabled for your key. DerivLab displays the exact returned error in the Model stack tab and falls back locally; it never hides the failure.
| Variable | Default | Purpose |
|---|---|---|
DERIVLAB_LLM_PROVIDER |
local |
local, openai, anthropic, openai_compatible, ollama, lmstudio, vllm
|
DERIVLAB_LLM_API_KEY |
empty | Provider key; never commit it |
DERIVLAB_LLM_BASE_URL |
provider default | API base URL |
DERIVLAB_LLM_MODEL |
provider default | Shared model for all roles |
DERIVLAB_DECISION_MODEL |
provider default | Agent mandates |
DERIVLAB_CRITIC_MODEL |
provider default | AlphaVanguard review |
DERIVLAB_NEWS_MODEL |
provider default | NewsWire |
DERIVLAB_LLM_TIMEOUT |
25 |
Request timeout in seconds |
The app loads a project-root .env automatically for local runs. Docker Compose
also reads .env for variable substitution; recreate the container after a
change:
docker compose up -d --force-recreateDERIVLAB_LLM_PROVIDER=openai
DERIVLAB_LLM_API_KEY=sk-...
DERIVLAB_DECISION_MODEL=gpt-4.1-mini
DERIVLAB_CRITIC_MODEL=gpt-4.1
DERIVLAB_NEWS_MODEL=gpt-4.1-miniDERIVLAB_LLM_PROVIDER=anthropic
DERIVLAB_LLM_API_KEY=sk-ant-...
DERIVLAB_CRITIC_MODEL=claude-sonnet-4-5
DERIVLAB_NEWS_MODEL=claude-haiku-4-5DERIVLAB_LLM_PROVIDER=ollama
DERIVLAB_LLM_BASE_URL=http://host.docker.internal:11434/v1
DERIVLAB_LLM_MODEL=qwen3:32b- The critic is the expensive call; run it once per cycle.
- The wire is a fast, low-token call.
- Agent decisions are local by default; an LLM decision call is optional.
- A full live cycle with the tested configuration returned in roughly 8–12 seconds for the two narrative calls, excluding simulation time.
- The app never retries indefinitely; timeouts fall back gracefully.
- Keys are read from the environment and are never rendered.
- Docker Compose passes a key from the host environment or
.env; production should use Docker secrets becausedocker inspectcan expose environment variables. - LLM output is untrusted Markdown; no raw HTML is rendered.
- See Security.
When choosing a model, test:
- Does it follow the exact three headings?
- Does it mention the supplied metrics instead of inventing numbers?
- Does it return valid JSON for the wire?
- Does it handle a provider timeout without breaking the UI?
- Does the Model stack tab show the expected model and source?
If any answer is no, the local fallback is doing its job; switch models or keep the deterministic path.
Model choice is only one part of reliability. See LLM Quality & Safety for the hard contracts, local fallbacks, and human review rubric.
DerivLab · an educational options & futures strategy emulator · docs verified against v1.2.0 on 2026-10-23 · README · Docs feedback · MIT License · Not investment advice.
Start here
- Home
- Getting Started
- Compatibility & Versions
- Feature Tour
- FAQ
- Documentation & ADRs
- Versioning
- Roadmap
Core systems
- Architecture
- Backtest Engine
- Strategy Library
- AI Agents
- AI Model Guide
- LLM Quality & Safety
- Data Pipeline
- Game Mode
Engineering
- Configuration
- Testing & CI
- Deployment
- Security
- Project Structure
- Troubleshooting
- Glossary
- Release Notes