PhoenixAI

Hex.pmDocs

AI integration library for Elixir inspired by laravel/ai.

PhoenixAI provides a unified API for interacting with multiple AI providers, defining tools, composing sequential pipelines, and running parallel agents — all leveraging the BEAM/OTP concurrency model.

Features

Installation

Add phoenix_ai to your list of dependencies in mix.exs:

def deps do
  [
    {:phoenix_ai, "~> 0.1.0"}
  ]
end

Quick Start

# Configure a provider
config :phoenix_ai,
  provider: :openai,
  openai: [
    api_key: System.get_env("OPENAI_API_KEY"),
    model: "gpt-4o-mini"
  ]

# Simple chat
{:ok, response} = AI.chat([
  %{role: "user", content: "Hello!"}
])

IO.puts(response.content)

Documentation

License

MIT License — see LICENSE for details.