Schema & tool-call enforcement at sampling time

Your 7B model, speaking perfect JSON.

KineticLLama is a drop-in, OpenAI-compatible proxy that guarantees deterministic structured output and reliable tool calls from small local models — on Ollama, vLLM and llama.cpp. No retries. No meaningful latency.

qwen2.5:3b · same schema with a regex constraint
Without KineticLLama
{
  "items": [{"type": "Keyboard"}],  // wrong shape
  "status": "in_progress",      // not in enum
  "zip_code": "NY-10001"       // fails ^\d{5}$
}
# Ollama native + pattern → HTTP 400
With KineticLLama
{
  "items": ["2x Mechanical Keyboards"],
  "status": "processing",
  "zip_code": "10001"
}
# x-kineticllama-valid: true
6µs
to compile a schema to a grammar
Zero
hallucinated tool names possible
3B–14B
small models, made reliable
Rust
single static binary, edge-ready
The problem

Small models break structured output

Running 3B–14B models locally is cheap and private. But under real schemas, they drift — and prompt-and-pray costs you retries, latency and silent bad data.

Schema drift

Conversational filler and Markdown fences wrap the JSON and break your parser before logic even runs.

Type & constraint confusion

Arrays of strings become arrays of objects, enums invent new values, and regex constraints like ZIP codes are ignored.

Retry inflation

Retrying invalid responses 3–4 times erases the entire cost and latency advantage of running local.

How it works

Two paths to guaranteed output

Point your OpenAI or Ollama client at KineticLLama instead of the backend. It compiles your JSON Schema into a grammar the model must obey — and repairs anything a black-box backend gets wrong.

Path A · Native

Constrain at generation time

Your schema is compiled to a grammar (GBNF) and enforced during sampling. Invalid tokens are masked — the model physically cannot produce malformed structure.

  • Schema, enums, arrays and regex patterns → grammar
  • Zero-overhead enforcement via the backend sampler
  • Handles patterns that crash Ollama's native converter
Path B · Repair

Fix black-box output on the fly

When the backend can't constrain, a deterministic repair engine cleans the stream: strips filler, closes truncated JSON, normalizes quotes — then validates against your schema.

  • Filler / fence stripping, quote & literal normalization
  • Truncation recovery, deterministic every time
  • Schema validation surfaced in response headers
Built for engineers

Everything the primitive doesn't give you

Constrained decoding is commodity. Reliability across a whole agent run is not.

Drop-in proxy

OpenAI-compatible endpoint. Change one base URL — your existing client, LangChain or agent just works.

Schema → grammar compiler

Objects, enums, arrays, $ref, anyOf and regex patterns compile to GBNF — including constructs backends reject outright.

Deterministic repair

The same broken input always yields the same valid output. No LLM in the repair loop, no randomness.

Tool calls that can't hallucinate

Offered tools compile into the grammar, so a model cannot invent a tool that was never offered or send another tool's arguments. Output is normalized to real tool_calls objects.

Tells you what it can't enforce

A grammar cannot express value ranges. Instead of silently dropping minimum or maxLength, we report them per-field and let the validator rule.

Observability built in

Every response reports the path taken, whether it was repaired, and whether it passed your schema — via x-kineticllama-* headers.

Edge-ready

A single static Rust binary with a tiny footprint. Runs alongside your model on a Jetson or gateway without hogging VRAM.

Measured, not claimed

Real run: qwen2.5:3b on an RTX 3050

The "hard" extraction task with an array-of-strings, an enum and a ^\d{5}$ ZIP pattern. Same prompt, same 3B model, five approaches.

ApproachStructure & enumZIP ^\d{5}$Result
Prompt-only (Ollama)validNY-10001invalid, silent
Ollama native, no patternvalidNY-10001invalid, silent
Ollama native, with patternHTTP 400 crash
KineticLLama repair (Path B)validNY-10001flagged invalid
KineticLLama grammar (Path A)valid10001guaranteed valid

// The prompt fed the model "NY-10001". The grammar made any non-5-digit ZIP physically ungeneratable → "10001". Same schema Ollama returns a 400 on.

Scope

What it fixes — and what it can't

Structured output has two failure classes. We are precise about which one we solve, because a confidently-wrong value is worse than a loud failure.

Solved

Format & structure failures

  • Conversational filler, Markdown fences, trailing commas
  • Single quotes, unquoted keys, Python literals
  • Truncated / clipped JSON
  • Wrong types, invented keys, missing required fields
  • Invalid enum values and regex-constrained strings
  • Nested objects, optional properties, array item counts
  • Hallucinated tool names and mismatched tool arguments
Not solved

Semantic correctness

A grammar guarantees the shape of output, never its truth. Constraining a field can push a model to invent a plausible value rather than admit uncertainty.

  • Whether extracted values are actually correct
  • Value ranges (minimum/maxLength) — reported, then validated
  • Hallucinated-but-well-formed content
  • Recursive schemas and multi-branch allOf

// Today: native grammar enforcement on llama.cpp (JSON schemas and tool calling), repair + validation on any OpenAI-compatible backend, non-streaming. Streaming repair and agent state graphs are on the roadmap.

Pricing

Open core. Start free, scale when you ship.

The proxy and JSON enforcement are free forever. Pay for agent-grade constraints, observability and enterprise controls.

Community
$0

MIT/Apache proxy + core engine. For builders and self-hosters.

  • Drop-in OpenAI-compatible proxy
  • Schema → GBNF grammar (Path A)
  • Deterministic JSON repair (Path B)
  • Tool-call enforcement + tool_calls normalization
  • Native grammar on llama.cpp; repair on any OpenAI-compatible backend
  • Community support
Get the binary
Most popular
Developer / Pro
$29 / dev / mo

For teams building local agentic workflows in production.

  • Everything in Community
  • Observability dashboard & metrics
  • Hosted validation API (roadmap)
  • Agent state-graph constraints (roadmap)
  • Framework adapters (roadmap)
  • Priority support
Start 14-day trial
Enterprise
Custom

On-prem, high-availability middleware for regulated teams.

  • Everything in Pro
  • On-prem HA deployment
  • Custom grammar compilers
  • Zero-leakage security audit
  • SLA & dedicated support
Contact sales
FAQ

Questions, answered

How is this different from JSON mode or constrained decoding?

Single-JSON constrained decoding is now commodity — most runtimes ship it. KineticLLama sits above that primitive: it compiles schema constructs backends reject (like regex patterns), repairs black-box output, normalizes tool calls across backends, and gives you observability across a whole agent run.

Does it add latency?

On the native path, no meaningful overhead — grammars are compiled once and cached, and enforcement happens inside the backend's own sampler. Repair runs as a fast streaming pass, still far cheaper than retry loops.

Which backends are supported?

Any OpenAI-compatible backend for repair and validation. Native grammar enforcement works today with llama.cpp's server; Ollama, vLLM and TGI adapters follow the same interface.

Is my data safe?

KineticLLama is on-prem first. Nothing leaves your machine by default, and telemetry — when enabled — is content-free metrics only, never prompts or outputs.

What language is it written in?

Rust. A single static binary with a tiny memory footprint, designed to run alongside a model on edge hardware without competing for VRAM.

Stop prompting and praying.

Guarantee valid structured output from the small models you already run. Free to start, one base URL to change.