DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to get structured JSON output from a self-hosted model with vLLM

Constrain model replies to a schema so downstream code can parse them reliably.

Who it is forA data or backend engineer whose pipeline needs machine-readable fields from an LLM, not free text.

The problemFree-form model replies break parsers, so each extraction job needs fragile post-processing.

The outcomeModel responses that follow a requested structure, ready for direct parsing.

What you need first

  • Python with uv or pip installed
  • A supported NVIDIA, AMD or Intel GPU, or an x86, ARM or PowerPC CPU
  • A Hugging Face model you are allowed to download and use

Steps

  1. Install vLLM with uv pip install vllm.
  2. Start a served model with vllm serve <model-id>, as described in the Quickstart. (inferred, check the README)
  3. Enable structured output using the xgrammar or guidance backend as described in the official documentation. (inferred, check the README)
  4. Send a request that includes your JSON schema and a sample input.
  5. Parse the reply with a JSON parser and check that every required field is present.

Prompt for your agent

Using the vllm-project/vllm repo, set up a served model <model-id> with structured output enabled. Send the sample input <sample-text> with a JSON schema and return the parsed object. Verify that the output parses as JSON and contains every required field.

Caveat. The README names xgrammar and guidance but does not show how to enable them, so the exact option must come from the official docs.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for vllm-project/vllm and "Get structured JSON output from a self-hosted model"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer