pub enum ModelRuntimeError {
ModelNotFound(String),
ModelLoading,
AdmissionTimeout(String),
SpawnFailed(String),
HealthCheckFailed(String),
ModelFileNotFound(String),
PinnedModelMismatch {
expected: String,
requested: String,
},
Internal(String),
}Expand description
Errors that can occur during model runtime operations.
Variants§
ModelNotFound(String)
The requested model was not found in the catalog.
ModelLoading
A model is currently loading; try again later. Callers should return 503 Service Unavailable.
AdmissionTimeout(String)
Retryable: the request sat in the admission queue past its deadline without ever reaching the front.
Reaching this means the GPU stayed continuously occupied by other models
for longer than a request can reasonably wait — not that a collision was
mishandled. The queue’s own fairness bounds make it rare; when it does
happen the caller gets a 503 with Retry-After and control of its own
backoff.
SpawnFailed(String)
Failed to spawn the model server process.
HealthCheckFailed(String)
The model server failed its health check.
ModelFileNotFound(String)
The model file was not found on disk.
PinnedModelMismatch
A model other than the pinned one was requested.
Only reachable in pinned mode (gglib serve <model>), which exists to
give single-model clients — VS Code Copilot’s BYOK endpoint, for one —
an endpoint that never switches models underneath them. Swapping to the
requested model would defeat that guarantee, so the request is refused
rather than served.
Fields
Internal(String)
Internal error during runtime operations.
Implementations§
Source§impl ModelRuntimeError
impl ModelRuntimeError
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true if this error indicates a temporary condition where retrying may succeed.
Sourcepub const fn suggested_status_code(&self) -> u16
pub const fn suggested_status_code(&self) -> u16
Returns a suggested HTTP status code for this error.
Trait Implementations§
Source§impl Clone for ModelRuntimeError
impl Clone for ModelRuntimeError
Source§fn clone(&self) -> ModelRuntimeError
fn clone(&self) -> ModelRuntimeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelRuntimeError
impl Debug for ModelRuntimeError
Source§impl Display for ModelRuntimeError
impl Display for ModelRuntimeError
Source§impl Error for ModelRuntimeError
impl Error for ModelRuntimeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()