Skip to main content

Quick Start

# Clone the repository
git clone https://github.com/QWED-AI/qwed-verification.git
cd qwed-verification

# Start with Docker Compose
docker-compose up -d

# Check status
docker-compose ps

Services

ServicePortPurpose
QWED API8000Main API
PostgreSQL5432Database
Redis6379Cache & rate limiting
Grafana3000Dashboards
Prometheus9090Metrics
Jaeger16686Tracing

Configuration

Environment Variables

# .env file

# Required — server will not start without these
API_KEY_SECRET=your-generated-secret
QWED_CORS_ORIGINS=https://app.yourcompany.com

# Infrastructure
DATABASE_URL=postgresql://user:pass@localhost:5432/qwed
REDIS_URL=redis://localhost:6379

# LLM provider
ACTIVE_PROVIDER=openai
OPENAI_API_KEY=sk-...

# Required — server will not start without these
API_KEY_SECRET=your-generated-secret  # python -c "import secrets; print(secrets.token_urlsafe(48))"
QWED_CORS_ORIGINS=https://app.yourcompany.com
API_KEY_SECRET and QWED_CORS_ORIGINS are mandatory as of v5.0.0. See the deployment guide for the full reference.

API Configuration

# config.py
SETTINGS = {
    "rate_limit_enabled": True,
    "rate_limit_per_minute": 60,
    "cache_ttl_seconds": 3600,
    "max_query_length": 10000,
    "allowed_engines": ["math", "logic", "code", "sql"],
}

Docker

API Only

FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -e .
EXPOSE 8000
CMD ["uvicorn", "qwed_new.api.main:app", "--host", "0.0.0.0"]

Build & Run

docker build -t qwed-api .
docker run -p 8000:8000 \
  -e QWED_API_KEY=... \
  -e API_KEY_SECRET=... \
  -e QWED_CORS_ORIGINS="https://app.yourcompany.com" \
  qwed-api

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: qwed-api
spec:
  replicas: 3
  selector:
    matchLabels:
      app: qwed-api
  template:
    metadata:
      labels:
        app: qwed-api
    spec:
      containers:
      - name: qwed
        image: qwed/qwed-api:latest
        ports:
        - containerPort: 8000
        env:
        - name: QWED_API_KEY
          valueFrom:
            secretKeyRef:
              name: qwed-secrets
              key: api-key
🏢 Enterprise Support Coming Soon: Managed hosting, dedicated support, and SLA guarantees. Contact support@qwedai.com

Scaling

Horizontal Scaling

  • Stateless API servers behind load balancer
  • Redis for distributed rate limiting
  • PostgreSQL with read replicas

Performance Tuning

# Increase workers
uvicorn qwed_new.api.main:app --workers 4

# Enable connection pooling
export QWED_DB_POOL_SIZE=20

Monitoring

Health Check

curl http://localhost:8000/health

Prometheus Metrics

qwed_verification_total{engine="math", status="verified"}
qwed_verification_latency_seconds
qwed_cache_hit_rate

Security

  1. Always use HTTPS in production
  2. Set API_KEY_SECRET — mandatory, no default value
  3. Set QWED_CORS_ORIGINS — mandatory, explicitly list allowed origins
  4. Set strong API keys
  5. Enable rate limiting
  6. Use network isolation
  7. Rotate secrets regularly