Klangk¶
Multi-User AI Collaboration and Coding Platform
Klangk is a container orchestration system powered by Podman, which specializes in sandboxing AI tasks. It gives users isolated coding environments (aka "workspaces") using containers. Within each workspace, any task can be run, but special consideration is given to LLM-focused tasks. Coding harnesses like pi and claude are made available in each workspace.
What You Can Do¶
- Create a workspace — each workspace is an isolated coding environment
- Chat with the AI agent — execute "pi" or "claude" in the terminal, then ask it to write code, create projects, fix bugs
- Use the terminal for direct shell access to the container (bash with tab completion and colors)
- View files in the file viewer panel, drag-and-drop files or folders to upload, right-click to download, rename, or delete. Preview markdown, images, code (with syntax highlighting and editing), PDFs, video, and spreadsheets
- Chat with other workspace users in shared workspaces
- Share workspaces with other users or groups, controlling access per-permission (terminal, files, chat, etc.)
- Monitor activity in the debug panel
- Manage users and groups (admin only) — add users, create groups, manage membership
Architecture¶
Key Technologies¶
- Pi Coding Agent: Minimal terminal coding harness (pi.dev) running in interactive terminal mode with native session persistence and extension tools
- LLM Provider: Any OpenAI-compatible LLM provider (Ollama Cloud, self-hosted Ollama, etc.), configurable via env vars (
KLANGK_LLM_BASE_URL,KLANGK_LLM_MODEL,KLANGK_LLM_API_KEY). The model must support tool/function calling — Pi uses tools (bash, edit, write, read) to interact with the workspace. - Pydantic Logfire: AI observability — FastAPI auto-instrumentation via Logfire Python SDK (
LOGFIRE_TOKEN). Pi agent tracing via pi-otel-telemetry extension (OTLP export to Logfire) — requiresLOGFIRE_TOKENas a workspace env var and sourcing. /opt/klangk/otel.shin the container shell (or.bashrc) to set the standardOTEL_*env vars. - devenv: Nix-based development environment with auto-setup, conditional build tasks (
execIfModified), auto-reload disabled
Components¶
- Backend (
src/backend/): Python/FastAPI — single-port server for API, WebSocket, and frontend static files - CLI (
src/backend/klangk_backend/cli/):klangkcommand — typer-based thin client that talks to the backend over HTTP + WebSocket for terminal access to containers - Frontend (
src/frontend/): Flutter Web — chat (markdown rendering, syntax-highlighted code blocks, @mentions, message types, pagination, history recall), file viewer, debug panel, workspace presence - Containers (
src/containers/): Custom Dockerfile for Pi agent containers with Python3, Node.js, build-essential, SQLite, vim, emacs, network tools, Pi extensions (built and run via podman)