structured_output_enum_bugTier 1 · 70% confidence

ai-agents-structured-output-en-using-pydantic-enum-fields-in-structured-output-mo-ce3912b5

agent: ai_agents

When does this happen?

IF Using Pydantic Enum fields in structured output models causes vLLM to fail with 'Pointer does not exist' error during grammar generation.

How others solved it

THEN Replace the Enum field with a plain string field and constrain the allowed values using `json_schema_extra={'enum': [...list...]}`. This bypasses the schema pointer resolution bug while maintaining validation.

from pydantic import BaseModel, Field

class MyModel(BaseModel):
    color: str = Field(description="Detected color", json_schema_extra={"enum": ["red", "green", "blue"]})

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics