This module allows Drupal to connect to multiple AI services, including local models and hosted APIs, under a single provider. It enables intelligent routing of requests to the most cost-effective or suitable AI model, with optional features for fact-checking and content verification.
Universal AI Provider is a multi-instance provider for the Drupal AI ecosystem. It lets you mix local LLM engines (llama.cpp, Ollama, vLLM), commercial cloud APIs (OpenRouter, Groq, Fireworks, Hugging Face, xAI/Grok, Anthropic, DeepSeek, amazee.ai, LiteLLM) and decision models (TypeSafe Jev, self-hosted Laya, OpenAI gpt-6-luna) under one configuration.
It brings cost-aware model routing with failover, claim-level fact-checking, AI & plagiarism detection, and EU AI Act (Art. 50) compliance tools into Drupal without core patches.
Key Features
- Multi-Server & Multi-Key Architecture: Run multiple local and cloud server instances concurrently. Each server entity manages its own API keys, timeouts, model filters, and daily budget/rate limits.
- Models as Configuration: Discovered models are stored as exportable
ai_universal_modelentities. Configure cost rates, quality tiers, context limits, sampling parameters, and capability tags per model. - Decision models: Typed questions (yes/no probability, choice, score) answered with calibrated probabilities instead of generated text — TypeSafe Jev, self-hosted Laya, or OpenAI's gpt-6-luna. Reachable as chat and text classification on any AI version, and as AI core's Decision operation on AI 1.6+.
- Failover: A server that is unreachable, rate-limited or out of quota is marked down and skipped; the failed call is retried on the route's next candidate. A route can put a local model first and a hosted one as fallback, so data leaves the site only when the local model is down.
- Standard-Compliant Naming: Uses dot-separated entity IDs (
server.model) for compatibility with Drupal AI core andai_searchout of the box. - Extensible Plugin API: Build custom backends using
AiServerBackendplugins without modifying the multi-server UI or routing engine.
Video Demo
Watch: Drupal AI Factchecker — Claim-Level Fact-Checking on AMD (ROCm + vLLM) (2 min)
Supported Backends (14)
Backend Plugin Primary Target Features & Metadataopenai_compatible
llama.cpp, vLLM, LM Studio, any OpenAI-protocol server
Custom base URLs; context detected from the server, cost set manually.
ollama
Local Ollama instances
Auto-enriches model metadata via /api/show; zero-cost routing defaults.
ollama_cloud
ollama.com
Cloud catalog integration with manual routing metadata.
openrouter
OpenRouter API
Live model catalog with pricing and context length.
groq
GroqCloud
Live pricing, context and supported features (tools, JSON, structured output, reasoning).
fireworks
Fireworks AI
Serverless catalog with a maintained price table.
huggingface
Hugging Face Inference Providers
Cheapest live provider offer per model.
grok
xAI (Grok)
Grok API integration.
amazee
amazee.ai
Managed, region-pinned LiteLLM.
litellm
LiteLLM Proxy
Prices and context from the proxy's model info.
anthropic
Anthropic Claude
Native Messages API (not the OpenAI protocol).
deepseek
DeepSeek
Peak / off-peak pricing applied by smart routing in real time.
typesafe
TypeSafe Jev, self-hosted Laya
Native System One API: typed decisions with calibrated confidence.
openai_decisions
OpenAI gpt-6-luna
OpenAI Decisions API, translated to the same questions and answers as typesafe.
Submodules
- Smart Router (
ai_provider_universal_router): Defines virtualroute.*models that send each request to the cheapest capable model, with failover when a server is down or over its limits. Routing compares real cost, including time-of-day pricing — a DeepSeek model can win a route off-peak and lose it at peak, automatically. - Fact Check, Plagiarism & Content Review (
ai_provider_universal_factcheck): Claim verification against your own indexed content or web evidence, AI writing detection, verbatim plagiarism search, scheduled node scans, and bias flags. Decision models can be the checker. - Content Governance (
ai_provider_universal_governance): Assists with EU AI Act (Art. 50) obligations by attaching guardrails, generating AI provenance metadata, and adding machine/human-readable content disclosures. - Decision (
ai_provider_universal_decision, experimental): Implements AI core's Decision operation (AI 1.6+), so AI core's guardrails, automators and the Decision explorer reach Jev, Laya and Luna, with route failover between them.
ECA & Automation Integration
All submodules integrate with the ECA (Event-Condition-Action) ecosystem out of the box:
- Trigger automated workflows when a fact-check scan flags unverified claims.
- Block or flag publishing workflows if plagiarism or AI-content thresholds are exceeded.
- Attach provenance and disclosure metadata automatically upon node save.
Requirements & Compatibility
- Drupal: ^11.1 || ^12
- PHP: ^8.3
- Drupal AI Core: ^1.3 (the Decision submodule needs 1.6+)
- Patches Required: None
Quick Start
# Install via Composer (beta releases) composer require 'drupal/ai_provider_universal:^1.0@beta' # Enable the module and the submodules you need drush en ai_provider_universal ai_provider_universal_router ai_provider_universal_factcheck ai_provider_universal_governance # Run database updates when upgrading drush updb
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the AI ecosystem
Most installed first
Activity
Release Timeline
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.0-beta4 | Pre-release | 11 | Oct 7, 2026 | |
| 1.0.0-beta3 | Pre-release | 11 | Aug 26, 2026 | |
| 1.0.0-beta2 | Pre-release | 11 | Jul 15, 2026 | |
| 1.0.0-beta1 | Pre-release | 11 | Jul 10, 2026 | |
| 1.0.0-alpha1 | Pre-release | 10–11 | Jul 5, 2026 | |
| 1.0.x-dev | Dev | 11 | Jul 2, 2026 |