LatentKit

Drupal

Connect Drupal AI features to your LatentKit route.

LatentKit AI Provider connects Drupal AI to the route assigned to your LatentKit app. Drupal sees one logical latentkit-route model while LatentKit selects the live provider and model, applies fallback, and records usage.

The LatentKit AI Provider Drupal.org project and its 1.0.x review branch are public, but there is no installable release or Extend search result yet. The security-advisory coverage application is still under review. Use the branch only for compatibility testing.

What the module provides

  • A LatentKit chat provider for Drupal AI
  • Server-side credentials through Drupal Key or an environment variable
  • Connection, credit, route, and ordered-model status
  • The provider and model that handled the latest request
  • Safe request-ID logging for troubleshooting
  • Drupal Help links for setup and documentation

The module supplies a provider to existing Drupal AI features. It does not add a separate editor or chatbot.

Requirements

  • PHP 8.1 or later
  • Drupal 10.5 or Drupal 11.2 or later
  • Drupal AI 1.4.x
  • Drupal Key 1.22 or later
  • LatentKit PHP SDK 0.1.0-beta.3

Drupal AI 2.x is not a compatibility target for this alpha.

Install the review branch

Clone the public Drupal.org review branch into a test Drupal project:

git clone --depth 1 --branch 1.0.x \
  https://git.drupalcode.org/project/latentkit_ai.git \
  web/modules/contrib/latentkit_ai

From the Drupal project root, install the required packages and enable the module:

composer require drupal/ai:^1.4 drupal/key:^1.22 latentkit/latentkit-php:^0.1.0-beta.3@beta
drush en latentkit_ai -y
drush cr

Connect your LatentKit app

  1. Open Configuration → System → Keys and create a key containing your LatentKit app API key.
  2. Open Configuration → AI → AI Infrastructure → AI Platform Providers → LatentKit.
  3. Select the Drupal Key and save.
  4. Choose LatentKit → LatentKit assigned route when a Drupal AI feature asks for a chat provider and model.

For server-managed secrets, set LATENTKIT_API_KEY in the Drupal runtime environment instead of exporting the raw secret in Drupal configuration. Self-hosted gateways use the server-owned LATENTKIT_BASE_URL environment variable. The provider settings page cannot redirect a selected Drupal Key to a different service.

Verify the connection

The LatentKit provider settings page shows the connected workspace and app, remaining credits, assigned route, ordered route models, and latest winning provider/model.

The latest model is activity from the most recent request, not a permanently selected model. Use Change route in LatentKit to edit routing in the LatentKit console; the Drupal API key cannot change routing.

Use it with Drupal AI

Select LatentKit as the chat provider in compatible Drupal AI features such as AI API Explorer, AI CKEditor, AI Automators, or AI Chatbot.

Version 0.1.0-alpha.1 supports non-streaming text chat. Streaming, tools, embeddings, images, audio, and video are not included in this alpha.

Data and privacy

Drupal configuration stores the Drupal Key entity reference, not the raw LatentKit secret. When a Drupal AI feature runs, the module sends the prompt and supported generation settings to LatentKit. It does not add the site URL, administrator email, or unrelated Drupal content.

Drupal logs include request status and the LatentKit request ID when available; they do not include the API key, prompt, generated text, or provider response body.

Review the privacy policy and terms before connecting a production site.

Security and Drupal.org release status

Drupal.org grants security advisory coverage to eligible full projects; it is not a claim a module can make for itself. LatentKit will not publish the first stable release until the project has completed Drupal.org's maintainer review, waiting period, and security advisory opt-in. Drupal.org does not cover alpha, beta, or release-candidate builds.

Follow the public coverage application for review status. The 1.0.x branch remains the review target until that process is complete.

Report a suspected vulnerability privately through the LatentKit contact page. Do not post secrets, prompts, generated content, or vulnerability details in a public issue.

On this page