Archigov · docs
  1. Docs
  2. Guides

Configure AI Providers

Connect OpenAI, Anthropic Claude, Mistral, Ollama or any OpenAI-compatible endpoint, and enable each AI feature separately with its own provider and model.

Everything on this page is optional. With no provider configured, every feature uses its deterministic path. See AI in Archigov for what each feature does and the boundary it keeps.

#1. Add a Provider

As the platform admin, open Settings → AI. Each provider has a card:

Settings, AI tab with provider cards
Settings → AI: a card per provider. Keys are encrypted at rest and never shown again.
ProviderAPIKeyDefault base URL
OpenAIChat CompletionsRequiredhttps://api.openai.com/v1
Claude (Anthropic)Messages APIRequiredhttps://api.anthropic.com
MistralChat CompletionsRequiredhttps://api.mistral.ai/v1
OllamaChat CompletionsNot neededhttp://localhost:11434/v1

Change the base URL to use Azure OpenAI, an AI gateway, or another OpenAI-compatible endpoint. Enter a key and choose Test with a model name: Archigov sends one short request and reports success or the provider's error (never the key).

Env
AI_MISTRAL_API_KEY=<key>
# or, with Docker or Kubernetes secrets:
AI_ANTHROPIC_API_KEY_FILE=/run/secrets/anthropic_key

An environment key beats a stored key; the card shows Key From Environment and the field is disabled. Variables exist for OPENAI, ANTHROPIC, MISTRAL and OLLAMA.

#Keys Stored in Settings

Stored keys are encrypted with AES-256-GCM. The master key is ARCHIGOV_SECRET_KEY if set, otherwise a generated file at DATA_DIR/keys/secret.key that is never included in backups or replicas. Changing the master key makes stored keys unreadable: re-enter them. Leaving the field blank keeps the stored key; saving an empty value clears it.

#2. Enable Features

The What AI Is Enabled For table lists the nine features. For each: switch it on, pick a provider, and enter a model. For example:

FeatureProviderModel
Pre-reviewOllamallama3.1:8b
Decision ReviewClaude (Anthropic)your chosen Claude model
Rule DraftingMistralmistral-small-latest
Session Notes DraftingOff—

Changes take effect immediately. GET /api/ai/features tells pages which features are on, so buttons appear, or explain why they are disabled.

#The Environment Gateway

Deployments configured before per-feature settings existed can keep using one OpenAI-compatible endpoint for every enabled feature:

Env
LLM_BASE_URL=https://gateway.example.org/v1
LLM_API_KEY=<key>
LLM_MODEL=<model>

A feature the admin explicitly switches off stays off; explicit per-feature settings win over the gateway.

#What Gets Recorded

  • AI pre-reviews are stored with origin: ai, verification: unverified, and the provider and model. Citations that do not resolve are discarded before storage.
  • Drafts (decisions, rules, references, assessment summaries, session notes, mapping suggestions) are returned to the user and stored only when a human saves them — as that human's content.
  • The decision review and the classification suggestion are never stored. A suggestion only fills the Classify form; the author saves the classification with their own reason.
  • Settings changes are audited with key material redacted; connection tests are audited as ai:test with provider and model.

#Choosing Models

  • Pre-review reads the catalogue and the application's resources: its input grows with your estate. A long-context model helps.
  • Decision Review is output-heavy (a critique and a rewrite): choose a model that writes carefully.
  • Rule Drafting, Control References and Evidence Mapping are short, structured tasks: small models do well.
  • To keep data inside your network, use Ollama or an endpoint in your own cloud tenant.