Skip to main content

opengrade-ai-server

OpenGrade server package (API + packaged UI).

  • Distribution: opengrade-ai-server (PyPI)
  • Import path: opengrade_server (e.g. uvicorn opengrade_server.main:app)
  • Console scripts: opengrade (ui, check; provided by the opengrade-ai dependency) and opengrade-server (same commands)

Local UI

Requires Node.js >= 22 to build the UI from a clone. Contributors should use uv sync --all-extras (plain uv sync strips extras from an existing venv).

# from repo root — build the Next static export into the package
python scripts/package_ui.py   # or ./scripts/package-ui.sh
cd backend && uv sync --all-extras
uv run opengrade ui
# → http://127.0.0.1:8000  (SQLite ./opengrade.db by default)

Local SQLite schema is applied with Alembic on startup (same revisions as Postgres). File-backed SQLite uses WAL and a 5s busy_timeout. If a local DB is stale or broken, delete ./opengrade.db (and any -wal/-shm sidecars) and restart.

Backup: stop the process (or run PRAGMA wal_checkpoint(FULL)), then copy opengrade.db plus any opengrade.db-wal / opengrade.db-shm files. Do not copy only the main file while the process is writing under WAL.

opengrade ui loads .env from the current working directory when present, prints LLM / content-capture settings, and exits if the bind port already has a listener (use --port or stop the other process).

Postgres:

uv run opengrade ui --backend-store-uri 'postgresql+asyncpg://opengrade:opengrade@localhost:5434/opengrade'

Ops (container)

  • Image: ghcr.io/19alma98/ai-eval-platform/opengrade (tags: semver from the release tag, plus latest). Published by .github/workflows/publish.yml. Compose uses that image and can still build: from this checkout (docker compose up --build).
  • Single API replica — scoring runs in-process; multi-replica recovery is not safe yet.
  • Image runs as non-root (opengrade, uid/gid 10001); /app is writable for optional SQLite and judge-prompt snapshots (OPENGRADE_JUDGE_PROMPT_SNAPSHOTS).
  • Probes: GET /health (liveness), GET /ready (DB readiness). Compose healthchecks /ready.
  • Requests carry X-Request-ID (echoed / generated).
  • Entrypoint: --proxy-headers, --forwarded-allow-ips (FORWARDED_ALLOW_IPS), --timeout-graceful-shutdown (SHUTDOWN_GRACE_SECONDS).
  • OTLP /v1/traces may return 429 / 503 with Retry-After when rate, inflight, or pending-score caps are hit (OTLP_* in .env.example).

Environment variables

Settings are loaded from the process environment (and .env in the cwd when present). Compose overrides DATABASE_URL for the api service and optionally loads backend/.env. Canonical defaults and comments: .env.example. Field mapping lives in opengrade_server.config.Settings.

Variable Default Notes
DATABASE_URL sqlite+aiosqlite:///./opengrade.db Compose sets Postgres; use postgresql+asyncpg://…
APP_HOST / APP_PORT 0.0.0.0 / 8000 Container bind; Compose publishes 127.0.0.1:8000
CONTENT_CAPTURE_ENABLED true false redacts span/LLM text at ingest
OPENGRADE_API_KEY unset Bootstrap admin key; unset = no auth
OPENGRADE_UI_SESSION_HOURS 12 UI session cookie lifetime
LLM_MODEL / LLM_API_KEY / LLM_API_BASE see .env.example LiteLLM judges; non-secret fields can be overridden in Settings → LLM judges (DB overlay). LLM_API_KEY is never stored in the DB — the UI writes it to cwd .env only.
LLM_TIMEOUT_SECONDS / LLM_MAX_RETRIES / LLM_MAX_CONCURRENCY 60 / 2 / 8 Raise timeout for cold Ollama; overridable in Settings
LLM_TEMPERATURE / LLM_SEED 0.0 / 42 Seed ignored by some providers; overridable in Settings
FORWARDED_ALLOW_IPS * Trusted proxies for X-Forwarded-*
SHUTDOWN_GRACE_SECONDS 30 Uvicorn graceful shutdown
PUBLIC_BASE_URL unset External UI URL in alert links
ALERT_WEBHOOK_URL unset Default webhook for alert rules
ALERTS_ENABLED / ALERTS_INTERVAL_SECONDS true / 60 In-process alert evaluation
RETENTION_DAYS / RETENTION_INTERVAL_HOURS unset / 24 Unset retention = keep forever
OTLP_MAX_BODY_BYTES / JSON_MAX_BODY_BYTES / DATASET_IMPORT_MAX_BYTES 4 MiB Request size caps
OTLP_RATE_LIMIT_PER_SECOND / OTLP_MAX_INFLIGHT / OTLP_MAX_PENDING_SCORES / OTLP_RETRY_AFTER_SECONDS 50 / 32 / 200 / 1 Per-process backpressure
OPENGRADE_JUDGE_PROMPT_SNAPSHOTS .opengrade/judge_prompt_snapshots.json Local audit file under cwd

See the repository root README for Docker Compose and SDK quickstart.

Metadata

Release files for opengrade-ai-server 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opengrade-ai-server 0.2.0
File Size Uploaded Provenance Actions
opengrade_ai_server-0.2.0.tar.gz 1.8 MB With provenance Details for opengrade_ai_server-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opengrade-ai-server 0.2.0
File Interpreter ABI Platform Actions
opengrade_ai_server-0.2.0-py3-none-any.whl Python 3 none any Details for opengrade_ai_server-0.2.0-py3-none-any.whl

Total release size: 3.6 MB

Release files / opengrade_ai_server-0.2.0.tar.gz

Download URL opengrade_ai_server-0.2.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
03a70179a6bf3bee1e6e44bca437c7ceff4f94fb5916393122d144fd1096ff9d
BLAKE2b-256 checksum
How to use checksums
cd738238c25651e1bb2066b7cc318dfba2650f0c5020b5a8e5ac56e01685a936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / opengrade_ai_server-0.2.0-py3-none-any.whl

Download URL opengrade_ai_server-0.2.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
996972d97667642a9ab126c758845fb2a2274d7f0331b32dc66836a8563df74b
BLAKE2b-256 checksum
How to use checksums
90b0a6aae3fab89633f0eba3f9d16c6acd36c5d17d7de0eaae1ab1f08fdee1eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for opengrade-ai-server 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opengrade_ai_server-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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