Skip to main content

Rubra

Server — REST API + live dashboard for Rubra.

PyPI Docker License CI Open in GitHub Codespaces

Self-host a backend for your Rubra traces: browse them, run evaluations, and generate HTML reports from a browser — no notebook required.


Try the full stack now — zero cost, zero setup

Click Open in GitHub Codespaces above (or go to codespaces.new/pm1715/rubra-server). The devcontainer automatically:

  • Clones rubra-sdk and rubra-deploy as sibling repos and installs everything
  • Installs and starts Ollama with a small local model — no OpenAI key needed
  • Installs kubectl, helm, and kind for testing the rubra-deploy Helm chart against a real (throwaway) Kubernetes cluster

Once it's ready:

# 1. Generate a real trace — a tool-calling agent, judged by a free local model
python examples/full_stack_demo.py

# 2. Start the server
uvicorn app.main:app --reload

Open the forwarded port-8000 URL for the dashboard, select the trace, and hit Evaluate — the judge-model field defaults to gpt-4o-mini but works with any litellm-supported model, including the free ollama/llama3.2:1b already running in the Codespace.

To also test the Kubernetes deployment for real:

cd ../rubra-deploy
./scripts/test-in-kind.sh

This builds the actual Dockerfile, loads it into a kind cluster, installs the Helm chart, and port-forwards it — a genuine deploy test with no registry or cloud cluster required.


Quickstart

Docker (recommended)

docker run -p 8000:8000 ghcr.io/pm1715/rubra-server:latest

Or with docker compose for persistent storage:

git clone https://github.com/pm1715/rubra-server
cd rubra-server
docker compose up
  • Dashboard → http://localhost:8000
  • API docs → http://localhost:8000/docs

From PyPI

pip install rubra-server
rubra-server

From source

pip install -e ".[dev]"
uvicorn app.main:app --reload

By default the server uses SQLite at .rubra/rubra.db and runs in open dev mode (no API key required).


Configuration

Copy .env.example to .env and adjust:

Variable Default Description
RUBRA_API_KEY unset If set, all endpoints require an X-Rubra-API-Key header matching this value. Unset = open dev mode.
RUBRA_DATABASE_URL sqlite:///./data/rubra.db SQLite or PostgreSQL connection string.
RUBRA_HOST 0.0.0.0 Bind host.
RUBRA_PORT 8000 Bind port.
RUBRA_DEBUG false Enables uvicorn auto-reload.
RUBRA_CORS_ORIGINS ["*"] Restrict to your frontend origin in production.

API

Method Path Description
GET /api/v1/traces List traces (?agent_name=, ?limit=, ?offset=)
GET /api/v1/traces/{trace_id} Full trace detail including spans
DELETE /api/v1/traces/{trace_id} Delete a trace and its stored metric results
POST /api/v1/eval Evaluate a trace ({"trace_id": "...", "metrics": "all", "judge_model": "gpt-4o-mini"})
GET /api/v1/eval/{trace_id} Fetch previously computed metric results
GET /api/v1/report/{trace_id} Self-contained HTML report
GET /api/v1/health Health check + storage backend info
GET /api/v1/version Server + SDK version

Full interactive docs at /docs (Swagger) and /redoc.


Dashboard

The / route serves a single-page dashboard: a trace list on the left, and on selection — trace metadata, span timeline, and an inline Evaluate button that runs any metric category and renders pass/fail results without leaving the page. The judge-model field next to it accepts any litellm model string, so goal metrics can run against a free local Ollama model instead of a paid API.

It polls /api/v1/traces every 30s, so traces produced by an instrumented agent elsewhere show up automatically.


Getting traces into the server

The server only reads traces — it doesn't instrument your agent. Point your app's storage at the same database, or use the SDK's Postgres/shared-SQLite backend:

import os
os.environ["RUBRA_DATABASE_URL"] = "postgresql://rubra:rubra@localhost:5432/rubra"

import rubra

@rubra.agent(task="Answer questions")
def my_agent(question: str) -> str:
    ...

As long as rubra-server points at the same RUBRA_DATABASE_URL, traces appear in the dashboard as soon as the agent finishes.


Security & Code of Conduct

This repo follows the same Security Policy and Code of Conduct as rubra-sdk.

License

Apache 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rubra_server-0.1.1.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rubra_server-0.1.1-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file rubra_server-0.1.1.tar.gz.

File metadata

  • Download URL: rubra_server-0.1.1.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rubra_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e3f2800f902a7af1902e61d960f75d4d14410974642a3a67d66bae498aadc908
MD5 35601ca06396035889c9532adef97743
BLAKE2b-256 5d31fd73aa95769fe0fcd7d4d8e98858bf24e9efbc58b092489a495ee1d76c1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rubra_server-0.1.1.tar.gz:

Publisher: publish-pypi.yml on pm1715/rubra-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rubra_server-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rubra_server-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rubra_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50b9da1a77179e2c49677265b3acdd3afae947a4a9a62f0ba0fb4aeacf7b6580
MD5 17a70853283a90ba0eae51e99b462e93
BLAKE2b-256 0a858ea200e5b867c31bdb924bfac088cd6f56bfb7ca17b2508095d3a352b8f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rubra_server-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on pm1715/rubra-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page