| Crates.io | chroma |
| lib.rs | chroma |
| version | 0.12.0 |
| created_at | 2024-09-26 22:51:07.288367+00 |
| updated_at | 2026-01-13 17:31:24.853927+00 |
| description | Client for Chroma, the AI-native cloud database. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1388068 |
| size | 271,143 |
This crate provides the official Chroma Rust client. Chroma is an open-source AI-native search database that makes it easy to get private, offline, and real-time data that large language models were not trained on into their context. Where the language models provide reasoning, Chroma focuses on search, enabling your application to customize the search methods it needs most.
Specifically, there are multiple modes of search supported by Chroma.
Chroma natively supports hybrid search of all search modes via its search endpoint, which can do a
weighted hybrid search across all modes of search, enabling applications to mix and match search
strategies.
Already know what Chroma is? Get started fast:
Get started with Chroma. The easiest route is to sign up for Chroma Cloud. If the cloud isn't yet your thing, pip install chromadb and chroma run will get you much of the same experience.
Add Chroma to your Rust project.
cargo add chroma
let client = ChromaHttpClient::cloud()?;
This will automatically read the following environment variables to set up a Chroma client:
CHROMA_ENDPOINT sets the URL for Chroma. For Chroma Cloud this is https://api.trychroma.com.
There is no need to set this environment variable if you want to work with Cloud directly.CHROMA_API_KEY sets the API key to authenticate to Chroma. This should be a Chroma-provided API
key. To generate a key, log in to the Chroma dashboard, create or select
a database, and look for how to connect to your database under "settings".CHROMA_TENANT sets the tenant. If you provide an API key, this will be inferred automatically
on start.CHROMA_DATABASE sets the database. If you provide an API key scoped to a single database, this
will be automatically inferred.If you're developing with Chroma locally, you can use the following code instead:
let client = ChromaHttpClient::from_env()?;
This is sufficient for developing from localhost.
For more complex configurations see ChromaHttpClientOptions in this crate by visiting the
documentation.
The Chroma client is designed for production use and includes the following features:
metrics feature for the OpenTelemetry standard.