Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error interacting with language model - DeepSeek-R1 #24067

Open
1 task done
danajerban opened this issue Feb 1, 2025 · 2 comments
Open
1 task done

Error interacting with language model - DeepSeek-R1 #24067

danajerban opened this issue Feb 1, 2025 · 2 comments

Comments

@danajerban
Copy link

danajerban commented Feb 1, 2025

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I have configured DeepSeek R1 via kluster.ai . They have OpenAI compatibility and everything is working fine, however there is an error/warning shown at the bottom of the assistant panel while interacting with it. Also, this error doesn't occur when using the official DeepSeek API with direct configuration (via assistant: open configuration), as documented in the Zed docs.

Bug

Error interacting with language model
data did not match any variant of untagged enum
ResponseStreamResult

Reference screenshot Image

Configuration at Zed settings.json file

 "language_models": {
    "openai": {
      "api_url": "https://api.kluster.ai/v1",
      "api_key": "api-key",
      "version": "1",
      "available_models": [
        {
          "name": "deepseek-ai/DeepSeek-R1",
          "display_name": "DeepSeek R1",
          "max_tokens": 64000,
          "temperature": 0.7
        }
      ]
    }
  },
 "assistant": {
    "default_model": {
      "provider": "openai",
      "model": "deepseek-ai/DeepSeek-R1"
    },
    "version": "2"
  }

Zed Version and System Specs

Zed: v0.171.5 (Zed)
OS: macOS 15.2.0
Memory: 18 GiB
Architecture: aarch64

@itsaphel
Copy link

itsaphel commented Feb 1, 2025

It may be that their API compatibility isn't exactly the same as OpenAI's?

It'd be interesting to see the raw response body. It's hard for me to debug as I don't have a kluster.ai account, but if you're able to compile a version of Zed, you could add a dbg! here to get the body.

@danajerban
Copy link
Author

@itsaphel Firstly, thanks for your response!

Now, I tried to add the debugging line you suggested, but I'm having trouble seeing the actual response body content. I added:
dbg!(response) before let reader = BufReader::new(response.into_body());

However, I'm seeing that the response is an AsyncReader type, and this way is giving me compiling errors. Could you show me how to debug this response content/body in this case? I've been trying to understand whats going on and different approaches (using AI only because I have 0 knowledge of Rust unfortunately). Btw, I can see the status (200) and headers, and as I said everything is working fine (even in complied version) but need your help now on how to access this streaming body.

PS: I also tried 'peeking' at this first chunk - to be honest I have no idea what I am doing, but trying and apparently Claude sucks at Rust 🙃

Screenshot here Image

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

No branches or pull requests

2 participants