Skip to content

Update Chroma notebook #1997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
"source": [
"# Chroma\n",
"\n",
"We'll index these embedded documents in a vector database and search them. The first option we'll look at is **Chroma**, an easy to use open-source self-hosted in-memory vector database, designed for working with embeddings together with LLMs. \n",
"We'll index these embedded documents in a vector database and search them. The first option we'll look at is **Chroma**, an easy to use open-source vector database, designed for working with embeddings together with LLMs.\n",
"\n",
"In this section, we will:\n",
"- Instantiate the Chroma client\n",
Expand All @@ -528,8 +528,11 @@
"source": [
"### Instantiate the Chroma client\n",
"\n",
"Create the Chroma client. By default, Chroma is ephemeral and runs in memory. \n",
"However, you can easily set up a persistent configuration which writes to disk."
"Create the Chroma client. There are several ways to run a Chroma server and connect to it:\n",
"* In memory using the `EphemeralClient`\n",
"* Locally with data persistence using the `PersistentClient`\n",
"* You can run Chroma on your own server and connect to it using the `HttpClient`\n",
"* Using Chroma Cloud, and connecting to your DB using the `CloudClient`."
]
},
{
Expand All @@ -540,8 +543,23 @@
"outputs": [],
"source": [
"chroma_client = chromadb.EphemeralClient() # Equivalent to chromadb.Client(), ephemeral.\n",
"\n",
"# Uncomment for persistent client\n",
"# chroma_client = chromadb.PersistentClient()"
"# chroma_client = chromadb.PersistentClient()\n",
"\n",
"# Uncomment for connecting to a remote Chroma server\n",
"# chroma_client = chromadb.HttpClient(\n",
"# ssl=False,\n",
"# host='localhost',\n",
"# port=8000\n",
"# )\n",
"\n",
"# Uncomment for connecting to ChromaCloud\n",
"# chroma_client = chromadb.CloudClient(\n",
"# tenant=os.getenv(\"CHROMA_TENANT\"),\n",
"# database=os.getenv(\"CHROMA_DATABASE\"),\n",
"# api_key=os.getenv(\"CHROMA_API_KEY\"),\n",
"# )"
]
},
{
Expand Down Expand Up @@ -873,7 +891,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "chroma_openai",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -887,7 +905,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.13.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -986,9 +986,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.10"
"version": "3.13.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}