This module provides integration between Drupal AI and RedHat's LLM-d distributed inference framework.
LLM-d (Large Language Model daemon) is a distributed inference framework that allows you to run multiple LLM models across different containers and route requests efficiently. This provider enables Drupal sites to leverage LLM-d's orchestration capabilities.
- Distributed Model Support: Connect to multiple LLM models through a single orchestrator
- OpenAI-Compatible API: Uses standard OpenAI API format for compatibility
- Embeddings Support: Generate text embeddings for vector database integration
- Vector Database Integration: Compatible with Milvus and PostgreSQL vector databases
- Health Monitoring: Connection testing and health check capabilities
- Debug Support: Comprehensive logging for troubleshooting
- Drupal 10.2+ or 11+
- AI module
- Key module
- Running LLM-d orchestrator instance
- For vector database integration:
- ai_vdb_provider_milvus (for Milvus integration)
- ai_vdb_provider_postgres (for PostgreSQL vector integration)
- Place this module in your
modules/contrib
directory - Enable the module:
drush en ai_provider_llmd
- Configure your LLM-d settings at
/admin/config/ai/providers/llmd
- Host URL: The base URL of your LLM-d orchestrator (e.g.,
http://localhost:8000
) - API Key: Create a key in the Key module containing your LLM-d API key
- Timeout: Request timeout in seconds (default: 30)
- Debug: Enable detailed logging for troubleshooting
- Go to
/admin/config/system/keys
- Create a new key with your LLM-d API key
- Select this key in the LLM-d provider configuration
Currently supports:
- Chat Completions: Conversational AI with message history
- Embeddings: Text-to-vector conversion for semantic search and similarity matching
Once configured, LLM-d models will be available in the AI module's model selection for chat operations.
For semantic search and vector similarity operations:
- Configure Embeddings: Select an LLM-d embedding model in your AI configuration
- Set Up Vector Database: Install and configure either:
ai_vdb_provider_milvus
for Milvus integrationai_vdb_provider_postgres
for PostgreSQL with pgvector
- Vector Dimensions: Ensure your vector database collection dimensions match your embedding model:
text-embedding-ada-002
,text-embedding-3-small
: 1536 dimensionstext-embedding-3-large
: 3072 dimensionsall-MiniLM-L6-v2
: 384 dimensionsall-mpnet-base-v2
: 768 dimensions
This provider connects to an LLM-d orchestrator that provides:
- Model Registry: Dynamic discovery of available chat and embedding models
- Load Balancing: Intelligent routing across model instances
- Security: Rate limiting, input validation, and audit logging
- Monitoring: Health checks and performance metrics
Your LLM-d orchestrator must implement these OpenAI-compatible endpoints:
/v1/models
- List available models/v1/chat/completions
- Chat completions/v1/embeddings
- Text embeddings (for vector database support)/health
- Health check
- Connection Issues: Use the "Test Connection" button in settings
- No Models: Ensure your LLM-d orchestrator is running and accessible
- API Errors: Enable debug mode for detailed error logging
- Authentication: Verify your API key is correct and has proper permissions
- Embeddings Issues:
- Ensure your LLM-d orchestrator implements
/v1/embeddings
endpoint - Verify embedding model dimensions match your vector database configuration
- Check that embedding models are properly loaded in your orchestrator
- Ensure your LLM-d orchestrator implements
- Vector Database Issues:
- Verify vector database provider modules are installed and configured
- Ensure collection dimensions match embedding model output dimensions
- Check vector database connectivity and permissions
This module follows Drupal coding standards and integrates with the AI module's plugin system.
LlmdClient
: HTTP client for LLM-d API communication (chat, embeddings, models)LlmdAiProvider
: Main AI provider plugin implementing ChatInterface and EmbeddingsInterfaceLlmdConfigForm
: Configuration form for admin settings
This project is licensed under the GPL-2.0+ license.