Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: make runtime configuration selectable from the operations roster (#7795)

[._.]/ Adam Eivy1712429dc7d2
diff --git a/client/src/App.jsx b/client/src/App.jsx
index c890c9f0e5..3f9a91ad95 100644
--- a/client/src/App.jsx
+++ b/client/src/App.jsx
@@ -402,6 +402,7 @@ export default function App() {
{/* Performance owns task views rather than making one long page. The
selected result route is more specific so a slash-containing model
id stays inside the reversible assessment key segment. */}
+ <Route path="models/llms-runtimes/:recordId?" element={<Models fixedTab="llms-runtimes" />} />
<Route path="models/performance/results/:assessmentKey" element={<Models fixedTab="performance" />} />
<Route path="models/performance/:view" element={<Models fixedTab="performance" />} />
{/* A tab's drill-down (today: the LoRA dataset workbench) renders through
diff --git a/client/src/components/settings/LocalLlmRuntimesView.jsx b/client/src/components/settings/LocalLlmRuntimesView.jsx
index 5961ee64ce..500d919471 100644
--- a/client/src/components/settings/LocalLlmRuntimesView.jsx
+++ b/client/src/components/settings/LocalLlmRuntimesView.jsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef, useCallback } from 'react';
-import { Link } from 'react-router';
+import { Link, useLocation, useNavigate } from 'react-router';
import { Download, RefreshCw, ExternalLink, Link2, Copy, Power, PowerOff, Zap, ChevronDown, ChevronUp, Terminal, } from 'lucide-react';
import toast from '../ui/Toast';
import FormField from '../ui/FormField';
@@ -73,7 +73,22 @@ function summarizeMigrate(r) {
// Install, start, stop and configure the local servers that run language models.
// Its own Models tab since #7414 (`/models/llms-runtimes`), so every socket
// subscription and poll below belongs to a page the user is actually looking at.
-export default function LocalLlmRuntimesView() {
+export default function LocalLlmRuntimesView({ view } = {}) {
+ const navigate = useNavigate();
+ const { search } = useLocation();
+ const runtimeIds = ['ollama', 'lmstudio', 'llama', 'mtplx', 'slotstream', 'fleet-host'];
+ const selectedRuntime = runtimeIds.includes(view) ? view : null;
+ const selectRuntime = (id) => navigate(`/models/llms-runtimes${id ? '/' + id : ''}${search}`);
+ const detailHeading = useRef(null);
+ const rosterRef = useRef(null);
+ const previousRuntime = useRef(null);
+ useEffect(() => {
+ if (view) detailHeading.current?.focus();
+ else if (previousRuntime.current) {
+ rosterRef.current?.querySelector(`[data-runtime-id="${previousRuntime.current}"] button[aria-pressed]`)?.focus();
+ }
+ previousRuntime.current = selectedRuntime;
+ }, [view, selectedRuntime]);
const [llamaStatus, setLlamaStatus] = useState(null);
const [mtplxStatus, setMtplxStatus] = useState(null);
const [slotstreamStatus, setSlotstreamStatus] = useState(null);
@@ -89,11 +104,6 @@ export default function LocalLlmRuntimesView() {
const [slotstreamDownload, setSlotstreamDownload] = useState(null);
const { confirm: downloadConfirm, request: requestWeightDownload, cancel: cancelDownloadConfirm, confirmRun: runDownloadConfirm } = useDownloadPreflightConfirm();
const [llamaLoading, setLlamaLoading] = useState(false);
- // Anchor for the unified server card's "Configure" action — llama-server needs
- // a model path, so its Start lives in the launcher rather than in that row.
- const llamaSectionRef = useRef(null);
- const mtplxSectionRef = useRef(null);
- const slotstreamSectionRef = useRef(null);
const [llamaPresetId, setLlamaPresetId] = useState(DEFAULT_SPEC_PRESET_ID);
const [llamaForm, setLlamaForm] = useState({
model: '',
@@ -474,7 +484,6 @@ export default function LocalLlmRuntimesView() {
() => saveRuntimeStartupList(),
'Saved — the PM2 processes running now will come back after a reboot'
).then(() => { loadLlamaStatus(); loadMtplxStatus(); loadSlotstreamStatus(); });
- const scrollTo = (ref) => ref.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
// Hand-editing a path the preset supplied means the form no longer describes
// that preset — say Custom rather than keep claiming the preset is in effect.
const setLlamaField = (field, value) => {
@@ -723,7 +732,20 @@ export default function LocalLlmRuntimesView() {
because the section header already shows "Models → Runtimes". */}
<h2 id="llm-runtimes-heading" className="sr-only">Runtimes</h2>
{/* One start/stop/install surface for every local server PortOS can run */}
+ {(progressMsg || busy || llamaLoading || mtplxDownload || slotstreamDownload || Object.keys(llamaDownloads).length > 0) && (
+ <div role="status" className="flex flex-wrap items-center gap-3 rounded-lg border border-port-accent/30 p-3 text-sm text-port-accent">
+ <BrailleSpinner />{progressMsg || 'Runtime work in progress'}
+ {(llamaLoading || Object.keys(llamaDownloads).length > 0) && <Link className="underline" to={`/models/llms-runtimes/llama${search}`}>llama.cpp progress</Link>}
+ {mtplxDownload && <Link className="underline" to={`/models/llms-runtimes/mtplx${search}`}>MTPLX progress</Link>}
+ {slotstreamDownload && <Link className="underline" to={`/models/llms-runtimes/slotstream${search}`}>Slotstream progress</Link>}
+ </div>
+ )}
+ <div className="@container">
+ <div className="grid items-start gap-4 @min-[80rem]:grid-cols-2">
+ <div ref={rosterRef} className={view ? 'hidden @min-[80rem]:block min-w-0' : 'min-w-0 @min-[80rem]:col-span-2'}>
<RuntimeServersCard
+ selectedRuntime={selectedRuntime}
+ onSelectRuntime={selectRuntime}
status={status}
llamaStatus={llamaStatus}
mtplxStatus={mtplxStatus}
@@ -738,12 +760,12 @@ export default function LocalLlmRuntimesView() {
onInstallLlama={runtimeInstallLlama}
onUpgradeLlama={runtimeUpgradeLlama}
onStopLlama={runtimeStopLlama}
- onConfigureLlama={() => scrollTo(llamaSectionRef)}
- onConfigureMtplx={() => scrollTo(mtplxSectionRef)}
+ onConfigureLlama={() => selectRuntime('llama')}
+ onConfigureMtplx={() => selectRuntime('mtplx')}
onInstallMtplx={runtimeInstallMtplx}
onStartMtplx={runtimeStartMtplx}
onStopMtplx={runtimeStopMtplx}
- onConfigureSlotstream={() => scrollTo(slotstreamSectionRef)}
+ onConfigureSlotstream={() => selectRuntime('slotstream')}
onInstallSlotstream={runtimeInstallSlotstream}
onStartSlotstream={runtimeStartSlotstream}
onStopSlotstream={runtimeStopSlotstream}
@@ -753,11 +775,19 @@ export default function LocalLlmRuntimesView() {
fleetHostStatus={fleetHostStatus}
onStopFleetHost={stopFleetHost}
/>
- <LocalPersistentMindSetupCard />
- <HardwareLlmRecommendation />
+ </div>
+ <div hidden={!view} className="min-w-0 space-y-4">
+ <div className="flex items-center justify-between gap-3">
+ <h2 ref={detailHeading} tabIndex={-1} className="text-base font-medium text-white focus:outline-none">Runtime configuration</h2>
+ <Link to={`/models/llms-runtimes${search}`} className="min-h-[44px] inline-flex items-center text-sm text-port-accent hover:underline">All runtimes</Link>
+ </div>
+ {view && !selectedRuntime && <p role="status" className="text-sm text-port-warning">Runtime not found. Return to All runtimes to select an available runtime.</p>}
+ {selectedRuntime === 'fleet-host' && <p className="text-sm text-gray-400">The dedicated host's configuration, logs and usage live in <Link to="/ai/fleet?fleetStep=host" className="text-port-accent hover:underline">Host setup &amp; usage</Link>.</p>}
+ {/* Keep the existing form owners mounted: selection never discards drafts,
+ checkpoint searches, progress subscriptions or explicit cancellation. */}
{/* Backends — model catalog, default marker, cross-backend import */}
- <div className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-4">
+ <div hidden={!BACKENDS.some((b) => b.id === selectedRuntime)} className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-4">
<div className="flex items-center justify-between">
<h2 className="text-sm font-medium text-gray-300">Local LLM Backends</h2>
<button onClick={loadStatus} disabled={loading} className="min-h-[44px] min-w-[44px] inline-flex items-center justify-center p-1.5 text-gray-400 hover:text-white transition-colors" title="Refresh" aria-label="Refresh local LLM status">
@@ -775,23 +805,18 @@ export default function LocalLlmRuntimesView() {
<BrailleSpinner text="Loading local LLM status" />
) : status ? (
<>
- <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
+ <div className="space-y-3">
{BACKENDS.map((b) => (
+ <div key={b.id} hidden={selectedRuntime !== b.id}>
<LocalLlmBackendCard
- key={b.id} backend={b} status={status} isDefault={status.backend === b.id}
+ backend={b} status={status} isDefault={status.backend === b.id}
busy={busy} actionInProgress={actionInProgress}
runAction={runAction} setConfirmAction={setConfirmAction}
/>
+ </div>
))}
</div>
- {progressMsg && (
- <div className="flex items-center gap-2 text-sm text-port-accent bg-port-accent/10 border border-port-accent/20 rounded-lg px-3 py-2">
- <BrailleSpinner />
- {progressMsg}
- </div>
- )}
-
{confirmAction && (
<div className="bg-port-bg border border-port-warning/30 rounded-lg p-4 space-y-3">
<p className="text-sm text-white">{confirmAction.label}</p>
@@ -828,7 +853,7 @@ export default function LocalLlmRuntimesView() {
</div>
{/* Slotstream — PM2-managed SSD-streaming MoE runtime (Apple Silicon) */}
- <div ref={slotstreamSectionRef}>
+ <div hidden={selectedRuntime !== 'slotstream'}>
<SlotstreamServerCard
status={slotstreamStatus}
loading={loading}
@@ -846,7 +871,7 @@ export default function LocalLlmRuntimesView() {
</div>
{/* MTPLX — PM2-managed native-MTP runtime (Apple Silicon) */}
- <div ref={mtplxSectionRef}>
+ <div hidden={selectedRuntime !== 'mtplx'}>
<MtplxServerCard
status={mtplxStatus}
loading={loading}
@@ -865,7 +890,7 @@ export default function LocalLlmRuntimesView() {
</div>
{/* Speculative Decoding & Custom Runtimes (DFlash 2 / llama.cpp) */}
- <div ref={llamaSectionRef} className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-4">
+ <div hidden={selectedRuntime !== 'llama'} className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-4">
<div className="flex items-center justify-between flex-wrap gap-2">
<div className="flex items-center gap-2">
<Zap size={16} className="text-port-accent" />
@@ -890,11 +915,16 @@ export default function LocalLlmRuntimesView() {
</div>
</div>
+ <details>
+ <summary className="min-h-[44px] content-center cursor-pointer text-xs text-gray-400">About speculative decoding and presets</summary>
<p className="text-xs text-gray-400 leading-relaxed">
Speculative decoding pairs a small drafter with your target model for 2–3× faster generation at identical output. You can launch and manage a local <code className="text-gray-300">llama-server</code> from PortOS and connect using the <strong className="text-white">OpenCode llama TUI</strong> provider. <strong className="text-white">DSpark</strong> (<code className="text-gray-300">draft-dspark</code>) works on a stock llama.cpp{llamaInstallCommand ? <> (<code className="text-gray-300">{llamaInstallCommand}</code>)</> : null}; the DFlash 2 presets need a from-source build of an unmerged llama.cpp branch. No drafter GGUF to hand? The <code className="text-gray-300">ngram-*</code> spec types under Advanced options draft from the context window alone.
</p>
+ </details>
- {llamaStatus?.running ? (
+ {!llamaStatus ? (
+ <p role="status" className="text-sm text-gray-400">llama.cpp status is unavailable. Refresh status before configuring this runtime.</p>
+ ) : llamaStatus.running ? (
<div className="bg-port-bg border border-port-success/30 rounded-lg p-3 space-y-3">
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-2">
<div className="text-xs text-gray-300 space-y-1">
@@ -1212,9 +1242,9 @@ export default function LocalLlmRuntimesView() {
{showLlamaAdvanced ? <ChevronUp size={12} /> : <ChevronDown size={12} />}
{showLlamaAdvanced ? 'Hide options' : 'Advanced options (port, ctx, GPU layers, parallel slots, model id, spec type, performance tuning)'}
</button>
- <div className="flex items-center gap-2">
+ <div className="flex flex-wrap items-center gap-2">
{llamaStartBlocked && (
- <span className="text-[11px] text-port-warning text-right">
+ <span className="text-[11px] text-port-warning">
{llamaStartBlockedReason}
</span>
)}
@@ -1273,6 +1303,16 @@ export default function LocalLlmRuntimesView() {
</div>
)}
</div>
+ </div>
+ </div>
+ </div>
+ <details className="bg-port-card border border-port-border rounded-xl p-4">
+ <summary className="cursor-pointer text-sm font-medium text-gray-300">Setup guidance and recommendations</summary>
+ <div className="mt-4 space-y-4">
+ <LocalPersistentMindSetupCard />
+ <HardwareLlmRecommendation />
+ </div>
+ </details>
<DownloadPreflightConfirm
open={Boolean(downloadConfirm)}
title={downloadConfirm?.title}
diff --git a/client/src/components/settings/LocalLlmRuntimesView.test.jsx b/client/src/components/settings/LocalLlmRuntimesView.test.jsx
index bce52f5a4c..a1e7a2887a 100644
--- a/client/src/components/settings/LocalLlmRuntimesView.test.jsx
+++ b/client/src/components/settings/LocalLlmRuntimesView.test.jsx
@@ -1,6 +1,6 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
-import { MemoryRouter, } from 'react-router';
+import { MemoryRouter, Routes, Route, useParams, useNavigate, useLocation } from 'react-router';
vi.mock('../../services/api', () => ({
getLocalLlmStatus: vi.fn(),
@@ -85,10 +85,17 @@ import {
// "hf.co/sja…" on a phone before the row was allowed to wrap.
const LONG_ID = 'hf.co/example-org/Example-Long-Model-Name-34B-Instruct-GGUF:Q6_K';
-const renderRuntimes = async () => {
+function RoutedRuntimes() {
+ const { runtimeId } = useParams();
+ const navigate = useNavigate();
+ const location = useLocation();
+ return <><button onClick={() => navigate(-1)}>History back</button><output aria-label="Current route">{location.pathname}{location.search}</output><LocalLlmRuntimesView view={runtimeId} /></>;
+}
+
+const renderRuntimes = async (runtimeId = 'llama') => {
render(
- <MemoryRouter>
- <LocalLlmRuntimesView />
+ <MemoryRouter initialEntries={[`/models/llms-runtimes${runtimeId ? '/' + runtimeId : ''}`]}>
+ <Routes><Route path="/models/llms-runtimes/:runtimeId?" element={<RoutedRuntimes />} /></Routes>
</MemoryRouter>,
);
await waitFor(() => expect(screen.getByRole('tabpanel')).toHaveAttribute('id', 'llm-runtimes-panel'));
@@ -160,6 +167,7 @@ describe('LocalLlmRuntimesView information architecture', () => {
expect(screen.getByRole('heading', { name: 'Local Runtime Servers' })).toBeInTheDocument();
expect(screen.queryByRole('heading', { name: 'Models' })).not.toBeInTheDocument();
expect(getLocalLlmCatalog).not.toHaveBeenCalled();
+ fireEvent.click(screen.getByText('Setup guidance and recommendations'));
const recommendationHeading = await screen.findByRole('heading', { name: 'Recommended coding-agent setup' });
const runtimeHeading = screen.getByRole('heading', { name: 'Local Runtime Servers' });
expect(runtimeHeading.compareDocumentPosition(recommendationHeading) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
@@ -178,6 +186,7 @@ describe('LocalLlmRuntimesView information architecture', () => {
}));
await renderRuntimes();
+ fireEvent.click(screen.getByText('Setup guidance and recommendations'));
expect((await screen.findByRole('heading', { name: 'Recommended coding-agent setup' })).closest('details')).toHaveAttribute('open');
});
@@ -191,11 +200,57 @@ describe('LocalLlmRuntimesView information architecture', () => {
});
it('links to the shared local generation controls', async () => {
- await renderRuntimes();
+ await renderRuntimes('ollama');
expect(screen.getByRole('link', { name: /temperature, top-p and thinking defaults/i }).getAttribute('href')).toBe('/ai');
});
});
+describe('runtime selection workflow', () => {
+ it('opens configuration from the roster and recovers an invalid deep link', async () => {
+ const { getLlamaServerStatus } = await import('../../services/api');
+ getLlamaServerStatus.mockResolvedValue({ installed: false, running: false });
+ await renderRuntimes('unknown-runtime');
+ expect(screen.getByText(/Runtime not found/)).toBeVisible();
+ fireEvent.click(screen.getByRole('link', { name: 'All runtimes' }));
+ expect(screen.queryByRole('heading', { name: 'Runtime configuration' })).not.toBeInTheDocument();
+ const roster = screen.getByRole('group', { name: 'llama.cpp' });
+ fireEvent.click(within(roster).getByRole('button', { name: 'Configure' }));
+ expect(screen.getByLabelText('Current route')).toHaveTextContent('/models/llms-runtimes/llama');
+ expect(screen.getByRole('heading', { name: 'Runtime configuration' })).toHaveFocus();
+ expect(screen.getByRole('button', { name: /Install llama.cpp/ })).toBeVisible();
+ });
+
+ it('retains a launch draft and download cancellation across selection and history', async () => {
+ const { getLlamaServerStatus, startLlamaServer, cancelSpecDecodeModelDownload } = await import('../../services/api');
+ getLlamaServerStatus.mockResolvedValue(llamaReady({ presets: specPresets({ baseExists: false }) }));
+ cancelSpecDecodeModelDownload.mockResolvedValue({ cancelled: true });
+ await renderRuntimes('llama');
+ const field = screen.getByRole('textbox', { name: 'Target Base Model (GGUF Path)' });
+ fireEvent.change(field, { target: { value: 'models/example-draft.gguf' } });
+ // Return to the preset so its in-flight weight is available to cancel.
+ fireEvent.change(screen.getByRole('combobox', { name: 'Preset' }), { target: { value: 'qwen3.8-27b-dspark' } });
+ fireEvent.click(screen.getByRole('button', { name: /Advanced options/ }));
+ fireEvent.change(screen.getByRole('spinbutton', { name: 'Context Size' }), { target: { value: '16384' } });
+ const handler = socket.on.mock.calls.find(([event]) => event === 'llamaServer:download')?.[1];
+ expect(handler).toBeTypeOf('function');
+ act(() => handler({ presetId: 'qwen3.8-27b-dspark', role: 'model', received: 1024, total: 4096 }));
+ const subscriptions = socket.on.mock.calls.length;
+ fireEvent.click(screen.getByRole('link', { name: 'All runtimes' }));
+ fireEvent.click(within(screen.getByRole('group', { name: 'MTPLX' })).getByRole('button', { name: 'Configure' }));
+ expect(screen.queryByRole('button', { name: /^Cancel$/ })).not.toBeInTheDocument();
+ fireEvent.click(screen.getByRole('link', { name: 'llama.cpp progress' }));
+ expect(screen.getByRole('spinbutton', { name: 'Context Size' })).toHaveValue(16384);
+ expect(screen.getByRole('button', { name: /^Cancel$/ })).toBeVisible();
+ expect(socket.on.mock.calls).toHaveLength(subscriptions);
+ expect(startLlamaServer).not.toHaveBeenCalled();
+ fireEvent.click(screen.getByRole('button', { name: 'History back' }));
+ expect(screen.getByLabelText('Current route')).toHaveTextContent('/models/llms-runtimes/mtplx');
+ fireEvent.click(screen.getByRole('link', { name: 'llama.cpp progress' }));
+ fireEvent.click(screen.getByRole('button', { name: /^Cancel$/ }));
+ await waitFor(() => expect(cancelSpecDecodeModelDownload).toHaveBeenCalled());
+ });
+});
+
describe('hardware coding-agent profiles', () => {
it('selects the benchmarked Apple profile by unified-memory tier', () => {
expect(hardwareLlmRecommendation({ platform: 'darwin', appleSilicon: true, totalMemoryGb: 48 })).toMatchObject({
@@ -252,7 +307,7 @@ describe('LocalLlmTab backend disable state', () => {
ollama: { installed: true, available: true, modelCount: 0, models: [] },
lmstudio: { installed: true, available: false, disabled: true, modelCount: 0, models: [] },
});
- await renderRuntimes();
+ await renderRuntimes('lmstudio');
fireEvent.click(screen.getByTitle('Mark LM Studio as intentionally disabled'));
await waitFor(() => expect(patchSettingsSlice).toHaveBeenCalledWith('localLlm.lmstudio', { disabled: true }));
await waitFor(() => expect(screen.getByText('Disabled')).toBeInTheDocument());
@@ -310,7 +365,7 @@ describe('LocalLlmRuntimesView runtime servers', () => {
});
pullMtplxModel.mockResolvedValue({ success: false, model: null, error: 'no space left on device' });
- await renderRuntimes();
+ await renderRuntimes('mtplx');
fireEvent.click(screen.getByRole('button', { name: /Download default checkpoint/ }));
await clickStartDownload();
@@ -325,7 +380,7 @@ describe('LocalLlmRuntimesView runtime servers', () => {
});
pullMtplxModel.mockResolvedValue({ success: true, model: null, cachedModels: ['Example/Qwen-MTP'] });
- await renderRuntimes();
+ await renderRuntimes('mtplx');
fireEvent.click(screen.getByRole('button', { name: /Download default checkpoint/ }));
await clickStartDownload();
@@ -357,7 +412,7 @@ describe('LocalLlmTab runtime context window', () => {
it('flags a runtime window below the agent floor', async () => {
withContext({ runtime: 32768, applied: null, agentMinimum: 65536 });
- await renderRuntimes();
+ await renderRuntimes('ollama');
const badge = screen.getByTitle(/below what an agent harness/);
expect(badge.textContent).toContain('32K ctx');
expect(badge.className).toMatch(/text-port-warning/);
@@ -365,14 +420,14 @@ describe('LocalLlmTab runtime context window', () => {
it('shows a generous window without the warning styling', async () => {
withContext({ runtime: 131072, applied: 131072, agentMinimum: 65536 });
- await renderRuntimes();
+ await renderRuntimes('ollama');
const badge = screen.getByTitle('Loaded models are running at 128K ctx');
expect(badge.className || '').not.toMatch(/text-port-warning/);
});
it('shows nothing while no model is resident — Ollama has not picked a window yet', async () => {
withContext({ runtime: null, applied: null, agentMinimum: 65536 });
- await renderRuntimes();
+ await renderRuntimes('ollama');
expect(screen.queryByTitle(/Loaded models are running at/)).toBeNull();
});
});
diff --git a/client/src/components/settings/RuntimeServersCard.jsx b/client/src/components/settings/RuntimeServersCard.jsx
index 767a07d4a0..f7f023e5ae 100644
--- a/client/src/components/settings/RuntimeServersCard.jsx
+++ b/client/src/components/settings/RuntimeServersCard.jsx
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
import { Link } from 'react-router';
import { Cpu, Box, Zap, Gauge, HardDrive, Play, Square, Download, ArrowUpCircle, Power, PowerOff, RefreshCw, Save, Settings2, ExternalLink, Server } from 'lucide-react';
import BrailleSpinner from '../BrailleSpinner';
+import { formatCount } from '../../utils/formatters';
/**
* One control surface for every local LLM server PortOS can run.
@@ -20,6 +21,7 @@ import BrailleSpinner from '../BrailleSpinner';
/** Uniform lifecycle state for a row, from each runtime's own status shape. */
const STATE_META = {
+ unknown: { label: 'Status unavailable', cls: 'bg-gray-500/20 text-gray-400', dot: 'bg-gray-500' },
running: { label: 'Running', cls: 'bg-port-success/20 text-port-success', dot: 'bg-port-success animate-pulse' },
external: { label: 'Running (external)', cls: 'bg-blue-500/20 text-blue-300', dot: 'bg-blue-400' },
stopped: { label: 'Stopped', cls: 'bg-port-warning/20 text-port-warning', dot: 'bg-port-warning' },
@@ -28,7 +30,7 @@ const STATE_META = {
unsupported: { label: 'Unavailable on this platform', cls: 'bg-gray-500/20 text-gray-400', dot: 'bg-gray-600' },
};
-const btnClass = 'flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded transition-colors disabled:opacity-50';
+const btnClass = 'min-h-[44px] flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded transition-colors disabled:opacity-50';
const neutralBtn = `${btnClass} bg-port-border hover:bg-port-border/70 text-white`;
const accentBtn = `${btnClass} bg-port-accent/20 hover:bg-port-accent/30 text-port-accent`;
@@ -41,7 +43,7 @@ const accentBtn = `${btnClass} bg-port-accent/20 hover:bg-port-accent/30 text-po
* distinction to draw.
*/
function backendRow({ id, label, icon, data, onStart, onStop, onInstall }) {
- const state = data?.disabled ? 'disabled' : data?.available ? 'running' : data?.installed ? 'stopped' : 'missing';
+ const state = !data ? 'unknown' : data?.disabled ? 'disabled' : data?.available ? 'running' : data?.installed ? 'stopped' : 'missing';
return {
id,
label,
@@ -49,7 +51,7 @@ function backendRow({ id, label, icon, data, onStart, onStop, onInstall }) {
state,
endpoint: data?.baseUrl || null,
detail: data?.installed && Number.isFinite(data?.modelCount)
- ? `${data.modelCount} model${data.modelCount === 1 ? '' : 's'} installed`
+ ? `${formatCount(data.modelCount)} model${data.modelCount === 1 ? '' : 's'} installed`
: null,
onInstall: !data?.installed && data?.canAutoInstall ? onInstall : null,
downloadUrl: !data?.installed && !data?.canAutoInstall ? data?.downloadUrl : null,
@@ -68,7 +70,7 @@ function backendRow({ id, label, icon, data, onStart, onStop, onInstall }) {
function pm2Row({ id, label, icon, status, platformReason, onStart, onStop, onInstall, onUpgrade, startBlockedReason, detail }) {
const external = status?.running && status?.managed === false;
const updateAvailable = !platformReason && status?.installed && status?.updateAvailable === true;
- const state = platformReason ? 'unsupported'
+ const state = !status ? 'unknown' : platformReason ? 'unsupported'
: status?.running ? (external ? 'external' : 'running')
: status?.installed ? 'stopped' : 'missing';
return {
@@ -88,6 +90,7 @@ function pm2Row({ id, label, icon, status, platformReason, onStart, onStop, onIn
onStart: !platformReason && status?.installed && !status?.running && !startBlockedReason ? onStart : null,
startBlockedReason: status?.installed && !status?.running ? startBlockedReason : null,
onStop: !external && status?.running ? onStop : null,
+ model: status?.config?.model || status?.model || null,
version: status?.version || null,
latestVersion: status?.latestVersion || null,
updateAvailable,
@@ -130,7 +133,7 @@ function fleetHostRow({ status, onStop }) {
: up && !status?.serving
? 'Container up, model still loading'
: up && status?.queue
- ? `${status.queue.active} generating · ${status.queue.queued} queued`
+ ? `${formatCount(status.queue.active)} generating · ${formatCount(status.queue.queued)} queued`
: null,
onStop: status?.stoppable ? onStop : null,
};
@@ -198,14 +201,14 @@ function IdleWindowField({ id, value, onSave, busy, note }) {
* handler that takes a launch config (MTPLX's start) would serialize the event
* into the request body instead of the config.
*/
-function ServerRow({ row, busy, actionInProgress, children }) {
+function ServerRow({ row, busy, actionInProgress, selected, children }) {
const Icon = row.icon;
const meta = STATE_META[row.state] || STATE_META.missing;
return (
- <div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 bg-port-bg border border-port-border rounded-lg px-3 py-2">
+ <div role="group" aria-label={row.label} data-runtime-id={row.id} className={`flex flex-col @min-[48rem]:grid @min-[48rem]:grid-cols-[10rem_minmax(0,1fr)_minmax(12rem,20rem)] gap-2 sm:gap-3 bg-port-bg border rounded-lg px-3 py-2 ${selected ? 'border-port-accent' : 'border-port-border'}`}>
<div className="flex items-center gap-2 min-w-0 sm:w-44 shrink-0">
<Icon size={14} className="text-port-accent shrink-0" />
- <span className="text-sm text-white truncate">{row.label}</span>
+ <span className="text-sm text-white break-words">{row.label}</span>
</div>
<div className="flex items-center gap-2 flex-wrap min-w-0 flex-1">
<span className={`px-2 py-0.5 text-xs rounded flex items-center gap-1.5 ${meta.cls}`}>
@@ -213,8 +216,9 @@ function ServerRow({ row, busy, actionInProgress, children }) {
{meta.label}{row.pid ? ` (PID ${row.pid})` : ''}
</span>
{row.endpoint && (
- <code className="text-xs text-gray-500 truncate max-w-full">{row.endpoint}</code>
+ <code className="text-xs text-gray-500 break-all max-w-full">{row.endpoint}</code>
)}
+ {row.model && <span className="text-xs text-gray-400 break-all">Model: {row.model}</span>}
{row.version && <span className="text-xs text-gray-500">v{row.version}</span>}
{row.updateAvailable && row.latestVersion && (
<span
@@ -237,7 +241,6 @@ function ServerRow({ row, busy, actionInProgress, children }) {
{row.detail && <span className="text-xs text-gray-500">{row.detail}</span>}
</div>
<div className="flex items-center gap-2 flex-wrap shrink-0">
- {children}
{row.onInstall && (
<button
onClick={() => row.onInstall()}
@@ -309,6 +312,7 @@ function ServerRow({ row, busy, actionInProgress, children }) {
Update available
</a>
)}
+ {children}
</div>
</div>
);
@@ -343,6 +347,8 @@ export default function RuntimeServersCard({
onToggleKeepLoaded,
fleetHostStatus,
onStopFleetHost,
+ selectedRuntime,
+ onSelectRuntime,
}) {
// Read off each daemon's own status payload — the same place `runAtStartup`
// and Ollama's `disabled` come from — so there is no second settings fetch on
@@ -390,7 +396,7 @@ export default function RuntimeServersCard({
// llama-server takes a REQUIRED model path, and which GGUF (plus which
// drafter and spec type) is a real choice — so there is no honest one-click
// Start here. The launcher below owns it.
- startBlockedReason: 'Pick a model in Speculative Decoding below to start it',
+ startBlockedReason: 'Choose Configure to pick a model before starting',
}),
pm2Row({
id: 'mtplx',
@@ -410,7 +416,7 @@ export default function RuntimeServersCard({
: null)
: null,
detail: mtplxStatus?.cachedModels?.length
- ? `${mtplxStatus.cachedModels.length} checkpoint${mtplxStatus.cachedModels.length === 1 ? '' : 's'} cached`
+ ? `${formatCount(mtplxStatus.cachedModels.length)} checkpoint${mtplxStatus.cachedModels.length === 1 ? '' : 's'} cached`
: null,
}),
pm2Row({
@@ -436,7 +442,7 @@ export default function RuntimeServersCard({
slotstreamStatus?.memoryPlan
&& `target ${slotstreamStatus.memoryPlan.targetGb} GB${slotstreamStatus.memoryPlan.auto ? ' (auto)' : ''} · peak ${slotstreamStatus.memoryPlan.expectedPeakGb} GB · ~${slotstreamStatus.memoryPlan.expectedWarmDecodeToks} tok/s`,
slotstreamStatus?.cachedModels?.length
- && `${slotstreamStatus.cachedModels.length} checkpoint${slotstreamStatus.cachedModels.length === 1 ? '' : 's'} cached`,
+ && `${formatCount(slotstreamStatus.cachedModels.length)} checkpoint${slotstreamStatus.cachedModels.length === 1 ? '' : 's'} cached`,
].filter(Boolean).join(' · ') || null,
}),
// Last, and only once its status has landed: an absent payload would
@@ -445,7 +451,7 @@ export default function RuntimeServersCard({
];
return (
- <div className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-3">
+ <div className="@container bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-3">
<div className="flex items-center justify-between gap-2">
<h2 className="text-sm font-medium text-gray-300">Local Runtime Servers</h2>
<button
@@ -458,13 +464,16 @@ export default function RuntimeServersCard({
<RefreshCw size={14} className={loading ? 'animate-spin' : ''} />
</button>
</div>
- <p className="text-xs text-gray-500">
- Every local server PortOS can run, in one place. They are not mutually exclusive — install and run as many as you like. Which one a run goes to is a separate choice: the <span className="text-gray-400">Default</span> backend below, or the provider a task names in <Link to="/ai" className="text-port-accent hover:underline">AI Providers</Link>.
+ <p role="status" className="text-xs text-gray-400">
+ {loading ? 'Refreshing runtime status…' : `${formatCount(rows.filter((row) => row.state === 'running' || row.state === 'external').length)} running · ${formatCount(rows.filter((row) => row.state === 'unknown').length)} status unavailable`}
</p>
<div className="space-y-2">
{rows.map((row) => (
- <ServerRow key={row.id} row={row} busy={busy} actionInProgress={actionInProgress}>
+ <ServerRow key={row.id} row={row} busy={busy} actionInProgress={actionInProgress} selected={selectedRuntime === row.id}>
+ {onSelectRuntime && (row.id === 'ollama' || row.id === 'lmstudio' || row.id === 'fleet-host') && (
+ <button onClick={() => onSelectRuntime(row.id)} className={neutralBtn} aria-pressed={selectedRuntime === row.id}><Settings2 size={12} />Configure</button>
+ )}
{row.id === 'fleet-host' && (
<Link
to="/ai/fleet?fleetStep=host"
@@ -475,6 +484,9 @@ export default function RuntimeServersCard({
{fleetHostStatus?.stoppable ? 'Host setup & usage' : 'Set up host'}
</Link>
)}
+ {((row.id === 'ollama' && ollamaService?.supported) || (row.pm2 && !['unsupported', 'missing', 'unknown'].includes(row.state))) && (
+ <details className="open:w-full">
+ <summary className="min-h-[44px] content-center cursor-pointer text-xs text-gray-400">Startup &amp; residency</summary>
{row.id === 'ollama' && ollamaService?.supported && (
<button
onClick={() => onControlOllama(ollamaRunsAtStartup ? 'disable' : 'enable')}
@@ -489,7 +501,7 @@ export default function RuntimeServersCard({
</button>
)}
{(row.id === 'llama' || row.id === 'mtplx' || row.id === 'slotstream') && row.state !== 'unsupported' && row.state !== 'missing' && (
- <div className="flex items-center gap-3">
+ <div className="flex flex-wrap items-center gap-3">
<IdleWindowField
id={row.id}
value={idleWindows[row.id] ?? 0}
@@ -516,11 +528,14 @@ export default function RuntimeServersCard({
</label>
</div>
)}
+ </details>
+ )}
{(row.id === 'llama' || row.id === 'mtplx' || row.id === 'slotstream') && row.state !== 'unsupported' && (
<button
onClick={row.id === 'llama' ? onConfigureLlama : row.id === 'slotstream' ? onConfigureSlotstream : onConfigureMtplx}
className={neutralBtn}
- title={`Jump to the ${row.label} launcher below`}
+ title={`Configure ${row.label}`}
+ aria-pressed={selectedRuntime === row.id}
>
<Settings2 size={12} />
Configure
@@ -530,18 +545,22 @@ export default function RuntimeServersCard({
))}
</div>
+ <details>
+ <summary className="min-h-[44px] content-center cursor-pointer text-xs text-gray-400">Startup and idle-release guidance</summary>
<p className="text-xs text-gray-500">
<span className="text-gray-400">Idle release</span> puts a model down when nothing has used it for that many minutes — llama.cpp unloads it in place and reloads it on the next request; MTPLX and Slotstream are stopped and restarted on demand. <span className="text-gray-400">Only PortOS traffic counts.</span> A client hitting these ports directly is invisible to the timer and cannot lazily start a stopped server, so set <code className="text-gray-400">0</code> for a daemon you drive from outside PortOS.
</p>
+ </details>
<div className="flex flex-col sm:flex-row sm:items-center gap-2 pt-1">
<button onClick={onSaveStartup} disabled={busy} className={accentBtn} title="Run `pm2 save` so the running PM2 processes are in the list a reboot resurrects">
{actionInProgress === 'runtime-save-startup' ? <BrailleSpinner /> : <Save size={12} />}
Save PM2 list for reboot
</button>
- <p className="text-xs text-gray-500">
- llama.cpp, MTPLX and Slotstream run as PM2 processes (<code className="text-gray-400">portos-llama-server</code>, <code className="text-gray-400">portos-mtplx</code>, <code className="text-gray-400">portos-slotstream</code>). Saving snapshots what is running now so it comes back after a reboot — this needs <code className="text-gray-400">pm2 startup</code> to have been run once in a terminal, which is a privileged one-time step PortOS deliberately leaves to you. <span className="text-gray-400">MTPLX and Slotstream are deliberately left out of that snapshot</span>: they start on demand when a request needs them, so resurrecting them at boot would only pin a checkpoint on an idle machine. Ollama and LM Studio manage their own launch-at-login.
- </p>
+ <details className="text-xs text-gray-500">
+ <summary className="min-h-[44px] content-center cursor-pointer">What is saved for reboot?</summary>
+ <p>llama.cpp, MTPLX and Slotstream run as PM2 processes (<code className="text-gray-400">portos-llama-server</code>, <code className="text-gray-400">portos-mtplx</code>, <code className="text-gray-400">portos-slotstream</code>). Saving snapshots what is running now so it comes back after a reboot — this needs <code className="text-gray-400">pm2 startup</code> to have been run once in a terminal, which is a privileged one-time step PortOS deliberately leaves to you. <span className="text-gray-400">MTPLX and Slotstream are deliberately left out of that snapshot</span>: they start on demand when a request needs them, so resurrecting them at boot would only pin a checkpoint on an idle machine. Ollama and LM Studio manage their own launch-at-login.</p>
+ </details>
</div>
</div>
);
diff --git a/client/src/components/settings/RuntimeServersCard.test.jsx b/client/src/components/settings/RuntimeServersCard.test.jsx
index 903cc183e3..93d0031f78 100644
--- a/client/src/components/settings/RuntimeServersCard.test.jsx
+++ b/client/src/components/settings/RuntimeServersCard.test.jsx
@@ -5,7 +5,7 @@ import RuntimeServersCard from './RuntimeServersCard.jsx';
// Every row renders the same status/action vocabulary, so a text query alone
// would match the wrong runtime. Scope to the row that names it.
-const row = (label) => screen.getByText(label).closest('div.flex.flex-col');
+const row = (label) => screen.getByRole('group', { name: label });
const renderCard = (props = {}) => {
const handlers = {
@@ -43,6 +43,7 @@ const renderCard = (props = {}) => {
/>
</MemoryRouter>,
);
+ for (const summary of screen.queryAllByText('Startup & residency')) fireEvent.click(summary);
return handlers;
};
@@ -84,7 +85,7 @@ describe('RuntimeServersCard', () => {
const handlers = renderCard({ llamaStatus: { installed: true, running: false } });
const llama = row('llama.cpp');
expect(within(llama).queryByRole('button', { name: /^Start/ })).toBeNull();
- expect(within(llama).getByText(/Pick a model in Speculative Decoding/)).toBeInTheDocument();
+ expect(within(llama).getByText(/Choose Configure to pick a model/)).toBeInTheDocument();
fireEvent.click(within(llama).getByRole('button', { name: /Configure/ }));
expect(handlers.onConfigureLlama).toHaveBeenCalled();
@@ -392,3 +393,12 @@ describe('RuntimeServersCard', () => {
});
});
});
+
+it('does not claim an unread runtime is uninstalled or offer installation', () => {
+ renderCard({ status: null, llamaStatus: null, mtplxStatus: null, slotstreamStatus: null });
+ for (const name of ['Ollama', 'LM Studio', 'llama.cpp', 'MTPLX', 'Slotstream']) {
+ const runtime = within(row(name));
+ expect(runtime.getByText('Status unavailable')).toBeInTheDocument();
+ expect(runtime.queryByRole('button', { name: 'Install' })).not.toBeInTheDocument();
+ }
+});
diff --git a/client/src/pages/Models.test.jsx b/client/src/pages/Models.test.jsx
index ac02d16fe6..65ee7abef6 100644
--- a/client/src/pages/Models.test.jsx
+++ b/client/src/pages/Models.test.jsx
@@ -27,7 +27,7 @@ vi.mock('../components/settings/LocalModelAssessments.jsx', () => ({
vi.mock('../components/settings/LocalLlmTab', () => ({
LocalLlmTab: ({ view }) => <div data-testid="llms-view" data-view={view || 'none'}>llms panel</div>,
}));
-vi.mock('../components/settings/LocalLlmRuntimesView.jsx', () => ({ default: () => <div>runtimes panel</div> }));
+vi.mock('../components/settings/LocalLlmRuntimesView.jsx', () => ({ default: ({ view }) => <div data-testid="runtime-panel" data-runtime={view || ''}>runtimes panel</div> }));
vi.mock('../components/settings/EmbeddingsTab', () => ({ default: () => <div>embeddings panel</div> }));
vi.mock('../components/models/Image3dRuntimes', () => ({ default: () => <div>3d runtimes panel</div> }));
vi.mock('../components/models/ModelStatusTab', () => ({ default: () => <div>status panel</div> }));
@@ -208,6 +208,12 @@ describe('Models — tab drill-downs', () => {
expect(screen.queryByTestId('llms-view')).not.toBeInTheDocument();
});
+ it('preserves the Runtimes navigation identity when selecting a runtime', async () => {
+ renderAt('/models/llms-runtimes/slotstream');
+ expect(await screen.findByTestId('runtime-panel')).toHaveAttribute('data-runtime', 'slotstream');
+ expect(screen.getByRole('tab', { name: 'Runtimes' })).toHaveAttribute('aria-selected', 'true');
+ });
+
it.each(['library', 'abuse'])('passes the LLM %s sub-route through to the focused LLM view', async (view) => {
renderAt(`/models/llms/${view}`);
expect(await screen.findByTestId('llms-view')).toHaveAttribute('data-view', view);
diff --git a/docs/UX_DESIGN_AUDIT.md b/docs/UX_DESIGN_AUDIT.md
index b76837c1be..4a5ca31601 100644
--- a/docs/UX_DESIGN_AUDIT.md
+++ b/docs/UX_DESIGN_AUDIT.md
@@ -83,3 +83,8 @@ training gates; source-save failure; legacy host routing; invalid task recovery;
and a scoring result arriving while another task is selected without duplicate
subscriptions. The same explicit API actions and adoption criteria remain in
place. The pilot provides a composition example, not a new universal component.
+
+
+### Runtimes operations pilot (#7795)
+
+The roster now selects runtime configuration by URL, preserves form/progress owners across selection, and keeps setup guidance in a named disclosure. See [task map and synthetic validation evidence](validation/7795-runtimes-workspace.md) for observed layout, interaction checks, and evidence limits.
diff --git a/docs/validation/7795-runtimes-workspace.md b/docs/validation/7795-runtimes-workspace.md
new file mode 100644
index 0000000000..50a5529092
--- /dev/null
+++ b/docs/validation/7795-runtimes-workspace.md
@@ -0,0 +1,24 @@
+# Runtimes operations pilot
+
+Scope: #7795, part of #7791. Uses the operations page family in the UX design guide.
+
+## Task and content map
+
+| Task | Before | After |
+| --- | --- | --- |
+| Inspect and operate servers | Runtime rows mix lifecycle, startup and residency controls; backend and setup cards follow | Aligned identity/state/action columns when the container fits; contextual Start/Stop/Install/Configure, with startup and residency disclosures |
+| Configure a runtime | Configure scrolls to one of several long inline launchers | Configure selects a runtime URL; spacious containers show roster and configuration together, narrower containers show the selected detail with All runtimes recovery |
+| Inspect downloads and return to work | Progress lives in the long runtime sections | Existing progress owners remain mounted; active transfers have visible links back to their cancellation controls |
+| Consult setup guidance | Setup and recommendations precede backend/launcher configuration | A named disclosure follows the operational workspace; speculative-decoding explanation is also optional |
+
+The base Runtimes navigation entry, icons, aliases and management URLs remain unchanged. Selection uses existing runtime IDs. A selected detail is navigation only; installation, downloads, saves and lifecycle actions still require their existing explicit actions. The dedicated Qwen host keeps its existing setup/usage destination.
+
+## Evidence and limits
+
+Rendered interaction tests cover opening configuration, invalid-selection recovery, selected Models navigation, launch-draft retention through selection and browser history, returning to download cancellation, and subscriber counts. Existing lifecycle, failure, save, installation and download tests continue to exercise their public controls. Unread status has a distinct state and does not advertise installation.
+
+A temporary isolated browser harness rendered the actual components with synthetic status responses and a disabled socket connection. No live instance records or providers were used. Visual checks covered 320px, approximately 390px, 1,024px, 1,440px and 1,920px CSS widths, with Classic dark and light palettes sampled. The full application navigation was covered by existing Models tests, not reproduced by the isolated harness.
+
+Observed: desktop roster columns align; large selected workspaces place configuration beside the roster; narrow selection hides the roster while retaining a return link; long synthetic identifiers wrap; the inspected viewport widths had no horizontal document overflow. Selecting Configure moves focus to the detail heading. Returning restores focus to the selected runtime's Configure control. A 320px inspection exposed an overly narrow launch-blocker message beside Start; wrapping that action group keeps the message readable.
+
+These are synthetic task-path and layout checks, not a timed user study or hardware validation. No claims are made about faster task completion, download throughput, or runtime behavior on specific hardware. The lifecycle implementation and provider-consent semantics are unchanged.