Skip to content

feat: add per-agent model configuration support#2467

Draft
laststylebender14 wants to merge 11 commits intomainfrom
feat/allow-user-to-configure-model-per-agent
Draft

feat: add per-agent model configuration support#2467
laststylebender14 wants to merge 11 commits intomainfrom
feat/allow-user-to-configure-model-per-agent

Conversation

@laststylebender14
Copy link
Contributor

@laststylebender14 laststylebender14 commented Feb 26, 2026

Summary

Add per-agent model configuration support, allowing users to set a specific model for each agent via CLI commands rather than using only global defaults.

Context

Currently, users can only set a global default model for the entire application. This PR enables per-agent model overrides, giving more flexibility when working with multiple agents that may require different models (e.g., o1 for reasoning tasks, GPT-4 for creative tasks).

Changes

  • Added AgentModelConfig domain type to store both provider and model per agent
  • Extended AppConfig with new agent_model HashMap for per-agent overrides
  • Added set_agent_model and get_agent_model service methods
  • Updated AgentProviderResolver to resolve models with priority: agent config > active agent YAML > global default
  • Added set-agent-model CLI command to configure per-agent models

Key Implementation Details

Model IDs are scoped to a specific provider's namespace, so both provider and model are stored together in AgentModelConfig. The resolution priority is:

  1. Per-agent config (from app config)
  2. Active agent's model (from agent YAML definition)
  3. Global provider model (from app config)

Use Cases

  • Configure "reasoning" agent to always use o1 model
  • Set "creative" agent to use GPT-4 for specific tasks
  • Override model for agents defined in YAML without modifying the YAML files

Testing

# Set model for a specific agent
forge config set-agent-model my-agent provider model

# Verify the setting is persisted
forge config get-agent-model my-agent

# Test that agent uses the configured model
forge chat --agent my-agent

Links

  • Related: Enables flexible multi-model agent workflows

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Feb 26, 2026
@laststylebender14 laststylebender14 changed the title feat(agent): add per-agent model configuration support feat: add per-agent model configuration support Feb 27, 2026
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant