Feature Extraction
sentence-transformers
Safetensors
Transformers
multilingual
qwen3
text-generation
custom_code
text-embeddings-inference
Run this model with HF Jobs
Run MongoDB/voyage-4-nano on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/MongoDB/voyage-4-nano. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MongoDB/voyage-4-nano on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use MongoDB/voyage-4-nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use MongoDB/voyage-4-nano with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("MongoDB/voyage-4-nano", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use MongoDB/voyage-4-nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="MongoDB/voyage-4-nano", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MongoDB/voyage-4-nano", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MongoDB/voyage-4-nano", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Document minimum transformers version (4.56)
#17
by fzoll - opened
The modeling code needs TransformersKwargs, which first shipped in transformers 4.56, so the model doesn't load on the 4.51.3 listed in config.json.
- README: note that
transformers>=4.56is required (4.x and 5.x both work since #14 and #16) - config.json:
transformers_version4.51.3 -> 4.56.2
Checked with the updated config: AutoModel on 4.56.2, 4.57.3 and 5.19.0, and sentence-transformers on 4.57.3, 5.18.0 and 5.19.0. Embeddings are unchanged.
fzoll changed pull request status to merged