> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomajordomo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Majordomo is the control plane for your AI stack — cost visibility, replay, and evals across every LLM request your team makes.

Majordomo sits between your application and your LLM providers. Every request is logged with model, tokens, cost, and latency. You get a dashboard, a query layer, and tools to test model changes before they ship — without touching your application code.

## What you get

<CardGroup cols={2}>
  <Card title="Cost & Usage Tracking" icon="chart-bar">
    Every request logged. Break down spend by team, feature, environment, or user with custom metadata headers.
  </Card>

  <Card title="Agent Run Tracking" icon="diagram-project">
    Group the many LLM calls of one conversation or agent run into a single run — with a rolled-up cost and a nested waterfall of which step drove which calls.
  </Card>

  <Card title="Replay" icon="rotate">
    Run real production traffic against a candidate model. Get actual cost, latency, and quality numbers on your workload before you switch.
  </Card>

  <Card title="Evals" icon="check-circle">
    Build test suites from logged requests. Define scoring criteria. Run scored evaluations against any model before a change ships.
  </Card>

  <Card title="Experiments" icon="flask">
    Split live traffic across models by weight, compare cost, latency, and quality per arm, and promote the winner — no application code changes.
  </Card>

  <Card title="Multi-provider Routing" icon="shuffle">
    OpenAI, Anthropic, Gemini, Bedrock, and OpenAI-compatible providers (Fireworks, Together, DeepSeek) from a single endpoint.
  </Card>
</CardGroup>

## Two deployment modes

**Managed** — Majordomo runs Steward and the dashboard. Point your SDK at the gateway endpoint, create an API key, and you're logging requests within minutes. No infrastructure to operate.

**Self-hosted Steward** — You run Steward inside your own VPC. Your prompts and completions never leave your infrastructure. Majordomo receives only metadata — token counts, cost, latency, model name. The dashboard works identically. The right choice for teams with data residency requirements or enterprise customers who need to control where AI data is processed.

[How it works →](/architecture/how-it-works)

## How integration works

One config change. Everything else stays the same.

```python theme={null}
# Before
client = OpenAI(api_key="sk-...")

# After
client = OpenAI(
    base_url="https://gateway.gomajordomo.com/v1",
    api_key="sk-...",
    default_headers={"X-Majordomo-Key": "mdm_sk_..."}
)
```

## Open source

Prefer to run a gateway yourself? `majordomo-gateway` is a standalone, self-hostable LLM gateway, open source under the MIT license — the same header conventions, priced and logged to your own Postgres, with nothing phoning home.

[GitHub →](https://github.com/go-majordomo/majordomo-gateway)
