Skip to main content

NewModel

Struct NewModel 

Source
pub struct NewModel {
Show 22 fields 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 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 file_paths: Option<Vec<PathBuf>>, pub capabilities: ModelCapabilities, pub inference_defaults: Option<InferenceConfig>, pub defaults_origin: Option<DefaultsOrigin>, pub server_defaults: Option<ServerConfig>,
}
Expand description

A model to be inserted into the system (no ID yet).

This represents a model that hasn’t been persisted to the database. After insertion, the repository returns a Model with the assigned ID.

Fields§

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

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

§file_paths: Option<Vec<PathBuf>>

Ordered list of all file paths for sharded models (None for single-file 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>§server_defaults: Option<ServerConfig>

Per-model server startup defaults.

Implementations§

Source§

impl NewModel

Source

pub fn new( name: String, file_path: PathBuf, param_count_b: f64, added_at: DateTime<Utc>, ) -> Self

Create a new model with minimal required fields.

Other fields are set to None or empty defaults.

Trait Implementations§

Source§

impl Clone for NewModel

Source§

fn clone(&self) -> NewModel

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 NewModel

Source§

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

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

impl<'de> Deserialize<'de> for NewModel

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 NewModel

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§

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>,