Architecture
Emperatriz is the control plane. Providers are replaceable adapters behind a narrow interface.
Executive / Workspace modes. Holds only non-secret config.
Validates input, reads secrets server-side, writes audit events.
Pure, vendor-agnostic. Enforces privacy class, budget and fallback; refuses disconnected providers.
Gateway adapters (OrcaRouter, OpenRouter), local inference adapter (Ollama), direct & custom OpenAI-compatible, mock.
Model identity is independent of the adapter serving it.
Secrets
Credentials live in server-side environment secrets. The UI stores only the variable name. The connection test reads an allow-listed variable on the server and binds known keys to their vendor host.
Durable store Planned
MVP persists demo config in browser storage. Next: PostgreSQL via Lovable Cloud for policies, agents, audit and usage, with row-level access by role.
Telemetry & audit
Every configuration change, simulation and approval decision appends an audit event. Usage records will be written by adapters after real calls.
Adapter contract
interface ProviderAdapter {
id: string
testConnection(): Promise<{ ok: boolean; message: string }>
complete(req: { model; messages; maxTokens? }): Promise<{ text; latencyMs; simulated }>
}