pub struct ModelSpec {
pub id: &'static str,
pub name: &'static str,
pub kind: ModelKind,
pub repo: &'static str,
pub revision: &'static str,
pub files: &'static [ModelFile],
pub license: &'static str,
pub languages: &'static str,
pub dims: usize,
pub max_tokens: usize,
pub query_prefix: &'static str,
pub document_prefix: &'static str,
}Fields§
§id: &'static str§name: &'static str§kind: ModelKind§repo: &'static strFirst-party Hugging Face repository. Only ungated repositories are used: installing Paper never requires an account or a token.
revision: &'static strPinned commit, so a re-upload upstream cannot change what we run.
files: &'static [ModelFile]§license: &'static str§languages: &'static str§dims: usizeEmbedding width. 0 for rerankers, which produce a scalar.
max_tokens: usize§query_prefix: &'static strRetrieval instruction prefixes. BGE wants one on queries only; E5 wants them on both sides. Getting these wrong measurably hurts recall.
document_prefix: &'static strImplementations§
Source§impl ModelSpec
impl ModelSpec
pub fn size_bytes(&self) -> u64
pub fn size_mb(&self) -> u64
pub fn file(&self, name: &str) -> Option<&ModelFile>
Sourcepub fn download_urls(&self, file_name: &str) -> Vec<String>
pub fn download_urls(&self, file_name: &str) -> Vec<String>
Candidate download URLs for one file, in preference order.
The primary source is this crate’s own GitHub Release, which carries
the exact pinned bytes as <model-id>-<file> assets (staged by
scripts/fetch-models.sh during release CI). Hugging Face is the
fallback for development builds whose v<version> tag has no release
yet. Both sources are verified against the same SHA256 pin, so either
is safe to consume.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ModelSpec
impl Freeze for ModelSpec
impl Move for ModelSpec
impl RefUnwindSafe for ModelSpec
impl Send for ModelSpec
impl Sync for ModelSpec
impl Unpin for ModelSpec
impl UnsafeUnpin for ModelSpec
impl UnwindSafe for ModelSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more