Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cognisafeltd.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Why self-host

  • Data sovereignty: LLM request and response payloads never leave your network. All logging, scoring, and storage happens on infrastructure you control.
  • Regulated industries: Healthcare, finance, and government environments often prohibit sending data to third-party SaaS. Self-hosting satisfies those requirements.
  • Air-gapped deployments: Cognisafe works entirely on-premises with local LLMs via Ollama. No outbound internet required (optional even for safety scoring).
  • Custom data retention: Configure PostgreSQL retention policies to match your compliance requirements — Cognisafe does not impose its own retention limits.

What you deploy

The full Cognisafe stack consists of six services:
ServiceTechnologyRole
proxyGoOpenAI-compatible reverse proxy; logs every LLM call
apiPython / FastAPIREST API, Stripe billing webhooks, rate limiting
safety_workerPython / PyRITAsync safety scorer; reads from Redis, writes to PostgreSQL
webNext.js 14Dashboard UI — requests, safety scores, billing
postgresPostgreSQL / TimescaleDBPrimary datastore
redisRedisJob queue (safety_score_jobs)
You own and operate all of these. Cognisafe is fully open-source under the MIT licence.

Deployment options

Docker Compose

The fastest way to run the full stack. Suitable for a single VM, local development, or a small team. Up in under 5 minutes.

Kubernetes / Helm

Production-grade deployment via Railway or your own Kubernetes cluster. Horizontal scaling, managed databases, auto-deploy on git push.

Minimum requirements

ResourceMinimumRecommended
CPU2 cores4 cores
RAM4 GB8 GB
Disk20 GB100 GB (depends on request volume)
PostgreSQL14+TimescaleDB 2.x on PG 16
Redis6+7+
The safety worker is the most CPU-intensive component when running multiple scorers concurrently. Scale it independently with --scale safety_worker=N.

Environment variables

All services are configured via environment variables. See the full reference for every variable, which service uses it, and whether it’s required.