Skip to main content

Model

Struct Model 

Source
pub struct Model {
Show 26 fields pub id: i64, pub name: String, pub model_key: String, pub file_path: PathBuf, pub param_count_b: f64, pub architecture: Option<String>, pub quantization: Option<String>, pub context_length: Option<u64>, pub expert_count: Option<u32>, pub expert_used_count: Option<u32>, pub expert_shared_count: Option<u32>, 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>, pub defaults_origin: Option<DefaultsOrigin>, pub server_defaults: Option<ServerConfig>, pub dialect_spec: Option<DialectSpec>, pub template_caps: Option<TemplateCaps>, pub benchmark_summary: Option<ModelBenchmarkSummary>,
}
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.

§model_key: String

Canonical deduplication key (e.g., hf:repo@sha#file).

§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.

§expert_count: Option<u32>

Number of experts (for MoE models).

§expert_used_count: Option<u32>

Number of experts used during inference (for MoE models).

§expert_shared_count: Option<u32>

Number of shared experts (for MoE models).

§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.

§defaults_origin: Option<DefaultsOrigin>

Whether Self::inference_defaults was set by the user or auto-detected at import time from the reasoning tag.

Always None when Self::inference_defaults is None — there is nothing to have an origin. See DefaultsOrigin for why this changes how resolution ranks the field.

§server_defaults: Option<ServerConfig>

Per-model server-level defaults (context_length, etc.).

Stored as JSON in the database. Overrides global settings but can be overridden at request time. Part of the 5-level fallback chain.

§dialect_spec: Option<DialectSpec>

Tool-call dialect spec detected at import/retag time.

Stored as JSON in the database. None for rows imported before specs existed and for models whose dialect could not be derived — consumers fall back to the format:* tag mapping.

§template_caps: Option<TemplateCaps>

llama-server’s template-capability self-report (chat_template_caps from GET /props), recorded once a launch has observed it.

Stored as JSON in the database. None means never observed — the third state of ADR 0007’s tri-state, never to be collapsed into “not supported”. Unlike Self::dialect_spec this is not derived at import time: it is a fact about the binary–model pair, so only a launch can learn it.

§benchmark_summary: Option<ModelBenchmarkSummary>

Denormalised benchmark summary joined from model_benchmark_summaries.

None when no benchmark has been run for this model yet, or when the model is fetched without the summary join (e.g. lightweight lookups).

Trait Implementations§

Source§

impl Clone for Model

Source§

fn clone(&self) -> Model

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 From<&Model> for ModelSummary

Borrow a stored model as the lightweight summary events carry.

Every emit site wants the same five fields off a Model it already has, so the mapping lives here rather than being spelled out per call site.

Source§

fn from(model: &Model) -> Self

Converts to this type from the input type.
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 UnsafeUnpin 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

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