Note: This repository contains an AI service package for DreamFactory. If you want the full DreamFactory platform, visit the main DreamFactory repository.
DreamFactory is a secure, self-hosted enterprise data access platform that provides governed API access to any data source, connecting enterprise applications and on-prem LLMs with role-based access and identity passthrough.
DreamFactory AI (df-ai) is a service connection package that provides unified REST API access to LLM providers. It adds the ai_connection service type to DreamFactory, allowing administrators to configure AI providers and expose them as governed API endpoints with role-based access control.
| Provider | Completion | Chat | Models | Embeddings |
|---|---|---|---|---|
| Anthropic (Claude) | x | x | x | |
| OpenAI (GPT) | x | x | x | x |
| xAI (Grok) | x | x | x | x |
| Ollama (local) | x | x | x | x |
| OpenAI-Compatible | x | x | x | x |
Each AI Connection service exposes the following REST resources:
POST /{service}/completion- Single-turn text completionPOST /{service}/chat- Multi-turn conversationPOST /{service}/embeddings- Vector embeddingsGET /{service}/models- List available modelsGET /{service}/health- Provider health checkGET /{service}/usage- Usage statistics and token counts
- Encrypted API key storage with masked display in admin UI
- Per-service configuration (model, temperature, max tokens, system prompt)
- Automatic base URL detection for known providers
- Usage logging with token counts and latency tracking
- Allowed model filtering per service
- OpenAPI/Swagger documentation for all endpoints
- PHP 8.3+
- DreamFactory 7.x+ with
df-core
Add the package to your DreamFactory composer.json:
"require": {
"dreamfactory/df-ai": "~1.0"
}Run composer update and the service provider will be auto-discovered via Laravel's package discovery.
Create a new service in the DreamFactory admin panel:
- Go to Services > Create
- Select AI Connection from the service type list
- Choose a provider, enter your API key, and configure defaults
- Save and use the service API endpoints
DreamFactory AI is open-sourced software available for use under the Apache Version 2.0 license.