AIHub TUI
A chat-first terminal UI for running, managing, and chatting with AI models — local models through Ollama and cloud API models (Anthropic, OpenAI, Google) from the same interface. Full-screen Textual TUI with hardware-aware model selection, persistent Markdown memory, a 7-tool agent mode, and live GPU/throughput readouts.
A chat-first TUI for local and cloud AI models.
AIHub TUI is a full-screen terminal application built on Textual that unifies local and cloud AI models into a single keyboard-driven interface. It pairs fast streaming chat with hardware-aware model selection, persistent Markdown memory, a tool-calling agent, live GPU/throughput monitoring, and GGUF import from HuggingFace — all in the terminal.
Unlike the earlier CLI version, the TUI rebuild introduces a reference UI with a sidebar, vim-style footer, live status bars (tok/s colour-coded green/red, context fill, GPU placement), cloud API support for Anthropic, OpenAI, and Google models, agent mode with VRAM-aware context fitting, and a full settings panel with 4 tabs.
The design goal: a single interface for every model you own — local or cloud — with zero context loss, persistent memory, and agentic capabilities.
Four gaps in the local-AI workflow.
Models that don't fit your GPU
Pulling a 70B model onto a 12GB card wastes a download and silently degrades to CPU. AIHub reads VRAM, RAM, and CPU before listing what's actually runnable, and auto-fits context to free VRAM so inference stays on the GPU.
No memory between sessions
Ollama is stateless. Every chat starts cold. AIHub stores per-model and global memory as Markdown files you can read, edit, and version-control like any other notes. Auto-extraction summarises key facts from any chat.
Agent tools that need a cloud key
Most agent frameworks assume an OpenAI key and a cloud runtime. AIHub ships 7 tools (terminal, file ops, web search) that work with local Ollama models — no API key needed for tool calling.
No unified interface for local + cloud models
Switching between Ollama and Claude/GPT means different UIs, different contexts, different memory. AIHub puts them side by side in the same TUI — same chat, same memory, same agent tools.
How a request flows through the system.
┌──────────────┐ ┌─────────────────┐ ┌──────────────┐ │ CLI prompt │ ──▶ │ Hardware probe │ ───▶ │ Memory load │ └──────────────┘ └─────────────────┘ └──────┬───────┘ │ ▼ ┌──────────────┐ ┌─────────────────┐ ┌──────────────┐ │ Response │ ◀── │ Tool dispatch │ ◀─── │ Ollama │ │ streaming │ │ fs · sh · web │ │ /chat │ └──────────────┘ └─────────────────┘ └──────────────┘ │ ▼ ┌─────────────────┐ │ Memory write │ // markdown └─────────────────┘
What's actually in the box.
Full-screen Textual TUI
Keyboard-driven interface with single-key navigation (sidebar: N New Chat, A Agent, M Models, H History, E Memory, W Hardware, S Settings). Live header shows tok/s (colour-coded green/red), context fill, GPU/CPU placement, and connection status. Command palette with ⌘K access to every action.
Hardware-aware model browser
104 models in registry tagged by VRAM footprint, with live Ollama integration, hardware-aware sorting, capability badges (Tool Calling, Code, Reasoning), and category filters. Cloud API models sit side by side with local ones in the same picker.
Cloud API + local models
Anthropic (Claude Opus 4.8, Sonnet 4.6, Haiku 4.5), OpenAI (GPT-4o, GPT-4o mini, o1-mini), and Google (Gemini 2.0 Flash, 1.5 Pro/Flash) alongside local Ollama models. Streaming, memory, history, and agent mode work identically across all backends.
Agent mode with 7 tools
Plan/build sub-modes with terminal_exec, file_read, file_write, edit_file, file_list, search_web, and search_files. VRAM-aware context fitting keeps the agent on the GPU. Tool calls and their output shown inline in the chat log with placement check.
Per-model + global memory
Markdown files for per-model and global memory with AI-powered auto-extraction from conversations. Edit in any editor. Slash-commands: /memory, /memoryadd chat, /memoryadd global for instant fact extraction.
GGUF import from HuggingFace
Browse, download, and import GGUFs directly from HuggingFace into Ollama — no manual setup. Auto-detects chat templates (ChatML, Llama 3, Gemma, Mistral, Phi) from the GGUF file itself. Touchless running: pick a GGUF and it auto-imports, then opens straight into a chat.
The seven tools the model can call.
| Tool | Purpose | Scope |
|---|---|---|
| run_terminal | Execute a shell command with safety warnings | cwd-scoped |
| read_file | Read a file as UTF-8 text | workspace |
| write_file | Create or overwrite a file | workspace |
| edit_file | Apply targeted edits to an existing file | workspace |
| list_files | List entries in a directory | workspace |
| search_web | Run a query against DuckDuckGo (no API key) | outbound |
| search_files | Glob and grep search across directories | workspace |
Built with deliberately chosen dependencies.
- Python 3.9+ — async-first runtime for streaming and tool dispatch.
- Textual — full-screen TUI framework with reactive widgets, vim-style footer, sidebar, and command palette.
- Ollama — local model server; AIHub talks to its HTTP API for inference, tool calling, and GPU placement checks.
- Cloud API SDKs — anthropic, openai, google-genai for cloud model backends alongside local Ollama.
- psutil + GPUtil + rocm-smi — hardware probing for VRAM, RAM, CPU, and GPU detection (NVIDIA, AMD, Intel).
- Rich + httpx — terminal rendering and async HTTP for Ollama, cloud APIs, and web search.
- huggingface_hub — GGUF download and import from HuggingFace with Xet-aware client.
- Plain Markdown files — the entire memory system. No database, no lock-in.