01 / Project · Python · Ollama · TUI

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.

Python 3.9+ Ollama Textual TUI Cloud API Agent Mode Memory System
AIHub TUI interface
At a glance
104+
Models in registry
7
Agentic tools
v0.3.13
Latest release
Cloud + local
Model backends
Overview

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.

Problem & approach

Four gaps in the local-AI workflow.

PROBLEM 01

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.

PROBLEM 02

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.

PROBLEM 03

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.

PROBLEM 04

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.

Architecture

How a request flows through the system.

// request lifecycle
  ┌──────────────┐     ┌─────────────────┐      ┌──────────────┐
    CLI prompt   ──▶   Hardware probe  ───▶  Memory load 
  └──────────────┘     └─────────────────┘      └──────┬───────┘
                                                       ┌──────────────┐     ┌─────────────────┐      ┌──────────────┐
     Response    ◀──  Tool dispatch   ◀───    Ollama    
     streaming         fs · sh · web           /chat      
  └──────────────┘     └─────────────────┘      └──────────────┘
                              ┌─────────────────┐
                       Memory write     // markdown
                     └─────────────────┘
Features

What's actually in the box.

01

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.

02

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.

03

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.

04

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.

05

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.

06

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.

Tool surface

The seven tools the model can call.

ToolPurposeScope
run_terminalExecute a shell command with safety warningscwd-scoped
read_fileRead a file as UTF-8 textworkspace
write_fileCreate or overwrite a fileworkspace
edit_fileApply targeted edits to an existing fileworkspace
list_filesList entries in a directoryworkspace
search_webRun a query against DuckDuckGo (no API key)outbound
search_filesGlob and grep search across directoriesworkspace
Tech stack

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.