Repository navigation
Closed
Labels
area:architectureArchitecture and code structure changesArchitecture and code structure changesplatform:linuxLinux (CUDA / packaging) specificLinux (CUDA / packaging) specificpriority:mediumMedium priorityMedium prioritystatus:doneCompletedCompletedtype:enhancementNew features, capabilities, or significant additionsNew features, capabilities, or significant additions
Description
Parent
- feat(server): classify and implement optional UI, tools, MCP, and GCP surfaces #1435 (classification sub-issue of the llama-server b10621 epic epic(server): close llama-server b10621 compatibility gaps #1431)
Problem
llama-server b10621 registers Google Cloud Vertex AI custom-container compatibility purely from environment variables (tools/server/server-http.cpp, gcp_params and register_gcp_compat, reference commit c1d0e7a004015f23bc0233470b747b596f29b264). mlxcel-server has none of it, although every route the adapter fans out to already exists in mlxcel. #1435 classified this surface as Supported because it is a pure HTTP adapter over existing handlers and matters for the Linux/CUDA deployment target where Vertex custom containers run.
Upstream semantics to match
- Activation: only when
AIP_MODE=PREDICTION. Otherwise nothing is registered and the variables are ignored. AIP_HTTP_PORT(default8080) overrides--port; upstream logs a warning when the two differ.AIP_HEALTH_ROUTE(default empty, meaning the existing/healthonly): when set, a leading slash is ensured and the value is registered as a GET alias of the health handler.AIP_PREDICT_ROUTE(default/predict): a leading slash is ensured; startup fails if the path collides with an already registered route.- Request: JSON object with an
instancesarray (max 128 entries). Each instance is an object that must carry a string@requestFormat; the field is stripped and the remainder is forwarded as the request body. A client-providedstreamfield is ignored with a warning; streaming responses are rejected because the predict route is non-streaming. - Alias table: every registered route path is converted with
path_to_gcp_format: strip a leading/v1, strip the leading/, stop at the first:path parameter, and convert/,-,_boundaries to camelCase (/v1/chat/completionsbecomeschatCompletions,/v1/embeddingsbecomesembeddings,/v1/messagesbecomesmessages,/tokenizebecomestokenize). First registration wins on collision. - Instances are executed concurrently and results are returned in order as
{"predictions":[...]}; per-instance failures become an error object in that slot rather than failing the whole batch. Malformed envelopes return 400 with the llama-server error envelope.
Scope
- Add an env-gated adapter in the axum app builder that registers the health alias and the predict route and applies the
AIP_HTTP_PORToverride with the same precedence as upstream, on bothmlxcel serveandmlxcel-server. - Build the alias table from mlxcel's actual registered routes rather than a hand-maintained list, so new routes are picked up automatically.
- Dispatch each instance through the existing handlers in-process (for example
tower::ServiceExt::oneshoton the router) so request validation, API-key auth, and rate limits apply unchanged. - Enforce the 128-instance cap, reject streaming, and bound per-instance concurrency so one predict call cannot starve the decode queue.
- Document the variables in
docs/environment-variables.mdand add the surface to the b10621 compatibility manifest from test(server): add a pinned b10621 compatibility manifest and conformance harness #1443.
Acceptance criteria
- With
AIP_MODEunset,/predictis not mounted and theAIP_*variables have no effect. - With
AIP_MODE=PREDICTION,POST /predictacceptschatCompletions,completions,embeddings,rerank,messages, andtokenizeinstances and returns{"predictions":[...]}in request order. - Malformed envelopes (non-object body, missing or non-array
instances, more than 128 instances, instance without string@requestFormat, unknown format, streaming request) return the documented 400 or per-instance error shape matching b10621. -
AIP_HTTP_PORToverrides--port,AIP_HEALTH_ROUTEmounts a public health alias, and a collidingAIP_PREDICT_ROUTEfails startup with a diagnostic. - API-key authentication and request-size limits apply to the predict route exactly as to the aliased routes.
- Integration tests cover the above, and a real-checkpoint smoke test exercises one
chatCompletionsbatch against a dense text model.
References
Metadata
Metadata
Assignees
Labels
area:architectureArchitecture and code structure changesArchitecture and code structure changesplatform:linuxLinux (CUDA / packaging) specificLinux (CUDA / packaging) specificpriority:mediumMedium priorityMedium prioritystatus:doneCompletedCompletedtype:enhancementNew features, capabilities, or significant additionsNew features, capabilities, or significant additions
Activity
test(server): add pinned b10621 compatibility manifest and gates
feat(server): add Vertex AI (GCP) predict route adapter for b10621
feat(server): classify b10621 UI, tools, MCP, CORS-proxy and agent su…
feat(server): add Vertex AI (GCP) predict route adapter for b10621 (l…
test(server): add pinned b10621 compatibility manifest and gates
feat(server): add Vertex AI (GCP) predict route adapter for b10621 (l…
feat(server): classify b10621 UI, tools, MCP, CORS-proxy and agent su…