Discover / Token & Cost Optimization

TensorZero

by tensorzeroRust

Open source LLM gateway and optimization framework unifying inference, observability and evals.

Toolstable

Maturity: stable because 2y old, 2026.6.0 released 60d ago. Derived from release and commit history, not a rating.

Stars
12k
Forks
958
Downloads / mo
Last commit
2026-06-11
License
Apache-2.0
Open issues
392

Market and trust evidence

Edition not yet matched

No exact skills.sh identity match is available for this repository. Repository adoption and freshness remain visible above; install momentum is not inferred.

Trust analysis is a screening signal, not a security warranty. Read the ranking and trust methodology.

In practice

Written by AI from this repository’s README · high confidence

Provider SDKs, tracing, evals and A/B testing are usually four separate systems that never share the same data.

Use it when

Use it when you need a low latency gateway whose stored inferences and feedback feed evals and optimization.

Not the right pick when

More machinery than needed if you call one provider and have no plans for evaluation or experimentation.

Capabilities

  • call any LLM, API or self hosted, through a single unified API
  • tool use, structured outputs, batch, embeddings, multimodal and caching
  • inferences and feedback stored in your own database
  • evaluation with heuristics and LLM judges
  • built-in A/B testing, routing, fallbacks and retries
  • usage and cost tracking with custom rate limits

Requirements

  • A database to store inferences and feedback
  • Provider credentials, or gateway auth so clients avoid sharing them

Cost: Free and open source

Video walkthroughs

Third-party YouTube uploads matched to this tool by title, channel and repository name on 2026-08-03. Not made, reviewed or endorsed by SkillPilot. View counts and publish months are as of the match date and the month is approximate. Nothing loads from YouTube until you press play.

What the repository ships

Ships CLAUDE.mdHas docsHas examplesSecurity policyCI configured

Detected from the actual files in the repository root.

Latest release 2026.6.0

Published 2026-06-04

[!CAUTION]

Security Advisory

This release fixed a high-risk vulnerability affecting the TensorZero Gateway.

Please refer to the security advisory for more details: https://github.com/tensorzero/tensorzero/security/advisories/GHSA-824w-x939-6cmc

Tags

README

<p><picture><img src="https://github.com/user-attachments/assets/9d0a93c6-7685-4e57-9737-7cbeb338a218" alt="TensorZero Logo" width="128" height="128"></picture></p>

TensorZero

<p><picture><img src="https://www.tensorzero.com/github-trending-badge.svg" alt="GitHub Trending - #1 Repository Of The Day"></picture></p>

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.

<br>

<p align="center">

<b><a href="https://www.tensorzero.com/" target="_blank">Website</a></b>

·

<b><a href="https://www.tensorzero.com/docs" target="_blank">Docs</a></b>

·

<b><a href="https://www.x.com/tensorzero" target="_blank">Twitter</a></b>

·

<b><a href="https://www.tensorzero.com/slack" target="_blank">Slack</a></b>

·

<b><a href="https://www.tensorzero.com/discord" target="_blank">Discord</a></b>

<br>

<br>

<b><a href="https://www.tensorzero.com/docs/quickstart" target="_blank">Quick Start (5min)</a></b>

·

<b><a href="https://www.tensorzero.com/docs/deployment/tensorzero-gateway" target="_blank">Deployment Guide</a></b>

·

<b><a href="https://www.tensorzero.com/docs/gateway/api-reference" target="_blank">API Reference</a></b>

·

<b><a href="https://www.tensorzero.com/docs/gateway/configuration-reference" target="_blank">Configuration Reference</a></b>

</p>

Demo

<video src="https://github.com/user-attachments/assets/04a8466e-27d8-4189-b305-e7cecb6881ee"></video>

Features

[!NOTE]

### 🆕 TensorZero Autopilot

TensorZero Autopilot is an automated AI engineer powered by TensorZero that analyzes LLM observability data, sets up evals, optimizes prompts and models, and runs A/B tests.

It dramatically improves the performance of LLM agents across diverse tasks:

<img width="600" alt="Bar chart showing baseline vs. optimized scores across diverse LLM tasks" src="https://github.com/user-attachments/assets/aa474fe3-b55a-48aa-9f0d-e7c2f8e32ccd" />

<br>

Learn more →

🌐 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 &mdash; all using the open-source TensorZero UI.

  • [x] Store inferences and feedback (metrics, human edits, etc.) in your own database
  • [x] Dive into individual inferences or high-level aggregate patterns using the TensorZero UI or programmatically
  • [x] Build datasets for optimization, evaluation, and other workflows
  • [x] Replay historical inferences with new prompts, models, inference strategies, etc.
  • [x] Export OpenTelemetry traces (OTLP) and export Prometheus metrics to your favorite application observability tools
  • [ ] Soon: AI-assisted debugging and root cause analysis; AI-assisted data labeling

📈 LLM Optimization

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

  • [x] Optimize your models with supervised fine-tuning, RLHF, and other techniques
  • [x] Optimize your prompts with automated prompt engineering algorithms like GEPA
  • [x] Optimize your inference strategy with dynamic in-context learning, best/mixture-of-N sampling, etc.
  • [x] 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.

  • [x] Evaluate individual inferences with _inference evaluations_ powered by heuristics or LLM judges (&approx; unit tests for LLMs)
  • [x] Evaluate end-to-end workflows with _workflow evaluations_ with complete flexibility (&approx; integration tests for LLMs)
  • [x] Optimize LLM judges just like any other TensorZero function to align them to human preferences
  • [ ] Soon: more built-in evaluators; headless evaluations

<table>

<tr></tr> <!-- flip highlight order -->

<tr>

<td width="50%" align="center" valign="middle"><b>Evaluation » UI</b></td>

<td width="50%" align="center" valign="middle"><b>Evaluation » CLI</b></td>

</tr>

<tr>

<td width="50%" align="center" valign="middle"><img src="https://github.com/user-attachments/assets/f4bf54e3-1b63-46c8-be12-2eaabf615699"></td>

<td width="50%" align="left" valign="middle">

<pre><code class="language-bash">docker compose run --rm evaluations \

--evaluation-name extract_data \

--dataset-name hard_test_cases \

--variant-name gpt_4o \

--concurrency 5</code></pre>

<pre><code class="language-bash">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)</code></pre>

</td>

</tr>

</table>

🧪 LLM Experimentation

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

  • [x] Run adaptive A/B tests to ship with confidence and identify the best prompts and models for your use cases.
  • [x] 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.

  • [x] Build simple applications or massive deployments with GitOps-friendly orchestration
  • [x] Extend TensorZero with built-in escape hatches, programmatic-first usage, direct database access, and more
  • [x] Integrate with third-party tools: specialized observability and evaluations, model providers, agent orchestration frameworks, etc.
  • [x] 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](https://venturebeat.com/ai/tensorzero-nabs-7-3m-seed-to-solve-the-messy

Truncated. Read the full README on GitHub ↗

Related tools