Omni.UI.AgentLive (Omni UI v0.1.0)

Copy Markdown View Source

A batteries-included LiveView for agent chat.

Mounts a complete chat interface with a sessions drawer, files panel, and the built-in tools (Files, REPL, WebFetch, WebSearch) wired up via Omni.UI.Agent. Drop it into your router for a working agent UI with minimal setup:

# router.ex
forward "/omni_files", Omni.UI.Files.Plug
live "/", Omni.UI.AgentLive

The files Plug must be mounted so the files panel can serve agent-generated files (HTML documents and code artifacts). See Omni.UI.Files.Plug for token signing and configuration details.

Configuration

Configure via config :omni_ui, Omni.UI.AgentLive:

  • :providers — list of provider atoms. Calls Omni.list_models/1 for each at mount time, silently skipping any that fail. The combined list populates the model selector. Defaults to [].

  • :default_model{provider, model_id} tuple for the model the agent starts with. If omitted, falls back to the first model returned by the configured providers. If set but not found in the provider models, logs a warning and falls back to the first available model.

At least one of :default_model or a non-empty :providers list is required.

Multi-provider setup

config :omni_ui, Omni.UI.AgentLive,
  providers: [:anthropic, :ollama],
  default_model: {:anthropic, "claude-sonnet-4-6"}

Fixed model (no selector)

Configure only :default_model with no :providers to lock the model and hide the selector:

config :omni_ui, Omni.UI.AgentLive,
  default_model: {:anthropic, "claude-sonnet-4-6"}

For more control over layout, tools, or event handling, skip this module and use Omni.UI in your own LiveView instead.

Summary

Functions

render(assigns)

Attributes