zed icon indicating copy to clipboard operation
zed copied to clipboard

OpenAI compatible provider: hard coded `default_fast` as `gpt-4.1-mini`

Open mratsim opened this issue 6 months ago • 2 comments

Summary

The Agent tries to call gpt-4.1-mini instead of the default model set when trying an agentic workflow

Description

Configuration

{
  "agent": {
    "always_allow_tool_actions": true,
    "default_model": {
      "provider": "openai",
      "model": "glm-4-32b"
    },
    "version": "2"
  },
  "language_models": {
    "openai": {
      "api_url": "http://${HOST}:${PORT}/v1",
      "available_models": [
        {
          "name": "glm-4-32b",
          "display_name": "GLM4 - 32b | vLLM",
          "max_tokens": 130000
        },
  },
}

When asking the following for example

We'll start a new Rust project from scratch that implements a snake game in 2D.

I get the following output

The user wants me to start a new Rust project that implements a snake game in 2D. Let's break down what we need to do:

1. First, I need to create a new Rust project using `cargo new`.
2. I'll need to create the Game structure and main game loop.
3. Implement the snake's movement and collision detection.
4. Add UI elements, etc.

I'll start by creating the necessary project structure and files. Let me create a directory for our project:

Then looking in vLLM logs, i see references to gpt-4.1-mini

Image

Zed Version and System Specs

Zed: v0.187.5 (Zed) OS: Linux Wayland arch unknown Memory: 184.3 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO) || radv || Mesa 25.1.1-arch1.1

mratsim avatar May 26 '25 10:05 mratsim

Yep. Looks like we define a default_fast for each provider, and since you're using the OpenAI provider Zed defaults to gpt-4.1-mini:

https://github.com/zed-industries/zed/blob/28398af1ecb05ac9e6c0526967b3de3217deb4fe/crates/open_ai/src/open_ai.rs#L101-L103

As a workaround can, you try specifying you feature specific models for commit messages and thread summary?

  "agent": {
    "version": "2",
    "commit_message_model": {
      "provider": "openai",
      "model": "something-else"
    },
    "thread_summary_model": {
      "provider": "openai",
      "model": "something-else"
    }
  }

notpeter avatar May 28 '25 15:05 notpeter

The workaround works, thank you.

mratsim avatar May 31 '25 12:05 mratsim

This should be fixed with new openai compatible provider.

imumesh18 avatar Sep 08 '25 20:09 imumesh18