Open-source inference server and production cluster for all the models your agent needs.
Wire-contract golden fixtures
Language-neutral golden fixtures for the shapes that cross the SIE wire and are
otherwise hand-maintained in several codebases (gateway rs, server py, SDK
py, SDK ts). Each implementation round-trips these fixtures in its own CI so
drift is caught in CI, not production — the parity promise becomes
executable.
Files
model_state.json— the canonicalModelStatevalues (available,loading,loaded,unloading,failed).request_usage.json— how the responseusageblock is partitioned. The gateway is the only writer ofsettled_charge_fields; everything a consumer meters lives interminal_unit_fields. The two sets are disjoint and their union is the WHOLE block, which is what lets a consumer reject an undeclared key — a silently renamed meter — without also rejecting the settled charge that legitimately rides alongside it. See issue #3063 for the failure this exists to prevent.optional_settled_charge_fieldslists the settled fields a settled response may omit;credits_charged_decimalis the charge with up to six decimals as a string such as"0.140000", next to the integercredits_charged.model_info.json— the field set of one/v1/modelsentry, split intotyped(an SDKModelInfoMUST declare it) andexcluded(an SDK MUST NOT declare it, with the reason recorded per key).oss_payload_store.json— the cross-language Alibaba OSS payload contract. The gateway writesprefix/plain_key, the queue retainsplain_key, and the sidecar accepts that key or the exactfull_reference; Python and both Rust binaries load the same fixture to prevent prefix drift.remote_routing.json— remote routing of a model with a local and a remote profile, checked by the single server and the gateway: which abstract local states send a request for the bare model name to the remote profile, whatX-SIE-Remoteaccepts and refuses, how a named profile is served, theX-SIE-Fallback-Erroreach failed attempt's status and error code yields, and the local refusal that answers a failed remote attempt.retry_classification.json— how the SDKs classify a non-2xx response to a buffered call:retryorterminalfor the idempotent operations (encode, score, extract) and for generation, keyed by status, error code, and whether a usableRetry-Afteris present. It also pins how aRetry-Aftervalue is parsed (delay seconds or an HTTP date; a past date means retry now).sdk_requests.json— the HTTP request each SDK sends for the same call to encode, score, extract, generate, the chat route and the Responses route: method, path, the headers that carry meaning, and the decoded body. Each case names one call; each SDK spells that call with its own options and must put the same request on the wire. The file states what counts as the same: paths are compared percent-decoded, anullmember equals an absent one, and a case may list members an SDK is free to send at the server's default.serving_disclosure.json— remote serving: theX-SIE-Remote: forbidrequest header a caller sends to keep a request off remote upstreams, and the response headers that say which side served (X-SIE-Served-By,X-SIE-Upstream,X-SIE-Fallback-Reason,X-SIE-Fallback-Error), each with its allowed values or pattern. An SDK drops a value outside them.upstream_failure_reasons.json— thereasonthat names the class of a remote upstream's failure on a generation error, the fixed message aninference_errorof each class carries in place of the worker's own text, and the terminal error object a worker publishes for one of them.worker_status.json— the worker heartbeat the sidecar publishes onsie.health.<worker_id>: the exactfieldsit sends, theomitted_when_emptyfields it leaves out when empty, and a fully populatedexample. A reader treats a missing field as its default, which is how an older worker's heartbeat withoutunsupported_modelsstays valid.
Why model_info.json has two buckets
A "covered set" alone only catches fields an SDK forgot. It says nothing about
fields an SDK left out on purpose, so the next reader cannot tell an omission
from a decision — which is how state, last_error, profiles and
pending_generation sat undeclared in both SDKs for several releases. Listing
both buckets makes a new wire field fail the tests until someone consciously
puts it in one of them.
Today excluded holds only the OpenAI retrieve-model compat keys
(id/object/created/owned_by) that GET /v1/models/{model} merges in for
vanilla OpenAI clients.
Adding a consumer
Point a test at the JSON and assert the implementation's enum/type matches the fixture set. Current consumers:
- Python SDK —
packages/sie_sdk/tests/test_wire_contract.py(assertstyping.get_args(ModelState)andModelInfo.__annotations__match the fixtures, and thatRequestUsage/TERMINAL_UNIT_FIELDS/SETTLED_CHARGE_FIELDSmatchrequest_usage.json), andpackages/sie_sdk/tests/client/test_retry_classification.py(replays everyretry_classification.jsoncase through both clients against a local HTTP server).test_wire_contract.pyalso asserts the header names, values and patterns ofserving_disclosure.jsonagainst the client constants andRequestMetadata.packages/sie_sdk/tests/client/test_sdk_requests.pyissues everysdk_requests.jsoncase through the sync and the async client against a local HTTP server and compares the request that arrived. - TypeScript SDK —
packages/sie_ts_sdk/tests/sdkRequests.test.ts(issues everysdk_requests.jsoncase through the client with a stubbedfetchand compares the request it sent; a case the SDK has no call for fails),packages/sie_ts_sdk/tests/wireContract.test.ts(asserts the runtimeMODEL_STATESandMODEL_INFO_WIRE_FIELDSarrays — the single sources theModelStatetype andWireModelInfointerface are checked against — match the fixtures), andpackages/sie_ts_sdk/tests/retryClassification.test.ts(replays everyretry_classification.jsoncase through the client with a stubbedfetch), andpackages/sie_ts_sdk/tests/remoteServing.test.ts(checks the runtimeSERVED_BY_VALUES,FALLBACK_REASONSand header patterns againstserving_disclosure.json, then sends and parses the headers through the client). - Gateway —
packages/sie_gateway/src/handlers/serving_disclosure.rs(asserts that theX-SIE-Served-ByandX-SIE-Upstreamnames and the served-by values it emits are the onesserving_disclosure.jsondeclares, and checks every gateway vector ofremote_routing.jsonthrough its handlers and its fallback refusal), andpackages/sie_gateway/src/queue/streaming.rs(the reasons it admits and their messages areupstream_failure_reasons.json, and it reads the reason of its worker terminal error). - Server —
packages/sie_server/tests/adapters/test_remote_fallback.py(each disclosure header the single server sends on a response served locally, remotely or through a bridge, and on the local refusal that answers a failed remote attempt, has a value or patternserving_disclosure.jsondeclares),packages/sie_server/tests/api/test_remote_routing.py(checks every single-server vector ofremote_routing.jsonthrough the routing decision and the refusal that answers a failed remote attempt), andpackages/sie_server/tests/api/test_remote_chat.py(the reasons and messages the server sends areupstream_failure_reasons.json), andpackages/sie_server/tests/processors/test_remote_chat.py(a worker whose upstream answered 402 publishes its worker terminal error). - Worker sidecar —
packages/sie_server_sidecar/src/health_publisher.rs(the published key set equalsfields, minusomitted_when_emptywhen those are empty) and gateway —packages/sie_gateway/src/types/worker.rs(theexampleand an older heartbeat without the omitted fields both parse) loadworker_status.json. - Downstream gateways assert that the members they inject are exactly
settled_charge_fields, so a gateway that starts publishing a third field cannot reach production before every consumer has declared it.
The TS SDK carries extra tests the Python SDK does not need: its client re-maps
the /v1/models response (camelCasing three top-level keys), so a field can be
declared on the type and still never reach a caller. Those tests drive a fully
populated wire entry through getModel/listModels.
Scope
This started as one slice (issue #1637): ModelState only. request_usage.json
(issue #3063) is the second, model_info.json (issue #3126) the third. Extend
the same directory with ModelCapabilities values, error codes, and status
messages as they are pinned. Codegen can come later if fixtures prove
insufficient.