trader.llm.base module¶
The LLM interface the Core depends on.
A Protocol for the same reason BrokerAdapter is one: the Core holds no HTTP client, tests need no server, and a second provider is an addition rather than a rewrite.
Anthropic is a deferred future feature, not a planned step — see docs/ideas.md for the trigger conditions. This Protocol exists so that decision stays cheap to revisit, not because a second provider is scheduled.
- exception trader.llm.base.LlmError[source]¶
Bases:
TraderErrorThe language model call failed or returned something unusable.
Derives from TraderError so the pipeline’s per-symbol handler treats a model failure the way it treats a market-data failure: abort that symbol, record why, continue the cycle.
- class trader.llm.base.LlmProvider(*args, **kwargs)[source]¶
Bases:
ProtocolA model that returns structured JSON.
- model: str¶