fact check demo on youtube

This project is not covered by Drupal’s security advisory policy.

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_model entities. 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 and ai_search out of the box.
  • Extensible Plugin API: Build custom backends using AiServerBackend plugins without modifying the multi-server UI or routing engine.

Video Demo

Drupal AI Factchecker — Claim-Level Fact-Checking on AMD (ROCm + vLLM)

Watch: Drupal AI Factchecker — Claim-Level Fact-Checking on AMD (ROCm + vLLM) (2 min)


Supported Backends (14)

Backend Plugin Primary Target Features & Metadata
openai_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 virtual route.* 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.
    Bias ratings are not shipped: import a ratings file you are licensed to use, or fetch them live from the MBFC API with your own key.
  • 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.
  • Terms & Privacy Analyzer (experimental): reads terms of service or a privacy policy, pasted or by URL, and returns findings in 19 categories, each quoting the clause it comes from. Measured on Spanish documents only so far.

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.5 (the Decision submodule needs 1.6+)
  • Patches Required: None

Quick Start

# Install via Composer (beta releases)
composer require 'drupal/ai_provider_universal:^1.0@RC'

# 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
Supporting organizations: 

Project information

Releases