-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Your current environment
vllm == 0.11.0
langchain==1.2.0
langchain-core== 1.2.6
langchain-openai == 1.1.6
🐛 Describe the bug
When using with_structured_output from langchain's ChatOpenAI, the model response does not seem to follow the rules mentioned in description field. Here is an example:
# Define a simple Pydantic schema
class CarDescription(BaseModel):
origin: str = Field(description="Country of origin in Uppercase")
model: str = Field(description="Model of the car in lowercase")
car_type: Literal["Sports", "Luxury", "Economic"] = Field(description="Type of the car")
# Wrap with structured output
structured_llm = llm.with_structured_output(CarDescription)
# Generate Result
result = structured_llm.invoke("Create a car description for VW")
The results looks like this:
origin='Germany' model='Golf GTI' car_type='Sports'
It can be seen that the LLM failed to generate the origin and model in the respective cases as mentioned in their descriptions. I served Qwen3-30B-A3B-Instruct using vllm to get the result.
I tested this with GPT-5-mini and the results were in the correct cases. So I assume vLLM somehow does not read the description of each key but just the name of the key. Can you please fix this issue?
Before submitting a new issue...
- Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working