Model

Struct Model 

Source
pub struct Model {
Show 17 fields pub id: i64, pub name: String, pub file_path: PathBuf, pub param_count_b: f64, pub architecture: Option<String>, pub quantization: Option<String>, pub context_length: Option<u64>, pub metadata: HashMap<String, String>, pub added_at: DateTime<Utc>, pub hf_repo_id: Option<String>, pub hf_commit_sha: Option<String>, pub hf_filename: Option<String>, pub download_date: Option<DateTime<Utc>>, pub last_update_check: Option<DateTime<Utc>>, pub tags: Vec<String>, pub capabilities: ModelCapabilities, pub inference_defaults: Option<InferenceConfig>,
}
Expand description

A model that exists in the system with a database ID.

This represents a persisted model with all its metadata. Use NewModel for models that haven’t been persisted yet.

Fields§

§id: i64

Database ID of the model (always present for persisted models).

§name: String

Human-readable name for the model.

§file_path: PathBuf

Absolute path to the GGUF file on the filesystem.

§param_count_b: f64

Number of parameters in the model (in billions).

§architecture: Option<String>

Model architecture (e.g., “llama”, “mistral”, “falcon”).

§quantization: Option<String>

Quantization type (e.g., “Q4_0”, “Q8_0”, “F16”, “F32”).

§context_length: Option<u64>

Maximum context length the model supports.

§metadata: HashMap<String, String>

Additional metadata key-value pairs from the GGUF file.

§added_at: DateTime<Utc>

UTC timestamp of when the model was added to the database.

§hf_repo_id: Option<String>

HuggingFace repository ID (e.g., “TheBloke/Llama-2-7B-GGUF”).

§hf_commit_sha: Option<String>

Git commit SHA from HuggingFace Hub.

§hf_filename: Option<String>

Original filename on HuggingFace Hub.

§download_date: Option<DateTime<Utc>>

Timestamp of when this model was downloaded from HuggingFace.

§last_update_check: Option<DateTime<Utc>>

Last time we checked for updates on HuggingFace.

§tags: Vec<String>

User-defined tags for organizing models.

§capabilities: ModelCapabilities

Model capabilities inferred from chat template analysis.

§inference_defaults: Option<InferenceConfig>

Per-model inference parameter defaults.

These are preferred over global settings when making inference requests. If not set, falls back to global settings or hardcoded defaults.

Implementations§

Source§

impl Model

Source

pub fn to_new_model(&self) -> NewModel

Convert this model to a NewModel (drops the ID).

Useful when you need to clone a model’s data without the ID.

Trait Implementations§

Source§

impl Clone for Model

Source§

fn clone(&self) -> Model

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Model

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Model

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Model

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnwindSafe for Model

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,