PromptGate 0.5 — changelog
Archived from CHANGELOG.md, which keeps the unreleased changes and the latest release.
0.5.0 - 2026-10-20
Section titled “0.5.0 - 2026-10-20”The AI Gateway release: prompts become named, versioned endpoints. You
own the system prompt, template, model and parameters in YAML; apps send
typed variables to /gw/<name> or call model: "endpoint:<name>" from
any SDK. Endpoints check inputs and answers against JSON Schema, route
by rules, keep conversations in sessions, cache answers, and can be
tested with evals before a change ships — all through the same pipeline
as every other request, so guardrails, limits, budgets, end users and
the request log apply unchanged.
- AI Gateway endpoints — named prompts under
endpoints:or as oneendpoints/<name>.yamleach: model, parameters, system prompt and a{{ variable }}template, compiled at load (unknown placeholders and unused variables are errors). Typed variables (string,text,int,float,bool,date,enum) with defaults, length, range and pattern checks; every problem of a request is reported at once. Each endpoint has a version derived from its definition.promptgate endpoints list|show, keys restricted withkeys create --endpoint. Seedocs/endpoints.md. - Calling endpoints — endpoints answer on
/gw/<name>({"variables": …}or{"messages": …}, OpenAI Chat Completions response, streaming) and asmodel: "endpoint:<name>"on the agent proxy’s chat routes, in OpenAI and Anthropic format. The endpoint’s model, params and prompts replace the client’s (client_paramslets clients override chosen params); without variables,{{ input }}wraps each user message and the endpoint’s system prompt goes before the client’s. Requests run through the same pipeline as all others. The response headerX-PromptGate-Endpoint-Versionnames the version that answered;surfaces.ai_gateway.mountmoves/gw. - Per-endpoint controls —
limits.endpoints,budgets.endpoints(restored after restarts) andguardrails.endpoints(between alias and key in the cascade); a key’sendpoints:list allows only those endpoints (403 otherwise). - Schemas for endpoints —
output_schemachecks every answer before the client sees it (OpenAI-format requests also ask for it withresponse_format), withoutput_retriesand a 502 listing every problem otherwise; each attempt is logged.input_schemachecks nested variables instead ofvariables. Schemas inline or as files. PromptGate’s own JSON Schema validator (draft 2020-12 keywords for structured output, unsupported keywords rejected at load), checked against the official test suite in CI — no new dependency. - Routes for endpoints —
routes:send an endpoint’s request to another model, or with other params, by prompt size, message count, the endpoint’s monthly spend, streaming, time of day and weekday (inbudgets.timezone), key, end user and variable values; first match wins, compiled at load. Limits, budgets and fallbacks follow the model the route picked; the route is logged (schema v6) and shown asroute=in logs and the console. - Sessions for endpoints —
sessions:keeps the conversation: the response’sX-PromptGate-Sessionid, sent back as header orsession_id, puts the history before the new message; streamed answers join too. Scoped to endpoint, key, end user and format (404 otherwise); the history holds the guarded text;max_messages,max_tokensandttlare checked before the provider is called, withoverflow: trimorreject(409). In memory, bounded bysessions.max.promptgate logs --session(schema v7). - Answer cache for endpoints —
cache: { ttl, scope }answers identical requests from memory (key, user or endpoint scope; never across provider credentials): no provider call, no cost, not charged to budgets. Answers are kept as the provider sent them, so redacted values are restored per request. Streams are replayed; errors and schema failures aren’t cached.X-PromptGate-Cache: hit|miss,cache=hitin logs (schema v8); bounded bycache.max_bytes. - Versions, evals and replay — the gateway records every endpoint
version it loads;
promptgate endpoints historyanddiffshow what changed.promptgate eval <endpoint>runsevals/<endpoint>.yaml(contains, not_contains, matches, status, latency and token bounds) through the current config without a running gateway and exits 1 below--min-pass, for CI.promptgate replay <id>sends a logged request again, optionally to another model. - Anomaly alerts — every five minutes the gateway compares each
endpoint’s error rate, p95 latency and spend with its past week
(median + MAD, with floors) and reports rises in its log, as
promptgate_anomaly{endpoint,signal}and inpromptgate anomalies(schema v10).anomalies.sensitivity,min_requests,enabled. - pgfuzz gate for endpoints — four new stages run against every build: endpoint variables (invalid ones refused, valid boundaries pass), output schemas (a wrong answer never passes), session isolation (other users, keys, forged ids) and cache isolation between keys — all at 100 %.
- Endpoints in logs and stats — the request log stores endpoint and
version (schema v5; per-minute stats gain the endpoint),
promptgate logs --endpoint,stats --by endpoint, endpoint budgets inpromptgate budgets,endpoint=in the console,scope="endpoint"spend gauges.
Changed
Section titled “Changed”-
promptgate logsshows each request’s id (first column,idin JSON). -
promptgate validatenow also builds aliases, guardrails and endpoint templates, so it catches everythingstartwould reject. -
The endpoints directory is watched and reloaded like the config.
-
The config
promptgate setupwrites has a commented endpoint example.
logging.bodies: truehad no effect. It now keeps each request as the provider got it (after guardrails) and its answer, up to 1 MB each.
Performance
Section titled “Performance”Measured against v0.4.0 under the same load (bench/results/2026-10-20-go-v0.5.0-release.md):
- The proxy path is as fast as in v0.4.0; requests that don’t use an endpoint pay nothing for the new stages.
- An endpoint request costs ≈ 0.02 ms more than a plain proxy request (variables checked in ≈ 0.6 µs, prompt rendered in ≈ 1 µs); a cache hit answers in 0.13 ms (61,000 requests/s at 16 clients).
- 16.9 MB binary (6.8 MB gzip), ready in ≈ 0.1 s, ≈ 53 MB RAM at idle — the same as v0.4.0.