Skip to main content

A pluggable agent toolkit (server + TUI + web UI)

Project description

Lattis

Lattis is a pluggable agent toolkit built on pydantic-ai: a FastAPI server with a Textual TUI and a bundled web UI. Agents are loaded as plugins, and each thread can select a different agent.

What you get

  • Server + clients: FastAPI API, Textual TUI, and a web UI (served by the same server).
  • Pluggable agents: built-ins, third-party entry points, or local module:attribute specs.
  • Per-thread agent selection: pick an agent per thread (TUI + web UI + API).
  • Persistent state: thread history in SQLite, plus a workspace directory for agents that write files/tools.

Requirements

  • uv
  • Python 3.12+ (uv can install it automatically)
  • An API key for at least one model provider (Gemini, Anthropic, OpenAI, etc.)

Quick start

uv sync
uv run lattis

Run the server (API + web UI):

uv run lattis server

Then open http://localhost:8000.

CLI

lattis                 # Run the TUI (default)
lattis tui             # Run the TUI explicitly
lattis server          # Run the API server (and web UI, if built)

lattis tui

--server <url>          Connect to a specific server URL
--local                 Force local mode (skip server auto-discovery)
--agent <id|name>       Default agent for local/in-process mode
--agents <specs>        Extra plugins (comma-separated `module:attr` specs) for local/in-process mode

By default, the TUI auto-discovers a server on http://127.0.0.1:8000 and connects if it matches the current project; otherwise it runs in local (in-process) mode.

lattis server

--host <host>           Host interface to bind (default: 127.0.0.1)
--port <port>           Port to bind (default: 8000)
--reload                Enable auto-reload
--agent <id|name>       Default agent id or name
--agents <specs>        Extra plugins (comma-separated `module:attr` specs)

Agents

Built-in agents:

  • assistant - a general-purpose default agent
  • poetry - a simple example agent

Optional plugins:

  • binsmith - a toolkit-focused developer agent; install binsmith or run uvx binsmith

Select an agent per thread

  • TUI: use /agent, /agent list, /agent set <id|number>, /agent default
  • Web UI: use the sidebar agent selector
  • API: PATCH /sessions/{session_id}/threads/{thread_id}/state with {"agent": "<id-or-name>"} (or null to reset)

Client integration

See docs/client-integration.md for the thin-client API flow (bootstrap, thread state, model options, streaming).

Add your own agent plugins

Lattis discovers agents automatically from:

  1. lattis.agents.builtins (included with Lattis)
  2. Python entry points in the group lattis.agents
  3. Extra module:attribute specs via AGENT_PLUGINS / --agents

Entry point example (pyproject.toml in your plugin package):

[project.entry-points."lattis.agents"]
my-agent = "my_package.my_agent:plugin"

Your plugin can be:

  • an AgentPlugin, or
  • a pydantic_ai.Agent, or
  • a callable that returns an Agent (optionally taking model).

For frictionless integrations, export a pydantic_ai.Agent directly:

from pydantic_ai import Agent

plugin = Agent("google-gla:gemini-3-flash-preview")

If you need metadata or hooks, use the public plugin API:

from lattis.plugins import AgentPlugin, list_known_models

Or use the helper to wrap an Agent or factory:

from pydantic_ai import Agent
from lattis.plugins import plugin_from

plugin = plugin_from(Agent("google-gla:gemini-3-flash-preview"), id="my-agent", name="My Agent")

Storage

Typical layout (per project):

.lattis/
  lattis.db
  session_id
  workspace/

Configuration

Variable Default Description
AGENT_DEFAULT assistant Default agent id/name (server + local mode)
AGENT_PLUGINS (unset) Extra plugins (module:attr, comma-separated)
LATTIS_SERVER_URL (unset) Server URL for clients that connect over HTTP
LATTIS_PROJECT_ROOT (cwd) Project root used for storage
LATTIS_DATA_DIR (derived) Override the data directory
LATTIS_DATA_DIR_NAME lattis Data directory name used when deriving LATTIS_DATA_DIR
LATTIS_WORKSPACE_DIR (derived) Override the workspace directory
LATTIS_DB_PATH (derived) Override the SQLite DB path
LATTIS_SESSION_FILE (derived) Override the session id file path
LATTIS_SESSION_ID (unset) Force a specific session id

Web UI development

The server serves the web UI from lattis/web/static when it exists.

cd frontend
npm install
npm run build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lattis-0.6.0-py3-none-any.whl (212.2 kB view details)

Uploaded Python 3

File details

Details for the file lattis-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: lattis-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 212.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lattis-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5f1e6fe30417fd33b2b69a2b858c232727b599f01212d9b062ced5eb8e74ea6
MD5 d2aa9d071e482c22c396e709ee91323c
BLAKE2b-256 4f25f3e59ebc38b91cf32f62312289544aa8bae974f90598788352b66d3acf83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page