Skip to content

Opencode calls 'Claude 3.5 Haiku' on session start, despite selecting a custom model #1243

Closed

Description

@SteveHere

This is an edge case that I keep finding myself in.

Given the following opencode.json config (bodging together suggestions from a comment in #1050 & a comment in #1038):

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openrouter": {
      "options": { 
        "name": "OpenRouter"
      },
      "models": {
        "moonshotai/kimi-k2:free": {
          "name": "MoonshotAI: Kimi K2 (free) - Chutes",
          "attachment": false,
          "reasoning": true,
          "temperature": true,
          "tool_call": true,
          "limit": {
            "context": 60000,
            "output": 60000
          },
          "options": {
            "tools": true,
            "openrouter": {
              "provider": {
                "order": ["chutes/fp8"],
                "allow_fallbacks": false
              }
            },
            "OpenRouter": {
              "provider": {
                "order": ["chutes/fp8"],
                "allow_fallbacks": false
              }
            }
          }
        }
      }
    }
  }
}

(the almost-similar "openrouter" keys are just there to make sure opencode actually shoves in the specified provider info)

And selecting the custom model, when I start a new session and enter a test prompt, these prompts appear on my 'Activity' page using the Claude model instead of the specified Kimi K2 model:

Image

Afterwards, the issue no longer appears: It only pops up when a new session is created & the first prompt is given (any prompt).

Activity

  1. rekram1-node commented on Jul 23, 2025

    @rekram1-node
    Collaborator

    opencode does use a small model to generate titles, in many cases claude 3.5 haiku if it is available

    That seems like what you are seeing especially since you mentioned it only happens at session start (and that is when title is generated)

  2. self-assigned this
    on Jul 23, 2025
  3. thdxr commented on Jul 23, 2025

    @thdxr
    Member

    ^ yes that's right and you can override small model in the config if you want to control that

  4. SteveHere commented on Jul 28, 2025

    @SteveHere
    Author

    Belated response (& note for future me): Fixed the issue by specifying the small_model value in the config file.

    DX note: It took looking at the hosted config.json schema to see which value should be changed. I couldn't see it in the documentation because it was out of sync with the .mdx file.

    Will be making a new issue for this.

  5. filmo commented on Mar 11, 2026

    @filmo

    Belated response (& note for future me): Fixed the issue by specifying the small_model value in the config file.

    DX note: It took looking at the hosted config.json schema to see which value should be changed. I couldn't see it in the documentation because it was out of sync with the .mdx file.

    Will be making a new issue for this.

    Can you provide a sample of your revised opencode.json config for setting the small_model?

    EDIT: 2026-03-27 => Here's what I did to adjust it to Mistral Small in my opencode.json file:

    {
      "$schema": "https://opencode.ai/config.json",
      "small_model": "openrouter/mistralai/mistral-small-3.2-24b-instruct",
      "mcp": { ... },
      ...
    }

    And it seems to work.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions