1use thiserror::Error;
4
5pub type LLMResult<T> = Result<T, LLMError>;
7
8#[derive(Error, Debug)]
10pub enum LLMError {
11 #[error("Invalid configuration: {0}")]
13 InvalidConfig(String),
14
15 #[error("Shape mismatch: expected {expected}, got {actual}")]
17 ShapeMismatch {
18 expected: String,
20 actual: String,
22 },
23
24 #[error("Invalid input: {0}")]
26 InvalidInput(String),
27
28 #[error("Generation error: {0}")]
30 GenerationError(String),
31
32 #[error("Model loading error: {0}")]
34 LoadError(String),
35
36 #[error("Core error: {0}")]
38 CoreError(#[from] axonml_core::Error),
39
40 #[error("IO error: {0}")]
42 IoError(String),
43
44 #[error("Network error: {0}")]
46 NetworkError(String),
47
48 #[error("Parse error: {0}")]
50 ParseError(String),
51
52 #[error("Model not found: {0}")]
54 ModelNotFound(String),
55
56 #[error("Weight not found: {0}")]
58 WeightNotFound(String),
59
60 #[error("Unsupported format: {0}")]
62 UnsupportedFormat(String),
63
64 #[error("Tensor error: {0}")]
66 TensorError(String),
67}