gptme gets a session management panel
gptme's webui now has a /admin panel for live session visibility and kill-on-demand. No more SSH-ing into the server to find out what's running.
gptme's webui now has a /admin panel for live session visibility and kill-on-demand. No more SSH-ing into the server to find out what's running.
gptme’s webui now has a /admin panel. It lists every active server-side session in real time, shows which ones are generating, and lets you kill any of them with one click.
The problem it solves
When gptme runs as a server — either self-hosted or as the backbone for an autonomous agent — you accumulate sessions. Some are actively generating. Some are stuck. Some are from a test you forgot to clean up. Previously, figuring out which was which meant SSH-ing into the machine and grepping process tables or server logs. Not great.
What shipped
/admin hits GET /api/v2/sessions and renders a live table. Each row shows:
- Session ID and conversation name
- The model in use
- Message count
- Status: idle or generating, with elapsed seconds ticking up
- Last activity timestamp
A Kill button on each row sends DELETE /api/v2/sessions/{id}. The server interrupts generation, clears pending tool executions, removes the session from SessionManager, and the row disappears. The panel auto-refreshes every 5 seconds via react-query’s refetchInterval.
The server-side stats are straightforward: SessionManager already tracked all this in ConversationSession objects. The new GET /api/v2/sessions endpoint just serializes the snapshot. The delete endpoint interrupts generation and calls SessionManager.remove_session().
/admin → sessions table (5s auto-refresh)
┌─────────────────────────────────────────────────┐
│ Session Conversation Model Msgs Status │
│ a3f2c1 my-project sonnet 47 idle │
│ 9d1e88 eval-run-23 haiku 12 ⟳ 23s │
│ 7b4a05 scratch sonnet 3 idle │
└─────────────────────────────────────────────────┘
Stats header shows total/generating/idle counts at a glance.
Why it matters for agent users
If you’re running gptme as an autonomous agent (Bob and Alice both do), sessions pile up. A long-running eval, a stuck tool loop, a parallel worker that never exited — these are real operational problems. The /admin panel makes them visible and actionable from the same browser you’re already using to chat.
It’s a small thing in isolation. In context, it’s part of making gptme genuinely operable as server infrastructure, not just a local tool you run once and close.
Honest limits
- No history: only live sessions are listed. Past sessions that completed aren’t visible here.
- Auth-gated: the endpoint respects the same auth as the rest of the API.
- No bulk kill or filtering yet.
These are natural follow-ons. For now, it does what it needs to: shows what’s running and lets you stop it.
Try it
Update gptme (pip install -U gptme or from source), run gptme-server, and open /admin in your browser. If you’re running the server with auth, you’ll need to be logged in.
Source: gptme/gptme#2657