Skip to content

[BUG] deepseek-v4-pro does not support strucutured output #766

Description

@drale2k

Basic checks

  • I searched existing issues - this hasn't been reported
  • I can reproduce this consistently
  • This is a RubyLLM bug, not my application code

What's broken?

I cana properly use RubyLLM::Schema with OpenAI and Gemini, but for deepseek, even though the docs for deepseek-v4-pro say it supports structured output, i get the following error:

RubyLLM::BadRequestError
This response_format type is unavailable now

How to reproduce

 class CopywriterSchema < RubyLLM::Schema
    string :title, description: "Byte title"
    string :subtitle, description: "Byte subtitle"
    string :summary, description: "Detailed byte summary"
  end

RubyLLM.chat(model: "deepseek-v4-pro").with_schema(CopywriterSchema).ask(prompt).content

Expected behavior

Return as defined by schema

What actually happened

Error:

RubyLLM::BadRequestError
This response_format type is unavailable now

Environment

Ruby: v4.0.3
RubyLLM: v1.15.0
Provider: Deepseek
Rails: v8.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions