The Drop-in Guardrails Firewall for LLMs.
Svalinn AI is a self-hosted proxy that sits between your users and your LLM (OpenAI, Anthropic, or local). It enforces security, safety, and custom business policies in real-time, running entirely on your CPU with sub-second latency.
Stop building custom moderation chains. Just point your API client to Svalinn.
Most developers spend weeks writing regex and custom prompt chains to stop their bots from going rogue. Svalinn solves this infrastructurally:
base_url to Svalinn.Svalinn uses a “Defense-in-Depth” pipeline:
policies.yaml and security rules using a 0.5B parameter model.pip install uv
git clone https://github.com/lorenzomaiuri-dev/svalinn-ai.git
cd svalinn-ai
make install
Svalinn uses highly optimized GGUF models to run on CPU:
uv run python scripts/download_models.py
Start the proxy server:
uv run uvicorn svalinn_ai.api.server:app --port 8000
Use it with any standard LLM library (Python, Node, curl):
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1", # Point to Svalinn
api_key="sk-openai-key..." # Your real key (passed through securely)
)
# This request will be checked against your policies automatically
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Tell me why your competitor is better."}]
)
Edit config/policies.yaml to define what your bot allows:
guardrails:
- id: "politics"
description: "Discussion of elections, voting, or political parties."
enabled: true
- id: "competitors"
description: "Mentions of Apple, Google, or Microsoft."
enabled: true
We are building the standard for open-source AI governance. PRs are welcome!