Skip to content

Conversation

@opencode-agent
Copy link

Perfect! Here's a complete summary of how to configure models for each agent and subagent:

Complete Process for Model Configuration

1. Edit the Agent File

Navigate to your agent's markdown file and add the model parameter to the YAML frontmatter:

---
id: your-agent-id
name: YourAgentName
description: "Agent description"
model: anthropic/claude-sonnet-4-20250514  # Add this line
temperature: 0.1
---

2. Choose the Right Model

Visit https://models.dev/?search=open to find available models and their IDs. Popular choices:

  • High-performance tasks: anthropic/claude-sonnet-4-20250514
  • Cost-effective tasks: anthropic/claude-haiku-3-20241022
  • OpenAI alternative: openai/gpt-4o or openai/gpt-4o-mini
  • Open source: meta-llama/llama-3.3-70b-instruct

3. Agent File Locations

Global agents (all projects): ~/.config/opencode/agents/
Project-specific agents (current project): .opencode/agents/

4. Example I Created

I've created example-agent-configs.md in this repository showing different model configurations for various agent types, and I've updated the existing reviewer agent to use Claude Sonnet 4 for high-quality code reviews.

5. Key Points

  • Each agent can have its own model and temperature
  • Project agents override global agents with the same ID
  • Changes take effect the next time you invoke the agent
  • Different models have different costs and capabilities - choose based on your needs

The configuration is now ready! Each time you use an agent, it will use the model specified in its configuration file instead of your default model.

Closes #135

New%20session%20-%202026-01-29T14%3A17%3A04.101Z
opencode session  |  github run

Co-authored-by: darrenhinde <darrenhinde@users.noreply.github.com>
@github-actions
Copy link
Contributor

❌ Invalid PR Title Format

Current title: Add model: provider/model-id to agent.md

Required Format

PR titles must follow Conventional Commits format:

<type>(<scope>): <description>

Valid Types

  • feat - New feature (triggers minor version bump: 0.3.0 → 0.4.0)
  • fix - Bug fix (triggers patch version bump: 0.3.0 → 0.3.1)
  • docs - Documentation changes (triggers patch bump)
  • test - Test additions/changes (triggers patch bump)
  • refactor - Code refactoring (triggers patch bump)
  • chore - Maintenance tasks (triggers patch bump)
  • ci - CI/CD changes (triggers patch bump)
  • perf - Performance improvements (triggers patch bump)
  • style - Code style changes (triggers patch bump)
  • build - Build system changes (triggers patch bump)
  • revert - Revert previous commit (triggers patch bump)

Breaking Changes

  • feat!: or fix!: - Breaking change (triggers major version bump: 0.3.0 → 1.0.0)
  • BREAKING CHANGE: in description

Pre-release Tags

  • [alpha] - Alpha release (0.3.0 → 0.3.1-alpha.1)
  • [beta] - Beta release (0.3.0 → 0.3.1-beta.1)
  • [rc] - Release candidate (0.3.0 → 0.3.1-rc.1)

Valid Examples

  • ✅ feat(evals): add new evaluator

  • ✅ fix(agents): correct delegation logic

  • ✅ docs(readme): update installation guide

  • ✅ test(evals): add execution-balance tests

  • ✅ chore(deps): update dependencies

  • ✅ feat!: breaking API change

  • ✅ [alpha] experimental feature

    Why This Matters

    • ✅ Enables automatic semantic versioning
    • ✅ Generates meaningful changelogs
    • ✅ Makes commit history searchable
    • ✅ Clarifies the impact of changes

    How to Fix

    Edit your PR title to match the format above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

how to choose models for each agent and subagent?

0 participants