feat: per-persona model support for swarm deliberation#1
Open
NOVA-Openclaw wants to merge 1 commit into
Open
Conversation
Allow each swarm persona (Strategist, Economist, Naturalist, Skeptic) to use a different Ollama model during forecast deliberation, configured via environment variables: SWARM_MODEL_STRATEGIST=qwen2.5:32b SWARM_MODEL_ECONOMIST=qwen2.5:32b SWARM_MODEL_NATURALIST=gemma3:12b SWARM_MODEL_SKEPTIC=deepseek-r1:14b When unset, each persona falls back to the main LLM_MODEL, preserving existing behavior. This enables matching model strengths to persona roles — e.g. a chain-of-thought reasoning model for the Skeptic's base-rate analysis, or a larger model for the Strategist's geopolitical reasoning. Changes: - config.py: add swarm_persona_models dict from SWARM_MODEL_* env vars - oracle.py: add optional model parameter to _complete() - swarm.py: look up per-persona model and pass it through - .env.example: document new env vars with examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow each swarm persona (Strategist, Economist, Naturalist, Skeptic) to use a different Ollama model during forecast deliberation, configured via environment variables.
Motivation
Each persona judges predictions through a fundamentally different lens. Different model architectures have different strengths that align naturally with these roles:
deepseek-r1) excels at the Skeptic's job — stress-testing assumptions, checking base rates, and playing devil's advocate via chain-of-thought reasoningqwen2.5:32b) brings deeper analytical capacity to the Strategist and Economist's geopolitical and macro-economic analysisgemma3:12b) handles the Naturalist's disaster/weather/health pattern matching efficientlyRunning all four on the same model means you're either over-provisioning for simple personas or under-provisioning for complex ones.
Configuration
New optional environment variables in
.env:When unset, each persona falls back to the main
LLM_MODEL, preserving existing behavior. Zero breaking changes.Changes
engine/config.py— Addswarm_persona_modelsdict built fromSWARM_MODEL_*env varsengine/oracle.py— Add optionalmodelparameter to_complete()(2-line change)engine/swarm.py— Look up per-persona model and pass it through to_complete().env.example— Document new env vars with suggested model mappingsDesign Notes
asyncio.gather, so different-sized models just finish at different speeds — no architectural changes neededmodel or self.model