Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

feat(server): disclose which side served and report routing in /v1/models (#445)

Krisztian Gajdar946b6fb3e8f8
diff --git a/packages/sie_gateway/openapi.json b/packages/sie_gateway/openapi.json
index fd3d1ad5c..1169d8b47 100644
--- a/packages/sie_gateway/openapi.json
+++ b/packages/sie_gateway/openapi.json
@@ -2428,6 +2428,17 @@
"null"
]
},
+ "routing": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/ModelRoutingWire",
+ "description": "How the bare model name is served: the routing policy and the kind of\nupstream a remote profile calls. A single SIE server emits it on every\nentry."
+ }
+ ]
+ },
"state": {
"type": "string"
}
@@ -2470,6 +2481,26 @@
],
"type": "object"
},
+ "ModelRoutingWire": {
+ "description": "Routing summary on a ``GET /v1/models`` entry.",
+ "properties": {
+ "policy": {
+ "description": "``remote_only``, ``fallback`` or ``threshold``. ``null`` means local\ncapacity only.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "upstream_kind": {
+ "description": "``sie`` or ``openai``: the kind of upstream a remote profile calls.\n``null`` without one.",
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "type": "object"
+ },
"ModelsResponse": {
"description": "Response for `GET /v1/models`.\n\nHybrid shape: `object` + `data` is the OpenAI list format (consumed\nby vanilla OpenAI clients and Open WebUI for model discovery);\n`models` is the richer native shape consumed by the SIE Python/TS\nSDKs. Both describe the same set of models.",
"properties": {
diff --git a/packages/sie_gateway/src/openapi.rs b/packages/sie_gateway/src/openapi.rs
index 9156c82bc..eabdf7964 100644
--- a/packages/sie_gateway/src/openapi.rs
+++ b/packages/sie_gateway/src/openapi.rs
@@ -109,6 +109,7 @@ static OPENAPI_JSON: LazyLock<String> = LazyLock::new(|| {
ModelCapabilitiesWire,
ModelConfigStatusResponse,
ModelInfoWire,
+ ModelRoutingWire,
ModelsResponse,
OpenAiModelObject,
ModelNotFoundDetail,
@@ -2647,6 +2648,15 @@ pub struct ModelInfoWire {
pub capabilities: Option<ModelCapabilitiesWire>,
#[serde(default)]
pub pending_generation: crate::queue::publisher::PendingGenerationSnapshot,
+ /// How the bare model name is served: the routing policy and the kind of
+ /// upstream a remote profile calls. A single SIE server emits it on every
+ /// entry.
+ //
+ // Maintainer note: the gateway does not emit it yet. It is declared here,
+ // the schema of record, so the SDKs can type it; emission arrives with
+ // cluster remote worker pools.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub routing: Option<ModelRoutingWire>,
/// Short task-tier names that resolve to this model, for example
/// ``["rerank-fast"]``. Send one anywhere a model id is accepted and it
/// resolves to this entry, billed at this model's rate.
@@ -2668,6 +2678,17 @@ pub struct ModelInfoWire {
pub aliases: Vec<String>,
}
+/// Routing summary on a ``GET /v1/models`` entry.
+#[derive(Debug, Serialize, Deserialize, ToSchema)]
+pub struct ModelRoutingWire {
+ /// ``remote_only``, ``fallback`` or ``threshold``. ``null`` means local
+ /// capacity only.
+ pub policy: Option<String>,
+ /// ``sie`` or ``openai``: the kind of upstream a remote profile calls.
+ /// ``null`` without one.
+ pub upstream_kind: Option<String>,
+}
+
/// Capability summary surfaced on each entry of ``GET /v1/models``.
///
/// Mirrors the JSON shape constructed in
diff --git a/packages/sie_sdk/src/sie_sdk/types.py b/packages/sie_sdk/src/sie_sdk/types.py
index 8d65a29bb..b4c38c72e 100644
--- a/packages/sie_sdk/src/sie_sdk/types.py
+++ b/packages/sie_sdk/src/sie_sdk/types.py
@@ -346,6 +346,16 @@ class PendingGeneration(TypedDict, total=False):
groups: list[PendingGenerationGroup]
+class ModelRouting(TypedDict):
+ """How the bare model name is served. Part of every ``/v1/models`` entry."""
+
+ policy: Literal["remote_only", "fallback", "threshold"] | None
+ """``None`` means local capacity only."""
+
+ upstream_kind: Literal["sie", "openai"] | None
+ """Kind of the upstream a remote profile calls, ``None`` without one."""
+
+
class ModelInfo(TypedDict, total=False):
"""Information about a model returned by list_models().
@@ -385,6 +395,9 @@ class ModelInfo(TypedDict, total=False):
pending_generation: PendingGeneration
"""Gateway-only queue snapshot; absent when talking to a single server."""
+ routing: ModelRouting
+ """Routing policy and upstream kind, e.g. ``policy="remote_only"`` for a model served by an upstream."""
+
aliases: list[str]
"""Short task-tier names resolving to this model, e.g. ``["rerank-fast"]``.
diff --git a/packages/sie_server/openapi.json b/packages/sie_server/openapi.json
index 10fb0e831..7ac7c29a3 100644
--- a/packages/sie_server/openapi.json
+++ b/packages/sie_server/openapi.json
@@ -1601,6 +1601,9 @@
"type": "null"
}
]
+ },
+ "routing": {
+ "$ref": "#/components/schemas/ModelRouting"
}
},
"type": "object",
@@ -1643,6 +1646,44 @@
"title": "ModelLoadError",
"description": "Diagnostic detail for a recorded load failure.\n\nSurfaced in :class:`ModelInfo` when the registry has a sticky\nfailure for the model. Attributes mirror the server-side\n:class:`sie_server.core.load_errors.LoadFailure`."
},
+ "ModelRouting": {
+ "properties": {
+ "policy": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "remote_only",
+ "fallback",
+ "threshold"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Policy"
+ },
+ "upstream_kind": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "sie",
+ "openai"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Upstream Kind"
+ }
+ },
+ "type": "object",
+ "title": "ModelRouting",
+ "description": "How the bare model name is served."
+ },
"ModelsListResponse": {
"properties": {
"models": {
diff --git a/packages/sie_server/src/sie_server/api/encode.py b/packages/sie_server/src/sie_server/api/encode.py
index 5a1a5597f..324e16fa0 100644
--- a/packages/sie_server/src/sie_server/api/encode.py
+++ b/packages/sie_server/src/sie_server/api/encode.py
@@ -13,6 +13,7 @@ from sie_server.api.helpers import (
RequestParser,
ResponseBuilder,
oom_retry_after_from_registry,
+ serving_disclosure_headers,
validated_total,
)
from sie_server.api.options import resolve_runtime_options_with_profile
@@ -432,4 +433,5 @@ async def encode(
# Build response headers and return
headers = ResponseBuilder.build_headers(timing)
+ headers.update(serving_disclosure_headers(registry, model))
return ResponseBuilder.build_response(response, accept, headers, convert_for_json=True)
diff --git a/packages/sie_server/src/sie_server/api/helpers.py b/packages/sie_server/src/sie_server/api/helpers.py
index 405fb9778..fdd0a3084 100644
--- a/packages/sie_server/src/sie_server/api/helpers.py
+++ b/packages/sie_server/src/sie_server/api/helpers.py
@@ -12,6 +12,7 @@ from fastapi.responses import JSONResponse
from sie_server.adapters.errors import InputTooLongError
from sie_server.api.serialization import MsgPackResponse, _convert_for_json
+from sie_server.config.model import is_remote_adapter_path
from sie_server.core.model_suggestions import suggestion_suffix
from sie_server.core.oom import is_oom_error
from sie_server.core.timing import RequestTiming
@@ -105,6 +106,22 @@ JSON_CONTENT_TYPE = "application/json"
SERVER_VERSION_HEADER = "X-SIE-Server-Version"
SDK_VERSION_HEADER = "X-SIE-SDK-Version"
+# Remote-serving disclosure
+SERVED_BY_HEADER = "X-SIE-Served-By"
+UPSTREAM_HEADER = "X-SIE-Upstream"
+
+
+def serving_disclosure_headers(registry: "ModelRegistry", model: str) -> dict[str, str]:
+ """Which side serves ``model``: ``local``, or ``remote`` with the upstream's name.
+
+ Read from the model's config rather than the loaded adapter, so a concurrent
+ unload cannot change the answer after the request was served.
+ """
+ profile = registry.get_config(model).resolve_profile("default")
+ if is_remote_adapter_path(profile.adapter_path):
+ return {SERVED_BY_HEADER: "remote", UPSTREAM_HEADER: str(profile.loadtime["upstream"])}
+ return {SERVED_BY_HEADER: "local"}
+
def _get_server_version() -> str:
try:
diff --git a/packages/sie_server/src/sie_server/api/models.py b/packages/sie_server/src/sie_server/api/models.py
index 2b3998910..d96557f1f 100644
--- a/packages/sie_server/src/sie_server/api/models.py
+++ b/packages/sie_server/src/sie_server/api/models.py
@@ -1,8 +1,10 @@
from typing import TYPE_CHECKING, Any, Literal
from fastapi import APIRouter, HTTPException, Request, status
-from pydantic import BaseModel
+from pydantic import BaseModel, Field
+from sie_server.config.model import ModelConfig, is_remote_adapter_path
+from sie_server.config.upstreams import installed_upstreams
from sie_server.core.model_suggestions import suggestion_suffix
from sie_server.types.responses import ErrorCode
@@ -70,6 +72,16 @@ class ModelCapabilities(BaseModel):
guard: bool = False
+class ModelRouting(BaseModel):
+ """How the bare model name is served."""
+
+ policy: Literal["remote_only", "fallback", "threshold"] | None = None
+ """``None`` means local capacity only."""
+
+ upstream_kind: Literal["sie", "openai"] | None = None
+ """Kind of the upstream a remote profile calls, ``None`` without one."""
+
+
class ModelInfo(BaseModel):
"""Information about a model."""
@@ -101,6 +113,17 @@ class ModelInfo(BaseModel):
capabilities: ModelCapabilities | None = None
"""Advertised generation capabilities, ``None`` for non-generate models."""
+ routing: ModelRouting = Field(default_factory=ModelRouting)
+ """Routing policy and upstream kind. Always present."""
+
+
+def _resolve_routing(config: ModelConfig) -> ModelRouting:
+ default = config.resolve_profile("default")
+ if not is_remote_adapter_path(default.adapter_path):
+ return ModelRouting()
+ upstream = installed_upstreams().get(default.loadtime.get("upstream", ""))
+ return ModelRouting(policy="remote_only", upstream_kind=upstream.kind.value if upstream is not None else None)
+
def _resolve_state_and_error(
registry: "ModelRegistry | Any",
@@ -207,6 +230,7 @@ async def list_models(http_request: Request) -> ModelsListResponse:
profiles=profiles,
revision=getattr(config, "hf_revision", None),
capabilities=_resolve_capabilities(config),
+ routing=_resolve_routing(config),
)
)
@@ -261,4 +285,5 @@ async def get_model(model: str, http_request: Request) -> ModelInfo:
profiles=profiles,
revision=getattr(config, "hf_revision", None),
capabilities=_resolve_capabilities(config),
+ routing=_resolve_routing(config),
)
diff --git a/packages/sie_server/src/sie_server/api/openai_compat.py b/packages/sie_server/src/sie_server/api/openai_compat.py
index dbbbef28b..7ca3eca35 100644
--- a/packages/sie_server/src/sie_server/api/openai_compat.py
+++ b/packages/sie_server/src/sie_server/api/openai_compat.py
@@ -23,7 +23,7 @@ import time
from typing import TYPE_CHECKING, Annotated, Literal
import numpy as np
-from fastapi import APIRouter, Header, HTTPException, Request, status
+from fastapi import APIRouter, Header, HTTPException, Request, Response, status
from fastapi.responses import JSONResponse
from pydantic import BaseModel, ConfigDict, Field
from pydantic.json_schema import SkipJsonSchema
@@ -34,6 +34,7 @@ from sie_server.api.helpers import (
check_sdk_version,
oom_retry_after_from_registry,
openai_error_response,
+ serving_disclosure_headers,
)
from sie_server.api.options import resolve_runtime_options_with_profile
from sie_server.api.validation import validate_machine_profile_header
@@ -348,6 +349,7 @@ def _build_embeddings_response(
async def create_embeddings(
request: OpenAIEmbeddingRequest,
http_request: Request,
+ response: Response,
x_machine_profile: Annotated[str | None, Header(alias="X-SIE-MACHINE-PROFILE")] = None,
) -> OpenAIEmbeddingResponse | JSONResponse:
"""Create embeddings using OpenAI-compatible API.
@@ -368,7 +370,7 @@ async def create_embeddings(
OpenAI-format embedding response with embeddings and usage info.
"""
try:
- return await _create_embeddings(request, http_request, x_machine_profile)
+ return await _create_embeddings(request, http_request, response, x_machine_profile)
except HTTPException as exc:
return openai_error_response(exc)
@@ -376,6 +378,7 @@ async def create_embeddings(
async def _create_embeddings(
request: OpenAIEmbeddingRequest,
http_request: Request,
+ response: Response,
x_machine_profile: str | None,
) -> OpenAIEmbeddingResponse:
# Validate machine profile header
@@ -633,4 +636,5 @@ async def _create_embeddings(
postprocessing_s=timing.postprocessing_ms / 1000.0,
units=units,
)
+ response.headers.update(serving_disclosure_headers(registry, model))
return _build_embeddings_response(results, texts, model, encoding_format)
diff --git a/packages/sie_server/tests/adapters/test_remote_sie_adapter.py b/packages/sie_server/tests/adapters/test_remote_sie_adapter.py
index d4b04faa1..db0fb020e 100644
--- a/packages/sie_server/tests/adapters/test_remote_sie_adapter.py
+++ b/packages/sie_server/tests/adapters/test_remote_sie_adapter.py
@@ -52,6 +52,33 @@ profiles:
"""
+MIXED_MODEL = """\
+sie_id: acme/mixed
+package_backed: true
+inputs:
+ text: true
+tasks:
+ encode:
+ dense:
+ dim: 384
+profiles:
+ default:
+ adapter_path: sie_server.adapters.fake.adapter:FakeAdapter
+ max_batch_tokens: 8192
+ adapter_options:
+ loadtime:
+ memory_footprint_bytes: 67108864
+ fault_key: acme/mixed
+ remote:
+ adapter_path: sie_server.adapters.remote.sie:SieUpstreamAdapter
+ max_batch_tokens: 8192
+ adapter_options:
+ loadtime:
+ upstream: fake-sie
+ upstream_model: sie-fake
+"""
+
+
@pytest.fixture(autouse=True)
def _reset_upstreams(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
monkeypatch.setenv(KEY_ENV, CANARY)
@@ -87,10 +114,19 @@ def fake_sie_upstream() -> Iterator[tuple[str, list[str | None]]]:
thread.join(timeout=10)
-def local_app(tmp_path: Path, upstream_url: str, *, remote_serving: bool = True, upstream: str = "fake-sie") -> FastAPI:
+def local_app(
+ tmp_path: Path,
+ upstream_url: str,
+ *,
+ remote_serving: bool = True,
+ upstream: str = "fake-sie",
+ extra_models: dict[str, str] | None = None,
+) -> FastAPI:
models = tmp_path / "models"
models.mkdir()
(models / "remote-fake.yaml").write_text(REMOTE_MODEL.format(upstream=upstream), encoding="utf-8")
+ for file_name, text in (extra_models or {}).items():
+ (models / file_name).write_text(text, encoding="utf-8")
upstreams = tmp_path / "upstreams.yaml"
upstreams.write_text(
"upstreams:\n"
@@ -111,12 +147,15 @@ def local_app(tmp_path: Path, upstream_url: str, *, remote_serving: bool = True,
)
-def encode_when_loaded(client: TestClient, model: str, text: str) -> httpx.Response:
+def encode_when_loaded(
+ client: TestClient, model: str, text: str, *, params: dict[str, Any] | None = None
+) -> httpx.Response:
+ body: dict[str, Any] = {"items": [{"text": text}]}
+ if params is not None:
+ body["params"] = params
deadline = time.monotonic() + 30
while True:
- response = client.post(
- f"/v1/encode/{model}", json={"items": [{"text": text}]}, headers={"Accept": "application/json"}
- )
+ response = client.post(f"/v1/encode/{model}", json=body, headers={"Accept": "application/json"})
if response.status_code != 503 or time.monotonic() > deadline:
return response
time.sleep(0.1)
@@ -131,16 +170,54 @@ def test_a_remote_backed_model_returns_the_upstreams_vectors(tmp_path: Path, cap
with TestClient(local_app(tmp_path, upstream_url)) as client:
response = encode_when_loaded(client, "acme/remote-fake", "remote backends")
+ embeddings = client.post("/v1/embeddings", json={"model": "acme/remote-fake", "input": "remote backends"})
+ listed = client.get("/v1/models/acme/remote-fake")
assert response.status_code == 200, response.text
served = np.asarray(response.json()["items"][0]["dense"]["values"], dtype=np.float32)
np.testing.assert_allclose(served, expected, rtol=1e-6)
- assert seen_authorization == [f"Bearer {CANARY}"]
+ assert response.headers["x-sie-served-by"] == "remote"
+ assert response.headers["x-sie-upstream"] == "fake-sie"
+ assert embeddings.status_code == 200, embeddings.text
+ assert embeddings.headers["x-sie-served-by"] == "remote"
+ assert embeddings.headers["x-sie-upstream"] == "fake-sie"
+ assert listed.json()["routing"] == {"policy": "remote_only", "upstream_kind": "sie"}
+ assert seen_authorization == [f"Bearer {CANARY}", f"Bearer {CANARY}"]
assert CANARY not in response.text
assert CANARY not in str(response.headers)
assert CANARY not in caplog.text
+def test_a_local_model_discloses_local_serving() -> None:
+ app = AppFactory.create_app(AppStateConfig(models_dir=str(MODELS_DIR), model_filter=["sie-fake"], device="cpu"))
+
+ with TestClient(app) as client:
+ response = encode_when_loaded(client, "sie-fake", "local")
+ listed = client.get("/v1/models/sie-fake")
+
+ assert response.status_code == 200, response.text
+ assert response.headers["x-sie-served-by"] == "local"
+ assert "x-sie-upstream" not in response.headers
+ assert listed.json()["routing"] == {"policy": None, "upstream_kind": None}
+
+
+def test_the_served_side_follows_the_model_id_not_a_request_option(tmp_path: Path) -> None:
+ with fake_sie_upstream() as (upstream_url, _):
+ with SIEClient(upstream_url) as upstream:
+ upstream.encode("sie-fake", {"text": "warm"})
+ app = local_app(tmp_path, upstream_url, extra_models={"mixed.yaml": MIXED_MODEL})
+ with TestClient(app) as client:
+ selected = encode_when_loaded(client, "acme/mixed", "mixed", params={"options": {"profile": "remote"}})
+ variant = encode_when_loaded(client, "acme/mixed:remote", "mixed")
+
+ assert selected.status_code == 200, selected.text
+ assert selected.headers["x-sie-served-by"] == "local"
+ assert "x-sie-upstream" not in selected.headers
+ assert variant.status_code == 200, variant.text
+ assert variant.headers["x-sie-served-by"] == "remote"
+ assert variant.headers["x-sie-upstream"] == "fake-sie"
+
+
def test_the_global_switch_refuses_remote_profiles_and_sends_nothing(tmp_path: Path) -> None:
with fake_sie_upstream() as (upstream_url, seen_authorization):
with TestClient(local_app(tmp_path, upstream_url, remote_serving=False)) as client:
diff --git a/packages/sie_ts_sdk/src/index.ts b/packages/sie_ts_sdk/src/index.ts
index 26bf66454..0f9e67c96 100644
--- a/packages/sie_ts_sdk/src/index.ts
+++ b/packages/sie_ts_sdk/src/index.ts
@@ -82,6 +82,7 @@ export type {
ModelDims,
ModelInfo,
ModelLoadError,
+ ModelRouting,
ModelState,
PendingGeneration,
PendingGenerationGroup,
diff --git a/packages/sie_ts_sdk/src/types.ts b/packages/sie_ts_sdk/src/types.ts
index dff2e304b..22e2da8b7 100644
--- a/packages/sie_ts_sdk/src/types.ts
+++ b/packages/sie_ts_sdk/src/types.ts
@@ -281,6 +281,17 @@ export interface PendingGeneration {
groups: PendingGenerationGroup[];
}
+/**
+ * How the bare model name is served. Part of every `/v1/models` entry a
+ * server that supports remote backends emits.
+ */
+export interface ModelRouting {
+ /** `null` means local capacity only */
+ policy: "remote_only" | "fallback" | "threshold" | null;
+ /** Kind of the upstream a remote profile calls, `null` without one */
+ upstream_kind: "sie" | "openai" | null;
+}
+
/**
* Information about a model returned by listModels().
*
@@ -321,6 +332,8 @@ export interface ModelInfo {
capabilities?: ModelCapabilities | null;
/** Gateway-only queue snapshot; absent when talking to a single server */
pendingGeneration?: PendingGeneration;
+ /** Routing policy and upstream kind; absent from servers that predate remote backends */
+ routing?: ModelRouting;
/**
* Short task-tier names that resolve to this model, e.g. ["rerank-fast"].
* Send one anywhere a model id is accepted. The gateway's internal routing
@@ -355,6 +368,7 @@ export interface WireModelInfo {
profiles?: Record<string, ProfileInfo>;
capabilities?: ModelCapabilities | null;
pending_generation?: PendingGeneration;
+ routing?: ModelRouting;
aliases?: string[];
}
@@ -378,6 +392,7 @@ const MODEL_INFO_WIRE_FIELD_SET: Record<keyof WireModelInfo, true> = {
pending_generation: true,
profiles: true,
revision: true,
+ routing: true,
state: true,
};
diff --git a/packages/sie_ts_sdk/tests/wireContract.test.ts b/packages/sie_ts_sdk/tests/wireContract.test.ts
index 0a85f916a..44d4b4865 100644
--- a/packages/sie_ts_sdk/tests/wireContract.test.ts
+++ b/packages/sie_ts_sdk/tests/wireContract.test.ts
@@ -74,6 +74,7 @@ const FULL_WIRE_ENTRY = {
profiles: { default: { is_default: true }, fp8: { is_default: false } },
capabilities: { grammar: ["json_schema"], tools: true, code: false, sql: false, guard: false },
pending_generation: { total: 0, groups: [] },
+ routing: { policy: "remote_only", upstream_kind: "sie" },
aliases: ["sparse-embeddings-best"],
// OpenAI retrieve-model compat keys, merged in by the detail endpoint.
id: "BAAI/bge-m3",
@@ -133,6 +134,7 @@ describe("getModel wire mapping", () => {
expect(model.loaded).toBe(true);
expect(model.state).toBe("loaded");
expect(model.aliases).toEqual(FULL_WIRE_ENTRY.aliases);
+ expect(model.routing).toEqual(FULL_WIRE_ENTRY.routing);
expect(model.lastError).toBeNull();
expect(model.inputs).toEqual(FULL_WIRE_ENTRY.inputs);
expect(model.outputs).toEqual(FULL_WIRE_ENTRY.outputs);
diff --git a/packages/wire-fixtures/model_info.json b/packages/wire-fixtures/model_info.json
index 3a0e2418b..ccbc50003 100644
--- a/packages/wire-fixtures/model_info.json
+++ b/packages/wire-fixtures/model_info.json
@@ -25,6 +25,7 @@
"pending_generation",
"profiles",
"revision",
+ "routing",
"state"
],
"excluded": {
@@ -37,6 +38,7 @@
"excluded_scope": "The four excluded keys are merged in by GET /v1/models/{model} for vanilla OpenAI 'retrieve model' clients; on GET /v1/models they live in the sibling `data` array instead, never on a `models` entry.",
"optionality": "Python marks every typed key optional (`total=False`). TypeScript requires `name`, `loaded`, `inputs` and `outputs` on both `ModelInfo` and `WireModelInfo`; its remaining keys are optional. `pending_generation` is gateway-only. `last_error`/`max_sequence_length`/`revision`/`capabilities` are the four the emitters can send as an explicit null, so the SDK types admit null on each. The fixture pins which keys are declarable, not which are always present.",
"ts_renames": "The TS SDK camelCases three top-level keys \u2014 max_sequence_length -> maxSequenceLength, last_error -> lastError, pending_generation -> pendingGeneration \u2014 and leaves nested objects wire-shaped. Its consumer test checks the wire-side names listed here.",
- "aliases": "Short task-tier names resolving to this model. Always emitted, empty when the model has none, so callers can distinguish 'no aliases' from an older gateway. Only catalog- or operator-declared names appear; the gateway's compiled-in routing defaults are not public API and are never listed."
+ "aliases": "Short task-tier names resolving to this model. Always emitted, empty when the model has none, so callers can distinguish 'no aliases' from an older gateway. Only catalog- or operator-declared names appear; the gateway's compiled-in routing defaults are not public API and are never listed.",
+ "routing": "How the bare model name is served: `policy` (`remote_only`, `fallback`, `threshold`, or null for local only) and `upstream_kind` (`sie`, `openai`, or null). The single server emits it on every entry. The gateway declares it and will emit it once cluster remote worker pools exist."
}
}