Open in the interactive docs · markdown for agents: https://neuraldeep.tech/docs/structured.md

Structured output · JSON / guided grammar

vLLM supports guided JSON, regex, and grammar (llguidance). Via the OpenAI-compatible response_format.

curl https://api.neuraldeep.tech/v1/chat/completions \
  -H "Authorization: Bearer $YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-oss-120b",
    "messages": [{"role":"user","content":"Extract name and age from: John, 30 years old"}],
    "response_format": {"type":"json_object"}
  }'
from pydantic import BaseModel
from openai import OpenAI

class Person(BaseModel):
    name: str
    age: int

client = OpenAI(api_key="$YOUR_KEY", base_url="https://api.neuraldeep.tech/v1")
r = client.chat.completions.create(
    model="gpt-oss-120b",
    messages=[{"role":"user","content":"John, 30 years old"}],
    response_format={"type":"json_schema","json_schema":{
        "name":"Person","schema":Person.model_json_schema(),"strict":True
    }},
)
person = Person.model_validate_json(r.choices[0].message.content)

For strict JSON — strict: true in the schema is required. vLLM guarantees conformance to the grammar.

Reference sections (markdown for agents)