Skip to content

AI

v0.28.0

AI endpoints, prompt templates, completions and usage tracking

Install AI

Endpoint management, prompt templates, completions and usage tracking for three OpenAI-compatible providers: OpenRouter, Mistral and DeepSeek. API keys come from PhoenixKit Integrations, and every call is logged with tokens, cost in US dollars, latency and caller context. Other modules declare AI tasks against it and call it for chat, embeddings, speech and image work.

Use it when

  • Your app calls an LLM and you want endpoints, prompts and costs managed from the admin
  • You need spend caps and a log of every AI request per user or endpoint

What it gives you

  • Endpoints combining provider credentials, model and generation parameters (OpenRouter, Mistral, DeepSeek)
  • Prompt templates with {{Variable}} substitution and live preview
  • ask/3, complete/3 and embed/3; speak/3 and transcribe/3 for speech
  • Usage log with tokens, cost, latency and status; spend caps and a request cache
  • Admin pages: Endpoints, Prompts, Playground, Usage, Tasks under /admin/ai
  • Reasoning output from reasoning models stored in request metadata

Example

From the README
{:ok, response} = PhoenixKitAI.ask(endpoint.uuid, "What is 2+2?")
{:ok, text} = PhoenixKitAI.extract_content(response)

AI news

Nothing posted about AI yet. Read its changelog or see all PhoenixKit news.

Install

1 Add to mix.exs

deps
{:phoenix_kit_ai, "~> 0.28"}

2 Fetch it and run its migrations

Terminal
$ mix deps.get && mix phoenix_kit.update

3 Switch it on in /admin/modules

Package
phoenix_kit_ai
Releases
  1. 0.28.0
  2. 0.27.0
  3. 0.26.1
Admin
/admin/ai

Related modules

What it needs, what builds on it, and its neighbours in AI.