Files

1 line
3.6 KiB
JSON

{"repo": "0x0pointer/seraph", "files": {"config.yaml": {"24591d365e0a8d217d001804ea358453b62bb202": {"t": 1785674471.4948444, "n": 3105, "h": "4c6808effb0965a3", "c": "# Seraph — Two-Tier LLM Guardrail Proxy\n# Documentation: https://github.com/0x0pointer/seraph\n\nlisten: \"0.0.0.0:8000\"\n\n# Default LLM backend. Override per-request with the X-Upstream-URL header.\nupstream: \"https://api.openai.com\"\n\n# LLM provider API key — injected server-side as Authorization header.\n# Set here or via UPSTREAM_API_KEY env var (env var takes priority).\nupstream_api_key: \"\"\n\n# API keys for authenticating with Seraph (leave empty for open mode)\napi_keys:\n - \"sk_seraph_abc123\"\n\nlogging:\n level: info\n audit: true\n # Set to a file path for SQLite audit storage, null for stdout JSON\n audit_file: null\n\n# ─── Tier 1: NeMo Guardrails ────────────────────────────────────────────────\n#\n# Semantic allow-list firewall. Defines approved conversational flows via\n# Colang definitions. Any input that doesn't match an allowed intent is\n# blocked immediately — no deny-list chasing required.\n\nnemo_tier:\n enabled: true\n config_dir: \"app/services/nemo_config\"\n embedding_threshold: 0.80\n model: \"qwen2.5:3b\"\n model_engine: \"openai\"\n base_url: \"http://localhost:11434/v1\" # Ollama local endpoint\n scan_input: true # NeMo classifies user input against allowed intents\n scan_output: true # NeMo classifies LLM output (adds latency on CPU)\n # api_key: \"\" # Not needed for local Ollama\n\n# ─── Tier 2: LLM-as-a-Judge (LangGraph) ─────────────────────────────────────\n#\n# Small language model evaluates requests that pass Tier 1 for deeper threats:\n# prompt injection, data exfiltration, social engineering, policy violations.\n# Configurable to run on every request or only when Tier 1 is uncertain.\n\njudge:\n enabled: true\n model: \"mistral:7b-instruct\"\n base_url: \"http://localhost:11434/v1\" # Ollama local endpoint (NeMo tier 1 uses qwen2.5:3b)\n # To use OpenAI instead: model: \"gpt-4o-mini\", base_url: null, api_key: \"sk-...\"\n temperature: 0.0\n max_tokens: 512\n risk_threshold: 0.7\n prompt_file: \"app/services/judge_prompt.txt\"\n scan_input: true # Judge evaluates user input for threats\n scan_output: true # Judge evaluates LLM output for leaks/harmful content\n run_on_every_request: true\n # When run_on_every_request is false, judge only runs when NeMo's\n # embedding score falls in this uncertain band:\n uncertainty_band_low: 0.70\n uncertainty_band_high: 0.85\n\n# ─── Scanning Profiles ─────────────────────────────────────────────────────\n#\n# Mix and match the toggles above to fit your needs:\n#\n# All 4 stages (max security):\n# nemo_tier.scan_input: true, nemo_tier.scan_output: true\n# judge.scan_input: true, judge.scan_output: true\n#\n# NeMo input + Judge both (recommended, fast):\n# nemo_tier.scan_input: true, nemo_tier.scan_output: false\n# judge.scan_input: true, judge.scan_output: true\n#\n# NeMo only (no external API calls for scanning):\n# nemo_tier.scan_input: true, nemo_tier.scan_output: true\n# judge.scan_input: false, judge.scan_output: false\n#\n# Judge only (no local model needed):\n# nemo_tier.scan_input: false, nemo_tier.scan_output: false\n# judge.scan_input: true, judge.scan_output: true\n"}}}}