Skip to main content
Chroma supports Hugging Face’s vast ecosystem of embedding models, giving you access to thousands of open-source models for your specific use case.

Installation

Python
The sentence-transformers library is required for using Hugging Face models with Chroma.

Using Sentence Transformers

Basic usage

Using the Hugging Face API

With HuggingFace Inference API

With a custom inference endpoint

Device configuration

Model selection guide

Fast & efficient

all-MiniLM-L6-v2 (384 dims)
Best for: High-throughput applications, real-time search

High quality

all-mpnet-base-v2 (768 dims)
Best for: When accuracy is more important than speed

Multilingual

paraphrase-multilingual-MiniLM-L12-v2 (384 dims)
Best for: Multi-language content

Code search

multi-qa-mpnet-base-dot-v1 (768 dims)
Best for: Question-answering systems

Configuration options

string
required
Name of the Sentence Transformer model from Hugging Face
string
default:"cpu"
Device to run the model on: cpu, cuda, or cuda:N
bool
default:"false"
Whether to normalize embeddings to unit length
string
Hugging Face API token (for HuggingFaceEmbeddingFunction)

Custom models

Load a fine-tuned model

Load a local model

Performance optimization

Batch processing

Model caching

Finding models

Browse thousands of models on Hugging Face:
  1. Visit Hugging Face Models
  2. Filter by:
    • Task: “Sentence Similarity” or “Feature Extraction”
    • Library: “sentence-transformers”
  3. Check model card for:
    • Embedding dimensions
    • Languages supported
    • Performance metrics
    • License

Best practices

  • Smaller models (384 dims): Faster, use less storage
  • Larger models (768+ dims): Better quality, slower
  • Consider your performance requirements vs. accuracy needs
If you’re processing thousands of documents, using a GPU can significantly speed up embedding generation.
Models are cached after first download. Set SENTENCE_TRANSFORMERS_HOME to control cache location.
Different models excel at different tasks. Test multiple models with your specific use case.

Resources

Free and open-source: All Sentence Transformer models can be run locally without API costs, making them perfect for production deployments.