1use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum VlmError {
7 #[error("no such captioner: {name}")]
8 NoSuchCaptioner { name: String },
9
10 #[error(
11 "local (mistralrs) captioning has been removed; configure a cloud captioner \
12 (kind = \"cloud\") instead — for local inference, point provider = \"openai_compat\" \
13 + base_url at an OpenAI-compatible server such as ollama or LM Studio"
14 )]
15 LocalFeatureNotCompiled,
16
17 #[error("no captioners configured for image captioning")]
18 NoCaptionersConfigured,
19
20 #[error("captioner {name} unavailable: {reason}")]
21 Unavailable { name: String, reason: String },
22
23 #[error("captioner {name} rate limited")]
24 RateLimited { name: String },
25
26 #[error("captioner {name} auth failed")]
27 AuthFailed { name: String },
28
29 #[error("captioner {name} model error: {reason}")]
30 ModelError { name: String, reason: String },
31
32 #[error(
33 "captioner {name}: model file {file} has been modified (expected {expected}, got {actual})"
34 )]
35 ModelIntegrityFailure {
36 name: String,
37 file: String,
38 expected: String,
39 actual: String,
40 },
41
42 #[error("captioner semaphore closed")]
43 SemaphoreClosed,
44
45 #[error("storage error: {0}")]
46 Storage(#[from] crate::storage::StorageError),
47}