An AI router that chooses models and protects privacy
Yagami routes requests to local or cloud models based on the task and your privacy policy. Detected sensitive information stays local under the default policy. Local models can reduce cloud API costs; more demanding work and image generation can use cloud providers when allowed.
Use the included browser chat or connect your application through the OpenAI-compatible API. Yagami also governs retrieval, memory, and tool access and records content-free evidence for its decisions.
Watch the 59-second demo to see local answers, a fictional patient case kept on the machine, and cloud image generation with real models.
Try it in 60 seconds
The demo needs no API key, provider account, or Node.js runtime. When the configured Ollama model is installed it provides real local answers; otherwise Yagami opens a clearly labeled policy-only fallback.
uvx yagami demo
# or: python -m pip install yagami && yagami demo
# or: docker compose -f compose.demo.yaml up
Open http://127.0.0.1:8000. Demo mode uses the bundled
UI, disables cloud routing, and exercises policy, classification, lineage,
storage, and audit decisions. For local AI-generated answers, install Ollama,
run ollama pull llama3.2:3b-instruct-q4_K_M, and restart the demo.
Continue with the no-data security tour or run the three flagship scenarios for secret containment, poisoned retrieval, and one-time tool approval.
Protect an application
Initialize persistent user configuration, check the host, and start Yagami:
yagami init
yagami doctor
yagami serve
Then change one OpenAI client setting:
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:8000/v1",
api_key="local-development-key",
)
response = client.chat.completions.create(
model="yagami-auto",
messages=[{"role": "user", "content": "Summarize this document."}],
metadata={"sensitivity": "none", "purpose": "internal-documentation"},
)
print(response.choices[0].message.content)
For headless or remote deployments, configure a scoped API key and follow the deployment guide. For sensitive workflows, callers should declare sensitivity rather than relying only on detection.
Copy-ready examples are available for the OpenAI SDK, OpenAI Agents, PydanticAI, CrewAI, AutoGen, Semantic Kernel, LiteLLM, LangGraph, and Foundry Local in the examples directory.
The core guarantee
Once context is labeled phi, phi_medical, or secret, the default policy
forces it to a local backend. The same request receives a policy passport with
the policy version/hash, matched rules, lineage summary, transformations,
approval evidence, and output inspection—without copying raw prompt content
into the audit record.
Warning
Yagami is an enforcement component, not a compliance certification. Detection can miss sensitive data. Use caller-declared sensitivity, local-only profiles, and organization-specific tests for strict workloads.