Skip to main content
Version: 1.0.0-beta

AI Models Configuration

AIIA is built with a multi-provider AI routing layer. Administrators can configure, test, and manage local (on-premise) and cloud-based LLM and embedding providers directly from the Admin → AI Models interface.


Supported AI Providers

AIIA supports both local and cloud AI providers to accommodate strict regulatory requirements, air-gapped deployments, or high-performance cloud processing:

ProviderTypeTypical ModelsAuthenticationBest For
OllamaLocal / On-Premisellama3, mistral, qwen2.5NoneSovereign, air-gapped deployments
GeminiCloudgemini-1.5-pro, gemini-1.5-flashAPI KeyDeep analysis, multilingual (Arabic) processing
OpenAICloudgpt-4o, gpt-4o-miniAPI KeyComplex reasoning, structured output drafting
AnthropicCloudclaude-3-5-sonnetAPI KeyLong-context audit report auditing & synthesis
DeepSeekCloud / Localdeepseek-chat, deepseek-coderAPI KeyCost-effective reasoning and extraction tasks
CustomLocal / PrivateOpen-Weights modelsCustom HeaderDedicated client-hosted model endpoints

Configuration Fields

When configuring an AI Model in the Admin → AI Models UI, the following parameters are required:

FieldDescriptionExample
Model NameA descriptive label for the model instance.Production Reasoning LLM
ProviderThe target API provider engine.gemini, ollama, openai, anthropic
Model IDThe exact identifier matching the provider registry.gemini-1.5-pro or llama3:8b
API URLThe base connection endpoint for the model API.https://generativelanguage.googleapis.com
API KeyThe authorization credentials key (masked & encrypted).•••••abcd
Model TypeThe model's target function.llm (text generation), reasoning, embedding
System PromptGlobal system instructions prepended to all queries.You are the AIIA audit assistant...

Key Encryption & Security

To prevent key leakage and ensure compliance with Saudi enterprise standards:

  • Encryption at Rest: All provider API keys are encrypted at rest in the database using AES-256-GCM via the server's SECRET_ENCRYPTION_KEY environment variable.
  • Key Masking: Under no circumstances is the full API key ever returned to the client browser. In all listing and configuration forms, keys are masked as •••••{last4} showing only the last 4 characters.
  • No Code Changes: Switching model providers is entirely dynamic. Once an administrator configures a provider in the UI, all AI-assisted features (like finding drafts, RAG search, and evidence summarization) automatically route queries through the new model configuration.

Establishing an AI Provider

Follow this workflow to configure a new AI provider:

  1. Navigate to Admin → AI Models in the dashboard.
  2. Click Add AI Model.
  3. Select your provider (e.g., Gemini or Ollama) and enter the exact model ID.
  4. Input the connection endpoint URL.
    • For cloud providers, this is the official API endpoint.
    • For on-premise deployments, this is the local Ollama instance (e.g., http://ollama:11434).
  5. Input the API Key. For Ollama/local deployments, this field can be left blank.
  6. Click Test Connection. The backend will immediately dispatch a lightweight test prompt to verify connectivity.
  7. Once the connection validates successfully, click Save Config to enable the model.