599 B

Guide: How to use OpenAI-compatible embedding models (e.g. Ollama) with TensorZero

Running the Example

  1. Launch the Ollama server:
ollama serve
  1. Download an embedding model:
ollama pull nomic-embed-text
  1. Launch the TensorZero Gateway:
docker compose up
  1. 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