Guide: How to use OpenAI-compatible embedding models (e.g. Ollama) with TensorZero
Running the Example
- Launch the Ollama server:
ollama serve
- Download an embedding model:
ollama pull nomic-embed-text
- Launch the TensorZero Gateway:
docker compose up
- Run the example (in a separate terminal):
Python (OpenAI SDK)
a. Install the Python dependencies. We recommend using uv:
uv sync
b. Run the example:
uv run openai_sdk.py