agora.fleet.strategies
Per-model prompting strategies (axis-1 v2, Phase 3).
A strategy is a small, model-specific transform applied to the three inputs
of one complete() call — the system prompt, the tool manifest, and the
message history — to compensate for a documented prompting mismatch (see
docs/research/prompting-strategies.md). Strategies never touch tool
execution or the assistant-turn / tool-result shaping; those pass through
untouched.
The mechanism is a wrapper, never a modification of the underlying adapter:
StrategyAdapter composes over any LLMProtocol
implementation and applies the strategy’s three wrap_* hooks around
complete. The base Strategy is identity on all three, so a
strategy overrides only the hook its mismatch requires.
Selection travels by name (campaign YAML → AGORA_STRATEGY env → runner),
mirroring the AGORA_ARM_* pattern. strategy is None means no wrapper is
constructed at all — the null path is byte-identical to axis-1 v1 by
construction, not by proof.
Module Attributes
Every selectable strategy, keyed by the name used in campaign YAML and the |
Functions
|
Resolve a strategy name to its instance. |
Classes
Base strategy: identity on all three wraps. |
|
Wrap an inner |
- class agora.fleet.strategies.Strategy[source]
Bases:
objectBase strategy: identity on all three wraps.
Concrete strategies subclass and override only the hook their documented mismatch requires; the other two stay identity.
- class agora.fleet.strategies.StrategyAdapter[source]
Bases:
objectWrap an inner
LLMProtocol, applyingstrategyaroundcomplete.The three
wrap_*hooks fire on the system / tools / messages passed tocomplete;format_assistant_turnandformat_tool_resultsare passed straight through so the wire shaping is unchanged. This is a composition, not a subclass — the inner adapter is untouched.
- agora.fleet.strategies.STRATEGIES: dict[str, Strategy] = {'mistral_nemo': <agora.fleet.strategies.mistral_nemo.MistralNemoStrategy object>, 'qwen2_5_coder': <agora.fleet.strategies.qwen2_5_coder.Qwen25CoderStrategy object>}
Every selectable strategy, keyed by the name used in campaign YAML and the
AGORA_STRATEGYenv var.load_campaignvalidates run.strategy against these keys, so a typo fails at load, not at run 23 of 40.
- agora.fleet.strategies.resolve(name)[source]
Resolve a strategy name to its instance.
Noneor empty ⇒None(no strategy; caller constructs no wrapper). An unknown non-empty name raisesKeyError— callers that accept user input should validate againstSTRATEGIESfirst (load_campaigndoes), so reaching here with a bad name is a programming error worth failing loudly on.
Modules
|
|
|