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 an enterprise-grade multi-instance provider for the Drupal AI ecosystem. It allows you to seamlessly mix local LLM engines (llama.cpp, Ollama, vLLM) and commercial cloud APIs (OpenRouter, Groq, Fireworks, Hugging Face, xAI/Grok, amazee.ai, LiteLLM) under a unified configuration framework.
It brings cost-aware model routing, claim-level fact-checking, AI & plagiarism detection, and EU AI Act (Art. 50) compliance tools directly into Drupal without requiring 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. - Standard-Compliant Naming: Uses dot-separated entity IDs (
server.model) for 100% 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 (10)
Backend Plugin Primary Target Features & Metadataopenai_compatible
llama.cpp, vLLM, LM Studio, OpenAI REST API
Custom base URLs, manual cost/context configuration.
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
Dynamic model catalog, automatic pricing sync, and fallback routing.
groq
Groq Cloud LPU
High-speed inference, context/token rate limit tracking.
fireworks
Fireworks AI
Serverless LLM deployment catalog integration.
huggingface
Hugging Face Dedicated Endpoints / TGI
Custom model endpoint support.
grok_xai
xAI (Grok)
Native Grok API integration.
amazee_ai
amazee.ai
Enterprise-hosted AI backend support.
litellm
LiteLLM Proxy
Unified proxy routing across 100+ LLMs.
Submodules
- Smart Router (
ai_universal_router): Defines virtualAuto: ...models that route requests dynamically to the cheapest capable model, featuring automated failover on rate/budget limits. - Fact Check, Plagiarism & Content Review (
ai_universal_factcheck): Conducts claim verification against local indexed corpus or web evidence, AI writing detection, verbatim plagiarism search, scheduled node scans, and coverage report flags for bias detection. - Content Governance (
ai_universal_governance): Assists with EU AI Act (Art. 50) obligations by attaching guardrails, generating AI provenance metadata, and adding machine/human-readable content disclosures.
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
- Patches Required: None
Quick Start
# Install via Composer composer require drupal/ai_provider_universal # Enable module and submodules drush en ai_provider_universal ai_universal_router ai_universal_factcheck ai_universal_governance # Run database updates (if upgrading from 1.0.0-beta1) drush updb