pub struct NemotronEmbedder { /* private fields */ }Expand description
NVIDIA Embed Nemotron 8B embedder using realizar’s GGUF infrastructure
Produces 4096-dimensional embeddings from a Llama 3.1 8B-based model. Supports asymmetric retrieval with query/passage prefixes.
Requires the nemotron feature to be enabled.
§Example
ⓘ
use trueno_rag::embed::{NemotronEmbedder, NemotronConfig, Embedder};
let config = NemotronConfig::new("models/NV-Embed-v2-Q4_K.gguf")
.with_gpu(true);
let embedder = NemotronEmbedder::new(config)?;
let query_emb = embedder.embed_query("What is machine learning?")?;
let doc_emb = embedder.embed_document("Machine learning is a branch of AI...")?;Implementations§
Source§impl NemotronEmbedder
impl NemotronEmbedder
Sourcepub fn new(config: NemotronConfig) -> Result<Self>
pub fn new(config: NemotronConfig) -> Result<Self>
Create a new Nemotron embedder from configuration
§Errors
Returns an error if:
- The model file doesn’t exist or can’t be read
- The model is not a valid GGUF file
- The model architecture is not compatible
Sourcepub fn config(&self) -> &NemotronConfig
pub fn config(&self) -> &NemotronConfig
Get the configuration
Trait Implementations§
Source§impl Debug for NemotronEmbedder
Available on crate feature nemotron only.
impl Debug for NemotronEmbedder
Available on crate feature
nemotron only.Auto Trait Implementations§
impl Freeze for NemotronEmbedder
impl RefUnwindSafe for NemotronEmbedder
impl Send for NemotronEmbedder
impl Sync for NemotronEmbedder
impl Unpin for NemotronEmbedder
impl UnsafeUnpin for NemotronEmbedder
impl UnwindSafe for NemotronEmbedder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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