Tool

Unify LLM providers with observability and optimization

TensorZero is an open-source LLMOps platform unifying an LLM gateway, observability, evaluation, optimization, and experimentation in one stack.

Works with openaianthropicawsazuregcp

91
Spark score
out of 100
Updated 3 months ago
Source checked Sep 10, 2026
Version 2026.6.0

Add to Favorites

Why it matters

Deploy a unified gateway that connects your application to every major LLM provider through a single API while automatically capturing inference data, feedback, and metrics in your database to continuously optimize prompts, models, and performance through experimentation and evaluation.

Outcomes

What it gets done

01

Route requests across multiple LLM providers with sub-millisecond latency, fallbacks, and retries

02

Store all inferences and feedback in your database for debugging and analysis

03

Run A/B tests and evaluations to compare prompts, models, and inference strategies

04

Optimize LLM performance automatically using collected metrics and human feedback

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Overview

Tensorzero

TensorZero is an open-source LLMOps platform unifying an LLM gateway (sub-1ms p99 latency across every major provider), observability, evaluation, optimization, and A/B-testing experimentation in one self-hosted stack. Production feedback flows back into better prompts and models. Use it when running LLM applications in production and needing a self-hosted, low-latency gateway plus a feedback loop from observability to optimization; a lightweight single-purpose LLM wrapper may not need its full scope.

What it does

TensorZero is an open-source LLMOps platform that unifies five capabilities: a Gateway that accesses every major LLM provider through one unified API with under 1ms p99 latency overhead; Observability that stores inferences and feedback in your own database, browsable via the TensorZero UI or programmatically; Evaluation that benchmarks individual inferences or end-to-end workflows using heuristics or LLM judges; Optimization that turns production metrics and human feedback into better prompts, models, and inference strategies; and Experimentation with built-in A/B testing, routing, fallbacks, and retries. You can adopt any piece incrementally and combine it with other tools rather than replacing your whole stack at once.

The Gateway supports calling any LLM (hosted API or self-hosted) through a single interface, with tool use, structured JSON outputs, batch inference, embeddings, multimodal (image/file) inputs, caching, prompt templates and schemas, usage/cost tracking, custom rate limits, and built-in auth so clients don't need to share provider API keys directly. It is written in Rust and benchmarked at under 1ms p99 latency overhead at 10k+ QPS. Supported model providers include Anthropic, AWS Bedrock, AWS SageMaker, Azure, DeepSeek, Fireworks, GCP Vertex AI (Anthropic and Gemini), Google AI Studio, Groq, Hyperbolic, Mistral, OpenAI, OpenRouter, SGLang, TGI, Together AI, vLLM, xAI, and any OpenAI-compatible API such as Ollama.

Observability captures inferences and feedback (metrics, human edits) in your own database, lets you build datasets for optimization and evaluation, replay historical inferences against new prompts or models, and export OpenTelemetry traces and Prometheus metrics to your existing monitoring tools. Optimization covers supervised fine-tuning, RLHF, automated prompt engineering (e.g. GEPA), and inference-time strategies like dynamic in-context learning (DICL) and best/mixture-of-N sampling. Evaluation runs inference-level checks (roughly unit tests for LLMs) and workflow-level checks (roughly integration tests for LLMs), and LLM judges used for evaluation can themselves be optimized like any other TensorZero function. Experimentation supports adaptive A/B tests, including multi-turn systems and sequential testing.

TensorZero Autopilot is a separate, complementary paid product: an automated AI engineer built on TensorZero that analyzes observability data, sets up evaluations, and optimizes prompts and models on its own.

When to use - and when NOT to

Use TensorZero when you are running LLM applications in production and need a self-hosted, low-latency gateway plus a feedback loop that turns real usage data into better prompts and models over time - especially if you need type safety, GitOps-friendly configuration, and high throughput. It fits teams that want to unify observability, evaluation, and optimization instead of wiring together separate point tools, and that want to keep data and inference logs in their own database.

It is not necessarily the right fit if you just need a lightweight, single-purpose LLM wrapper with no interest in self-hosting a gateway, or if you have no need for production feedback loops, A/B testing, or fine-tuning workflows - the source frames TensorZero as infrastructure for industrial-grade LLM applications, though it notes it is also well-suited for prototypes and extendable up to the most complex deployments. The upstream repository (tensorzero/tensorzero on GitHub) is archived and no longer receiving updates.

Inputs and outputs

Getting started means deploying the TensorZero Gateway as one Docker container, then pointing an OpenAI SDK-compatible client (Python, Node, Go, etc.) at it by updating the base_url and model:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:3000/openai/v1", api_key="not-used")

response = client.chat.completions.create(
    model="tensorzero::model_name::anthropic::claude-sonnet-4-6",
    messages=[
        {
            "role": "user",
            "content": "Share a fun fact about TensorZero.",
        }
    ],
)

Input on the evaluation side is a dataset plus a variant to test, e.g. running docker compose run --rm evaluations --evaluation-name extract_data --dataset-name hard_test_cases --variant-name gpt_4o --concurrency 5, which outputs per-metric scores such as exact_match and semantic_match with confidence intervals. Output across the platform is routed LLM inferences, stored feedback and traces, evaluation scores, and optimized prompts, models, and inference strategies fed back into the Gateway.

Integrations

TensorZero plays nicely with the OpenAI SDK (used as the client interface to the Gateway) and OpenTelemetry (for exporting traces), and it exports Prometheus metrics for application observability tooling. It documents runnable examples for common workflows: optimizing a data-extraction (NER) pipeline with fine-tuning and DICL, building a multi-hop agentic RAG question-answering agent over Wikipedia, fine-tuning models against a hidden-preference judge, multimodal (vision) fine-tuning for document image classification, and improving chess play with best-of-N sampling.

Who it's for

Engineering teams running LLM applications in production who need a self-hosted, low-latency gateway across many model providers plus a built-in path from observability to evaluation to optimization. It suits organizations at the scale described in the source - from frontier AI startups to Fortune 10 companies - that want GitOps-friendly, type-safe LLM infrastructure they control themselves rather than a collection of disconnected point tools.

Source README

TensorZero Logo

TensorZero

GitHub Trending - #1 Repository Of The Day

TensorZero is an open-source LLMOps platform that unifies:

  • Gateway: access every LLM provider through a unified API, built for performance (<1ms p99 latency)
  • Observability: store inferences and feedback in your database, available programmatically or in the UI
  • Evaluation: benchmark individual inferences or end-to-end workflows using heuristics, LLM judges, etc.
  • Optimization: collect metrics and human feedback to optimize prompts, models, and inference strategies
  • Experimentation: ship with confidence with built-in A/B testing, routing, fallbacks, retries, etc.

You can take what you need, adopt incrementally, and complement with other tools.
It plays nicely with the OpenAI SDK, OpenTelemetry, and every major LLM provider.

TensorZero is used by companies ranging from frontier AI startups to the Fortune 10 and fuels ~1% of global LLM API spend today.


Website · Docs · Twitter · Slack · Discord

Quick Start (5min) · Deployment Guide · API Reference · Configuration Reference

Demo

Features

🌐 LLM Gateway

Integrate with TensorZero once and access every major LLM provider.

Supported Model Providers

Anthropic,
AWS Bedrock,
AWS SageMaker,
Azure,
DeepSeek,
Fireworks,
GCP Vertex AI Anthropic,
GCP Vertex AI Gemini,
Google AI Studio (Gemini API),
Groq,
Hyperbolic,
Mistral,
OpenAI,
OpenRouter,
SGLang,
TGI,
Together AI,
vLLM, and
xAI (Grok).

Need something else? TensorZero also supports any OpenAI-compatible API (e.g. Ollama).

Usage Example

You can use TensorZero with any OpenAI SDK (Python, Node, Go, etc.) or OpenAI-compatible client.

  1. Deploy the TensorZero Gateway (one Docker container).
  2. Update the base_url and model in your OpenAI-compatible client.
  3. Run inference:
from openai import OpenAI

# Point the client to the TensorZero Gateway
client = OpenAI(base_url="http://localhost:3000/openai/v1", api_key="not-used")

response = client.chat.completions.create(
    # Call any model provider (or TensorZero function)
    model="tensorzero::model_name::anthropic::claude-sonnet-4-6",
    messages=[
        {
            "role": "user",
            "content": "Share a fun fact about TensorZero.",
        }
    ],
)

See Quick Start for more information.

🔍 LLM Observability

Zoom in to debug individual API calls, or zoom out to monitor metrics across models and prompts over time — all using the open-source TensorZero UI.

📈 LLM Optimization

Send production metrics and human feedback to easily optimize your prompts, models, and inference strategies — using the UI or programmatically.

  • Optimize your models with supervised fine-tuning, RLHF, and other techniques
  • Optimize your prompts with automated prompt engineering algorithms like GEPA
  • Optimize your inference strategy with dynamic in-context learning, best/mixture-of-N sampling, etc.
  • Enable a feedback loop for your LLMs: a data & learning flywheel turning production data into smarter, faster, and cheaper models
  • Soon: synthetic data generation

📊 LLM Evaluation

Compare prompts, models, and inference strategies using evaluations powered by heuristics and LLM judges.

  • Evaluate individual inferences with inference evaluations powered by heuristics or LLM judges (≈ unit tests for LLMs)
  • Evaluate end-to-end workflows with workflow evaluations with complete flexibility (≈ integration tests for LLMs)
  • Optimize LLM judges just like any other TensorZero function to align them to human preferences
  • Soon: more built-in evaluators; headless evaluations
Evaluation » UI Evaluation » CLI
docker compose run --rm evaluations \
  --evaluation-name extract_data \
  --dataset-name hard_test_cases \
  --variant-name gpt_4o \
  --concurrency 5
Run ID: 01961de9-c8a4-7c60-ab8d-15491a9708e4
Number of datapoints: 100
██████████████████████████████████████ 100/100
exact_match: 0.83 ± 0.03 (n=100)
semantic_match: 0.98 ± 0.01 (n=100)
item_count: 7.15 ± 0.39 (n=100)

🧪 LLM Experimentation

Ship with confidence with built-in A/B testing, routing, fallbacks, retries, etc.

  • Run adaptive A/B tests to ship with confidence and identify the best prompts and models for your use cases.
  • Enforce principled experiments in complex workflows, including support for multi-turn LLM systems, sequential testing, and more.

& more!

Build with an open-source stack well-suited for prototypes but designed from the ground up to support the most complex LLM applications and deployments.

  • Build simple applications or massive deployments with GitOps-friendly orchestration
  • Extend TensorZero with built-in escape hatches, programmatic-first usage, direct database access, and more
  • Integrate with third-party tools: specialized observability and evaluations, model providers, agent orchestration frameworks, etc.
  • Iterate quickly by experimenting with prompts interactively using the Playground UI

Frequently Asked Questions

How is TensorZero different from other LLM frameworks?

  1. TensorZero enables you to optimize complex LLM applications based on production metrics and human feedback.
  2. TensorZero supports the needs of industrial-grade LLM applications: low latency, high throughput, type safety, self-hosted, GitOps, customizability, etc.
  3. TensorZero unifies the entire LLMOps stack, creating compounding benefits. For example, LLM evaluations can be used for fine-tuning models alongside AI judges.

Can I use TensorZero with ___?

Yes.
Every major programming language is supported.
It plays nicely with the OpenAI SDK, OpenTelemetry, and every major LLM provider.

Is TensorZero production-ready?

Yes.
TensorZero is used by companies ranging from frontier AI startups to the Fortune 10 and powers ~1% of the global LLM API spend today.

Here's a case study: Automating Code Changelogs at a Large Bank with LLMs

How much does TensorZero cost?

TensorZero (LLMOps platform) is 100% self-hosted and open-source.

TensorZero Autopilot (automated AI engineer) is a complementary paid product powered by TensorZero.

Who is building TensorZero?

Our technical team includes a former Rust compiler maintainer, machine learning researchers (Stanford, CMU, Oxford, Columbia) with thousands of citations, and the chief product officer of a decacorn startup. We're backed by the same investors as leading open-source projects (e.g. ClickHouse, CockroachDB) and AI labs (e.g. OpenAI, Anthropic). See our $7.3M seed round announcement and coverage from VentureBeat. We're hiring in NYC.

How do I get started?

You can adopt TensorZero incrementally. Our Quick Start goes from a vanilla OpenAI wrapper to a production-ready LLM application with observability and fine-tuning in just 5 minutes.

Get Started

Start building today.
The Quick Start shows it's easy to set up an LLM application with TensorZero.

Questions?
Ask us on Slack or Discord.

Using TensorZero at work?
Email us at hello@tensorzero.com to set up a Slack or Teams channel with your team (free).

Examples

We are working on a series of complete runnable examples illustrating TensorZero's data & learning flywheel.

Optimizing Data Extraction (NER) with TensorZero

This example shows how to use TensorZero to optimize a data extraction pipeline.
We demonstrate techniques like fine-tuning and dynamic in-context learning (DICL).
In the end, an optimized GPT-4o Mini model outperforms GPT-4o on this task — at a fraction of the cost and latency — using a small amount of training data.

Agentic RAG - Multi-Hop Question Answering with LLMs

This example shows how to build a multi-hop retrieval agent using TensorZero.
The agent iteratively searches Wikipedia to gather information, and decides when it has enough context to answer a complex question.

Writing Haikus to Satisfy a Judge with Hidden Preferences

This example fine-tunes GPT-4o Mini to generate haikus tailored to a specific taste.
You'll see TensorZero's "data flywheel in a box" in action: better variants leads to better data, and better data leads to better variants.
You'll see progress by fine-tuning the LLM multiple times.

Image Data Extraction - Multimodal (Vision) Fine-tuning

This example shows how to fine-tune multimodal models (VLMs) like GPT-4o to improve their performance on vision-language tasks.
Specifically, we'll build a system that categorizes document images (screenshots of computer science research papers).

Improving LLM Chess Ability with Best-of-N Sampling

This example showcases how best-of-N sampling can significantly enhance an LLM's chess-playing abilities by selecting the most promising moves from multiple generated options.

Blog Posts

We write about LLM engineering on the TensorZero Blog.
Here are some of our favorite posts:

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.