llm strategy hands each tick to a real model. The model researches via tools, forms a thesis, and submits a structured decision. The runtime (not the model) owns execution and enforces hard guardrails (budget, real strikes, valid oracles).
Files
Tool loop
llmAgent.ts gives the model four research tools plus a terminal submit_decision:
submit_decision on the last. Returns a typed LlmDecision.
Decision shape
Runtime guardrails
llm.ts. OpenAI-compatible fetch client
api.anthropic.com/v1), Ollama, Atoma. Anything that speaks /v1/chat/completions. Zero new deps.
Provider presets
LLM_PROVIDER (groq | anthropic | openai | ollama) picks base URL + default model:
| Provider | Default Base URL | Default Model |
|---|---|---|
groq | https://api.groq.com/openai/v1 | llama-3.3-70b-versatile |
anthropic | https://api.anthropic.com/v1 | claude-haiku-4-5 |
openai | https://api.openai.com/v1 | gpt-4o-mini |
ollama | http://localhost:11434/v1 | llama3.1:8b |
LLM_BASE_URL / LLM_MODEL override.
Example tick (Groq + momentum mandate)
Limits
- Tool loop is bounded at 8 steps. The model must converge or hold.
- Spend per tick is bounded at
AGENT_TRADE_DUSDC. Runtime caps, not model honor system. - Strikes must exist in the book at execution time. The model can never “invent” a strike.