Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nomic AI

Nomic AI provides open-weight embedding models with a free API tier. The nomic-embed-text-v1.5 model supports 8192-token context windows and offers task-type-specific encoding for search, classification, and clustering.

Setup

[dependencies]
synaptic = { version = "0.4", features = ["nomic"] }

Get a free API key at atlas.nomic.ai.

Usage

use synaptic::nomic::{NomicConfig, NomicEmbeddings};
use synaptic::core::Embeddings;

let config = NomicConfig::new("your-api-key");
let embeddings = NomicEmbeddings::new(config);

let docs = embeddings.embed_documents(&["Long document text...", "Another document."]).await?;
let query_vec = embeddings.embed_query("search query").await?;

Models

Enum VariantAPI Model IDContextNotes
NomicEmbedTextV1_5nomic-embed-text-v1.58192 tokensDefault, best quality
NomicEmbedTextV1nomic-embed-text-v12048 tokensOlder generation

Task Types

Nomic uses task-type specific encoding. embed_documents() uses search_document and embed_query() uses search_query automatically.