Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
feat(gateway): bridge a lane its transport reports cold (#592)
Krisztian Gajdarb5d6253e7fa2
diff --git a/packages/sie_gateway/docs/architecture-guide.md b/packages/sie_gateway/docs/architecture-guide.mdindex 777ea621f..1e374ea5b 100644--- a/packages/sie_gateway/docs/architecture-guide.md+++ b/packages/sie_gateway/docs/architecture-guide.md@@ -1044,3 +1044,23 @@ model, so a caller who can see the remote profile can name it.- **Without a policy.** The gateway's own checks decide.- **Governed generation.** A policy that governs generation routes keepsgeneration local, because a governed route has no remote route.++### Lanes a transport reports cold++A dispatch transport that manages its own capacity can keep worker rows for a+lane with no ready capacity. `WorkDispatcher::lane_provisioning` reports such a+lane. It is `false` by default and is a non-publishing hint.++- **When the gateway reads it.** After the route resolves and before any+ dispatch.+- **The bridge.** When the hint is `true` and a `provisioning` bridge is+ admitted:+ 1. The gateway wakes the lane through `publish_model_load` with the lane's+ pool target, recording pending demand as for any cold lane.+ 2. It waits up to 2 s for the transport to accept the wake.+ 3. It makes the single remote attempt with `fallback_reason: provisioning`.+ - A wake that is not accepted leaves the caller with the local+ `503 PROVISIONING`.+- **No bridge.** A request that is not bridged dispatches as before.+- **A remote attempt refused as `PROVISIONING`** received no answer. It+ restores the local refusal with `X-SIE-Fallback-Error: QUEUE_FULL`.diff --git a/packages/sie_gateway/src/handlers/proxy.rs b/packages/sie_gateway/src/handlers/proxy.rsindex 21c2b423d..ec2d5bef4 100644--- a/packages/sie_gateway/src/handlers/proxy.rs+++ b/packages/sie_gateway/src/handlers/proxy.rs@@ -2391,6 +2391,36 @@ fn generation_bridge_allowed(state: &AppState) -> bool {.is_none()}+/// A transport that manages its own capacity can report a cold lane that the+/// registry still lists.+fn transport_lane_provisioning(+ state: &AppState,+ pool: &str,+ machine_profile: &str,+ bundle: &str,+ model: &str,+) -> bool {+ state.work_publisher.as_ref().is_some_and(|publisher| {+ publisher.lane_provisioning(&LaneKey::new(pool, machine_profile, bundle), model)+ })+}++/// The lane a transport wakes for a `provisioning` bridge. No worker is+/// pinned, because the transport reports that none is ready.+fn lane_wake_target(+ pool: &str,+ machine_profile: &str,+ bundle: &str,+ model: &str,+) -> publisher::PublishTarget {+ publisher::PublishTarget::Pool {+ pool: pool.to_string(),+ machine_profile: machine_profile.to_string(),+ bundle: bundle.to_string(),+ model: model.to_string(),+ }+}+/// Threshold decisions are counted only after caller validation and before/// any local demand or work is published. Caller selectors retain authority.#[allow(clippy::too_many_arguments)]@@ -2740,6 +2770,22 @@ fn native_fallback_plan(})}+/// The bridge a request would take, admitted in full: the deployment's+/// decision and, for a numerical plan, its admission.+#[allow(clippy::too_many_arguments)]+fn native_bridge_plan(+ state: &AppState,+ req: &Request,+ endpoint: &str,+ model: &str,+ parsed: Option<&(Vec<rmpv::Value>, publisher::WorkParams)>,+ body_held: bool,+ trigger: FallbackTrigger,+) -> Option<crate::state::model_registry::RemoteFallbackPlan> {+ native_fallback_plan(state, req, endpoint, model, parsed, body_held, trigger)+ .and_then(|plan| admit_numerical(state, plan, endpoint, parsed, req.extensions()))+}+#[allow(clippy::result_large_err, clippy::too_many_arguments)]fn begin_native_fallback(state: &AppState,@@ -2751,11 +2797,20 @@ fn begin_native_fallback(refusal: Response,trigger: FallbackTrigger,) -> Result<(), Response> {- let Some(plan) = native_fallback_plan(state, req, endpoint, model, parsed, body_held, trigger)- .and_then(|plan| admit_numerical(state, plan, endpoint, parsed, req.extensions()))+ let Some(plan) = native_bridge_plan(state, req, endpoint, model, parsed, body_held, trigger)else {return Err(refusal);};+ begin_planned_native_fallback(req, plan, refusal, trigger);+ Ok(())+}++fn begin_planned_native_fallback(+ req: &mut Request,+ plan: crate::state::model_registry::RemoteFallbackPlan,+ refusal: Response,+ trigger: FallbackTrigger,+) {let attempt = req.extensions().get::<FallbackAttempt>()@@ -2765,7 +2820,6 @@ fn begin_native_fallback("request-owned bridge begins once synchronously");req.extensions_mut().insert(RemoteFallbackOverride(plan));- Ok(())}pub(crate) async fn proxy_request(@@ -3244,6 +3298,59 @@ async fn proxy_request_inner(return resp;}+ let provisioning_bridge = if transport_lane_provisioning(+ &state,+ effective_pool,+ effective_machine_profile,+ &bundle,+ &dispatch_model,+ ) {+ native_bridge_plan(+ &state,+ &req,+ endpoint,+ &model_name,+ prepared_native_parsed.as_ref(),+ body_held,+ FallbackTrigger::Provisioning,+ )+ } else {+ None+ };+ if let Some(plan) = provisioning_bridge {+ let refusal = build_provisioning_response_for_surface(&gpu, &bundle, provisioning_surface);+ let target = lane_wake_target(+ effective_pool,+ effective_machine_profile,+ &bundle,+ &dispatch_model,+ );+ if !warm_local_model(+ &state,+ work_publisher.as_ref(),+ &physical_lane,+ target,+ &engine,+ &bundle_config_hash,+ )+ .await+ {+ return refusal;+ }+ begin_planned_native_fallback(&mut req, plan, refusal, FallbackTrigger::Provisioning);+ if let Some(body) = prepared_native_body {+ *req.body_mut() = Body::from(body);+ }+ return Box::pin(proxy_request_inner(+ state,+ req,+ endpoint,+ provisioning_surface,+ inbound_publish_cx,+ ))+ .await;+ }+if native_fallback_plan(&state,&req,@@ -8512,6 +8619,64 @@ async fn resolve_generation_route(return Err(resp);}+ if transport_lane_provisioning(+ state,+ &effective_pool,+ &effective_machine_profile,+ &bundle,+ dispatch_model,+ ) {+ if let Some(plan) = fallback_plan_for_request(+ state,+ hdr,+ ext,+ customer_model,+ bridge_allowed,+ explicit_bundle_override,+ FallbackTrigger::Provisioning,+ ) {+ let refusal = build_openai_provisioning_response(&gpu, &bundle);+ let target = lane_wake_target(+ &effective_pool,+ &effective_machine_profile,+ &bundle,+ dispatch_model,+ );+ if !warm_local_model(+ state,+ work_publisher_arc.as_ref(),+ &physical_lane,+ target,+ &engine,+ &bundle_config_hash,+ )+ .await+ {+ return Err(refusal);+ }+ let attempt = ext+ .get::<FallbackAttempt>()+ .expect("plan requires a request record");+ assert!(attempt.begin(refusal, FallbackTrigger::Provisioning));+ let mut remote_ext = ext.clone();+ remote_ext.insert(RemoteFallbackOverride(plan.clone()));+ return Box::pin(resolve_generation_route(+ state,+ hdr,+ &plan.bundle,+ customer_model,+ &plan.model,+ request_intent,+ "",+ &remote_ext,+ false,+ token_limit,+ metric_labels_slot,+ ))+ .await;+ }+ }+if fallback_plan_for_request(state,hdr,diff --git a/packages/sie_gateway/src/handlers/serving_disclosure.rs b/packages/sie_gateway/src/handlers/serving_disclosure.rsindex ea7c8b282..73955306c 100644--- a/packages/sie_gateway/src/handlers/serving_disclosure.rs+++ b/packages/sie_gateway/src/handlers/serving_disclosure.rs@@ -143,7 +143,8 @@ const SIE_ERROR_CODES: [&str; 11] = [/// `X-SIE-Fallback-Error` for a failed remote attempt that answered with/// `status` and error `code`, as the single server's `_fallback_error`-/// (`sie_server.api.routing`) derives it.+/// (`sie_server.api.routing`) derives it. A remote route still provisioning+/// gave no answer, which is `QUEUE_FULL`.fn fallback_error(status: StatusCode, code: Option<&str>) -> &'static str {if let Some(code) = code {let upper = code.to_uppercase();@@ -151,7 +152,7 @@ fn fallback_error(status: StatusCode, code: Option<&str>) -> &'static str {return known;}match code {- "server_overloaded" => return "QUEUE_FULL",+ "server_overloaded" | "PROVISIONING" => return "QUEUE_FULL","invalid_request" => return "INVALID_INPUT",_ => {}}@@ -1375,7 +1376,8 @@ mod tests {(503, Some("server_overloaded"), "QUEUE_FULL"),(400, Some("invalid_request"), "INVALID_INPUT"),(503, Some("SERVER_OVERLOADED"), "INFERENCE_ERROR"),- (503, Some("PROVISIONING"), "INFERENCE_ERROR"),+ (503, Some("PROVISIONING"), "QUEUE_FULL"),+ (503, Some("provisioning"), "INFERENCE_ERROR"),(504, Some("GATEWAY_TIMEOUT"), "INFERENCE_ERROR"),(504, Some("first_chunk_timeout"), "INFERENCE_ERROR"),(503, Some("transport_failure"), "INFERENCE_ERROR"),@@ -4085,4 +4087,158 @@ mod tests {)]);}++ /// A gateway whose registry lists a local worker with both hybrid models+ /// loaded, and a verified remote worker, while the transport reports the+ /// local lane cold.+ async fn transport_cold_gateway(policy: Option<Arc<dyn ModelAccessPolicy>>) -> TestGateway {+ let mut gateway = TestGateway::new(&[+ &fallback_config(HYBRID_EXTRACT_MODEL),+ &fallback_config(HYBRID_GENERATE_MODEL),+ ])+ .await;+ if let Some(policy) = policy {+ gateway.install_policy(policy);+ }+ gateway+ .add_verified_worker("local-1", LOCAL_LANE, &["acme/extract", "acme/chat"])+ .await;+ gateway+ .add_verified_worker("remote-1", REMOTE_LANE, &[])+ .await;+ gateway.dispatcher.report_cold_local_lane();+ gateway+ }++ #[tokio::test]+ async fn a_lane_its_transport_reports_cold_is_woken_then_bridged_once() {+ let gateway = transport_cold_gateway(None).await;++ let response = extract(&gateway, extraction_request(false, json!({}))).await;+ assert_eq!(response.status(), StatusCode::OK);+ assert_eq!(response.headers()["x-sie-fallback-reason"], "provisioning");+ let mut expected = vec![+ dispatched("load", LOCAL_LANE, "acme/extract"),+ dispatched("extract", REMOTE_LANE, "acme/extract:remote"),+ ];+ for surface in ["native", "chat", "completions", "responses"] {+ let response = buffered_surface(&gateway, surface, json!({})).await;+ assert_eq!(response.status(), StatusCode::OK, "{surface}");+ assert_eq!(+ response.headers()["x-sie-fallback-reason"],+ "provisioning",+ "{surface}"+ );+ expected.push(dispatched("load", LOCAL_LANE, "acme/chat"));+ expected.push(dispatched("generate", REMOTE_LANE, "acme/chat:remote"));+ }+ assert_eq!(gateway.dispatcher.dispatched(), expected);+ assert!(gateway+ .dispatcher+ .fallback_reasons()+ .iter()+ .all(|reason| *reason == Some(FallbackTrigger::Provisioning)));+ }++ #[tokio::test]+ async fn a_cold_lane_whose_wake_is_not_accepted_keeps_the_local_provisioning_answer() {+ let gateway = transport_cold_gateway(None).await;+ gateway.dispatcher.refuse_model_loads();++ let response = extract(&gateway, extraction_request(false, json!({}))).await;+ assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE);+ assert_eq!(response.headers()["retry-after"], "60");+ assert!(!response.headers().contains_key("x-sie-fallback-reason"));+ let response = buffered_surface(&gateway, "chat", json!({})).await;+ assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE);+ assert!(!response.headers().contains_key("x-sie-fallback-reason"));+ assert_eq!(+ gateway.dispatcher.dispatched(),+ vec![+ dispatched("load", LOCAL_LANE, "acme/extract"),+ dispatched("load", LOCAL_LANE, "acme/chat"),+ ]+ );+ }++ #[tokio::test]+ async fn a_warm_lane_or_a_refusing_policy_keeps_the_request_local() {+ let warm = TestGateway::new(&[&fallback_config(HYBRID_EXTRACT_MODEL)]).await;+ warm.add_verified_worker("local-1", LOCAL_LANE, &["acme/extract"])+ .await;+ warm.add_verified_worker("remote-1", REMOTE_LANE, &[]).await;+ let policy = Arc::new(RoutePolicy::default());+ let refusing = transport_cold_gateway(Some(policy.clone())).await;++ for gateway in [&warm, &refusing] {+ let response = extract(gateway, extraction_request(false, json!({}))).await;+ assert_eq!(response.status(), StatusCode::OK);+ assert!(!response.headers().contains_key("x-sie-fallback-reason"));+ assert_eq!(+ gateway.dispatcher.dispatched(),+ vec![dispatched("extract", LOCAL_LANE, "acme/extract")]+ );+ }+ let asked = policy.asked();+ assert_eq!(+ asked.first(),+ Some(&(+ "acme/extract".to_string(),+ "acme/extract:remote".to_string(),+ RemoteRouteReason::Fallback(FallbackTrigger::Provisioning),+ ))+ );+ assert!(asked+ .iter()+ .all(|(model, remote, _)| model == "acme/extract" && remote == "acme/extract:remote"));+ }++ #[tokio::test]+ async fn a_remote_lane_still_starting_restores_the_local_refusal_as_queue_full() {+ let gateway = transport_cold_gateway(None).await;+ gateway.dispatcher.report_remote_lane_starting();++ let response = extract(&gateway, extraction_request(false, json!({}))).await;+ assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE);+ assert_eq!(response.headers()["retry-after"], "60");+ assert_eq!(response.headers()["x-sie-error-code"], "PROVISIONING");+ assert_eq!(response.headers()["x-sie-fallback-reason"], "provisioning");+ assert_eq!(response.headers()["x-sie-fallback-error"], "QUEUE_FULL");+ assert_eq!(stamped(&response), (Some("local"), None));++ let response = buffered_surface(&gateway, "chat", json!({})).await;+ assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE);+ assert_eq!(response.headers()["x-sie-fallback-reason"], "provisioning");+ assert_eq!(response.headers()["x-sie-fallback-error"], "QUEUE_FULL");+ }++ #[tokio::test]+ async fn a_cold_lane_bridge_that_admission_refuses_dispatches_locally_without_a_wake() {+ let config = format!("{HYBRID_ENCODE_MODEL}{NUMERICAL_FALLBACK}");+ for cold in [true, false] {+ let gateway = TestGateway::new(&[&config]).await;+ gateway+ .add_verified_worker("local-1", LOCAL_LANE, &["acme/hybrid-encode"])+ .await;+ gateway+ .add_verified_worker("remote-1", REMOTE_LANE, &[])+ .await;+ if cold {+ gateway.dispatcher.report_cold_local_lane();+ }++ let response = encode(&gateway, json!({"items": [{"text": "hello"}]})).await;++ assert_eq!(response.status(), StatusCode::OK, "cold={cold}");+ assert!(+ !response.headers().contains_key("x-sie-fallback-reason"),+ "cold={cold}"+ );+ assert_eq!(+ gateway.dispatcher.dispatched(),+ vec![dispatched("encode", LOCAL_LANE, "acme/hybrid-encode")],+ "cold={cold}"+ );+ }+ }}diff --git a/packages/sie_gateway/src/handlers/test_support.rs b/packages/sie_gateway/src/handlers/test_support.rsindex c95ebad3b..2503f0298 100644--- a/packages/sie_gateway/src/handlers/test_support.rs+++ b/packages/sie_gateway/src/handlers/test_support.rs@@ -157,6 +157,8 @@ impl Dispatched {pub(crate) struct RecordingDispatcher {without_execution_authority: AtomicBool,local_backpressure: AtomicBool,+ local_lane_cold: AtomicBool,+ remote_lane_starting: AtomicBool,load_refused: AtomicBool,generate_refused: AtomicBool,work_refused: AtomicBool,@@ -250,6 +252,17 @@ impl RecordingDispatcher {self.local_backpressure.store(true, Ordering::SeqCst);}+ /// Report the local lane as having no ready capacity, as a transport that+ /// manages its own capacity does while the registry still lists workers.+ pub(crate) fn report_cold_local_lane(&self) {+ self.local_lane_cold.store(true, Ordering::SeqCst);+ }++ /// Refuse remote-lane work as a transport does while that lane starts.+ pub(crate) fn report_remote_lane_starting(&self) {+ self.remote_lane_starting.store(true, Ordering::SeqCst);+ }+pub(crate) fn refuse_model_loads(&self) {self.load_refused.store(true, Ordering::SeqCst);}@@ -387,6 +400,11 @@ impl WorkDispatcher for RecordingDispatcher {!self.without_execution_authority.load(Ordering::SeqCst)}+ fn lane_provisioning(&self, lane: &LaneKey, _model: &str) -> bool {+ self.local_lane_cold.load(Ordering::SeqCst)+ && lane == &LaneKey::new(LOCAL_LANE.0, LOCAL_LANE.1, LOCAL_LANE.2)+ }+fn pre_dispatch_backpressure(&self, lane: &LaneKey) -> Result<(), DispatchBackpressure> {if lane.bundle == LOCAL_LANE.2 && self.local_backpressure.load(Ordering::SeqCst) {Err("backpressure: local lane is full".into())@@ -402,7 +420,11 @@ impl WorkDispatcher for RecordingDispatcher {hash: &str,) -> Result<(String, DispatchDurability), DispatchError> {assert!(!hash.is_empty());- assert!(matches!(target, PublishTarget::VerifiedWorker { .. }));+ if self.local_lane_cold.load(Ordering::SeqCst) {+ assert!(matches!(target, PublishTarget::Pool { .. }));+ } else {+ assert!(matches!(target, PublishTarget::VerifiedWorker { .. }));+ }self.record(Dispatched::new("load", &target));if self.load_refused.load(Ordering::SeqCst) {return Err(DispatchError::Other("load was not durably accepted".into()));@@ -442,6 +464,11 @@ impl WorkDispatcher for RecordingDispatcher {if self.work_refused.load(Ordering::SeqCst) {return Err(DispatchError::Other("private upstream failure".into()));}+ if self.remote_lane_starting.load(Ordering::SeqCst) && target.bundle() == REMOTE_LANE.2 {+ return Err(DispatchError::Other(+ "no consumers ready: the lane is starting".into(),+ ));+ }let request_id = "request-1".to_string();let bridged_refusal = *self.bridged_refusal.lock().unwrap();if let Some((code, retry_after_s)) =@@ -520,6 +547,9 @@ impl WorkDispatcher for RecordingDispatcher {if self.generate_refused.load(Ordering::SeqCst) {return Err("private upstream failure".into());}+ if self.remote_lane_starting.load(Ordering::SeqCst) && target.bundle() == REMOTE_LANE.2 {+ return Err("no consumers ready: the lane is starting".into());+ }self.record_authority(&target, params);self.record(Dispatched::new("generate", &target));self.fallback_reasons@@ -575,6 +605,9 @@ impl WorkDispatcher for RecordingDispatcher {if self.generate_refused.load(Ordering::SeqCst) {return Err("private upstream failure".into());}+ if self.remote_lane_starting.load(Ordering::SeqCst) && target.bundle() == REMOTE_LANE.2 {+ return Err("no consumers ready: the lane is starting".into());+ }let error = match self.remote_answer(&target) {RemoteAnswer::Refused(refusal) => Some(refusal_error(refusal)),RemoteAnswer::Withheld => {diff --git a/packages/sie_gateway/src/queue/dispatch.rs b/packages/sie_gateway/src/queue/dispatch.rsindex 9a7c7e40b..87d9e471b 100644--- a/packages/sie_gateway/src/queue/dispatch.rs+++ b/packages/sie_gateway/src/queue/dispatch.rs@@ -188,6 +188,16 @@ pub trait WorkDispatcher: Send + Sync {Ok(())}+ /// Non-publishing capacity hint: `true` when this transport observes that+ /// the lane serving `model` has no capacity ready to accept work, although+ /// the registry may still list workers for it. The gateway reads it only to+ /// decide a `provisioning` bridge before dispatch, then wakes the lane+ /// through [`Self::publish_model_load`] with the lane's pool target. A+ /// transport that reports cold lanes must accept such a pool-target wake.+ fn lane_provisioning(&self, _lane: &LaneKey, _model: &str) -> bool {+ false+ }+/// Request readiness without inference. Only transports whose worker/// settlement supports no-result load items may implement this operation.#[allow(dead_code)] // Called by the subsequent cluster fallback routing delivery.diff --git a/packages/sie_server/REMOTE_BACKENDS.md b/packages/sie_server/REMOTE_BACKENDS.mdindex b5a68fc64..42a91d5bd 100644--- a/packages/sie_server/REMOTE_BACKENDS.md+++ b/packages/sie_server/REMOTE_BACKENDS.md@@ -193,7 +193,9 @@ upstream kind.for example `RESOURCE_EXHAUSTED` from a capped or breaker-open generationupstream, or `QUEUE_FULL` and `MODEL_LOADING` from an encode or extractionupstream that cannot serve now. The OpenAI codes `server_overloaded` and-`invalid_request` become `QUEUE_FULL` and `INVALID_INPUT`. Any other failure is+`invalid_request` become `QUEUE_FULL` and `INVALID_INPUT`. A remote attempt+refused with `PROVISIONING`, because the remote capacity is still starting,+received no answer, so it is `QUEUE_FULL`. Any other failure is`INFERENCE_ERROR` for a server error and `INVALID_INPUT` for a client error.Each upstream has a required rate cap and a circuit breaker. The limits are@@ -601,6 +603,15 @@ model is unloaded receives load-only work, and the gateway waits for brokeracceptance before attempting remote generation. If load acceptance fails, thecaller receives the local loading refusal. A loaded local model serves locally.+A dispatch transport that manages its own capacity can report a lane with no+ready capacity while the registry still lists workers for it. When a+`provisioning` bridge is admitted for such a lane, the gateway asks the+transport to wake the lane with load-only work on the lane's pool, and makes+the single remote attempt only after the transport accepted the wake. A wake+that is not accepted leaves the caller with the local `503 PROVISIONING`. When+the bridge is not admitted, the request takes the ordinary local path and no+wake is sent.+The remote attempt pins a fresh worker with the exact current configurationhash and positive versioned execution capability. It cannot retry on the ordinarypool subject. Its work item names the trigger in `fallback_reason`, so the remotediff --git a/packages/sie_server/src/sie_server/api/routing.py b/packages/sie_server/src/sie_server/api/routing.pyindex 794c8d5ee..b8261fcbf 100644--- a/packages/sie_server/src/sie_server/api/routing.py+++ b/packages/sie_server/src/sie_server/api/routing.py@@ -42,6 +42,8 @@ _OPENAI_ERROR_CODES = {"server_overloaded": ErrorCode.QUEUE_FULL.value,"invalid_request": ErrorCode.INVALID_INPUT.value,}+# A remote route whose capacity is still starting gave no answer.+_UNANSWERED_ERROR_CODES = {"PROVISIONING": ErrorCode.QUEUE_FULL.value}_TRIGGER_BY_REFUSAL: dict[str, FallbackTrigger] = {ErrorCode.MODEL_LOADING.value: "model_loading",ErrorCode.MODEL_NOT_LOADED.value: "model_loading",@@ -96,6 +98,8 @@ def _fallback_error(status_code: int, code: object) -> str:return code.upper()if code in _OPENAI_ERROR_CODES:return _OPENAI_ERROR_CODES[code]+ if code in _UNANSWERED_ERROR_CODES:+ return _UNANSWERED_ERROR_CODES[code]if status_code >= status.HTTP_500_INTERNAL_SERVER_ERROR:return ErrorCode.INFERENCE_ERROR.valuereturn ErrorCode.INVALID_INPUT.valuediff --git a/packages/wire-fixtures/remote_routing.json b/packages/wire-fixtures/remote_routing.jsonindex 6130ce810..790c422d1 100644--- a/packages/wire-fixtures/remote_routing.json+++ b/packages/wire-fixtures/remote_routing.json@@ -60,7 +60,7 @@{"status": 504, "code": "first_chunk_timeout", "fallback_error": "INFERENCE_ERROR"},{"status": 504, "code": "overall_timeout", "fallback_error": "INFERENCE_ERROR"},{"status": 504, "code": "GATEWAY_TIMEOUT", "fallback_error": "INFERENCE_ERROR"},- {"status": 503, "code": "PROVISIONING", "fallback_error": "INFERENCE_ERROR"},+ {"status": 503, "code": "PROVISIONING", "fallback_error": "QUEUE_FULL"},{"status": 503, "code": "transport_failure", "fallback_error": "INFERENCE_ERROR"},{"status": 413, "code": "PAYLOAD_TOO_LARGE", "fallback_error": "INVALID_INPUT"},{"status": 429, "code": "rate_limit_exceeded", "fallback_error": "INVALID_INPUT"},@@ -107,7 +107,7 @@"remote_header": "Each entry lists the X-SIE-Remote field values of one request. Only exactly one 'forbid' is accepted.","forbid": "With X-SIE-Remote: forbid. remote false: served or refused locally, never by an upstream, with no X-SIE-Fallback-* header.","named_profile": "A request that names a profile is served as written: the local profile never goes remote, and the remote profile is served remotely without a fallback reason.",- "fallback_error": "X-SIE-Fallback-Error for a failed remote attempt that answered with status and SIE error code (null: no code). An SIE error code passes through in any letter case, server_overloaded and invalid_request (exactly) become QUEUE_FULL and INVALID_INPUT, and otherwise a status from 500 is INFERENCE_ERROR and a lower one INVALID_INPUT.",+ "fallback_error": "X-SIE-Fallback-Error for a failed remote attempt that answered with status and SIE error code (null: no code). An SIE error code passes through in any letter case, server_overloaded and invalid_request (exactly) become QUEUE_FULL and INVALID_INPUT, PROVISIONING (exactly, a remote route whose capacity is still starting) becomes QUEUE_FULL, and otherwise a status from 500 is INFERENCE_ERROR and a lower one INVALID_INPUT.","restored_refusal": "A failed remote attempt is answered with the local refusal it replaced: the same status, code and Retry-After (null: none), X-SIE-Served-By: local, no X-SIE-Upstream, and X-SIE-Fallback-Reason and X-SIE-Fallback-Error set. unanswered_before_deadline: a gateway deadline passed before the remote attempt answered anything."}}