Repository navigation
Screens
Source: apps/web/src/screens — ChatScreen.tsx, EngineScreen.tsx (+ engine/
tabs: BasicsTab, PerformanceTab, AdvancedTab, ProfilesTab), ModelsScreen.tsx,
SettingsScreen.tsx (+ settings/ tabs: EngineTab, SafetyTab, AgentTab,
AboutTab), CoderScreen.tsx, LogScreen.tsx.
Streaming chat over the engine's OpenAI-compatible API.
- Left rail — conversation list (persisted, newest first, title = first user line, model + message count, delete).
-
Header — model select (the engine's public
model_id), engine-ready indicator, active-param badges (thinking mode/effort, max tokens, greedy). -
Messages:
- user bubble (right) with attachment chips;
- assistant turn (left): collapsible thinking block (raw
reasoning_content, accent icon), markdown body (GFM), streaming caret while in flight; -
meta footer per message parsed from the engine's
timings+usage: finish reason, TTFT, prompt tok/s, decode tok/s, cached tokens (prefix reuse), in/out tokens, thinking tokens, speculativedraft accepted/total (%).
-
Composer — auto-grow textarea (Enter send / Shift+Enter newline), image/video
attachment (→ base64 data-URI parts; requires engine
--vision), stop button (AbortController) while streaming, and a params popover: thinking on/off, reasoning effort (template default/low/medium/xhigh), max output tokens, temperature, top-p, top-k, min-p, presence/frequency penalties, seed, greedy, system prompt, preserve-thinking. - Type
/compactto ask the engine to condense the whole conversation into a structured checkpoint summary, which replaces the thread and becomes its starting context (handy before a context-limit warning). - Offline banner — if the engine is down, chat shows a warning with a jump-to-Engine action instead of failing silently.
- Context-limit awareness — live "% of max-context" usage, warns before the engine would truncate (approaching >75%, near-full >90%).
Top: status row — engine state (stopped/starting/running/stopping/failed/external),
loaded model + uptime + port, GPU memory bar + utilization + process list, Start/Stop
action. Fail reasons surface inline (e.g. "weights require 18 GiB, only 3 GiB free"
from the engine's own FATAL line). The status row and the Generated launch command
card (below) stay visible across all tabs; everything else is split into four tabs —
Basics / Performance / Advanced / Profiles — sharing one EngineProfile state
object (no per-tab local state), so switching tabs never loses an in-progress edit.
Generated launch command card — exactly the argv passed to ninfer-serve (flags
omitted when unset → executable defaults), copy button, "long-context preset"
shortcut. The same profile→argv function drives the generated command and the
real spawn, so what you review is what runs.
Basics tab — Presets, artifact pick + --model-id/--api-key/--host/--port/
--device, models directory.
Presets (one-click, replace the profile, review-before-start):
| Preset | Purpose |
|---|---|
| Default | executable defaults (bf16 KV, no spec, C=1, 8k ctx) |
| Long context MTP3 | 240k ctx, FP8 KV, C=2, 2 dev + 8 host state slots, 8 GiB host KV, MTP3 + optimized head, vision, preserve-thinking |
| Chat MTP3 | 32k ctx, auto KV, MTP3, C=2 |
| Vision multimodal | 81,920 ctx, vision + media budgets, MTP3 |
| Max concurrency (C=8) | 8 lanes + matching state slots for aggregate decode |
| 35B-A3B DFlash / 3.8-27B DFlash2 | per-architecture speculative backends (7 drafts) |
Plus RTX 5090 presets calibrated from the engine's own measured KV density (192k
long-context MTP, 128k bf16, C=4 nvfp4 serving, 96k low-latency, 128k MoE, two 256k
ultra-context presets at the variants' full 262,144-token native window), and a
community-validated 262k fp8 profile ported from headpiece747/ninfer-5090-windows.
Performance tab — Context & memory (--max-context, --kv-capacity
[follow-ctx / auto / fixed], --prefill-chunk, --default-max-tokens,
--default-thinking-budget), Scheduling (--max-concurrency 1–8,
--max-pending-requests, --pending-timeout-ms), KV cache & context cache
(--kv-dtype bf16/int8/fp8/nvfp4/k8v4, --no-prefix-reuse, --no-cuda-graph,
device/host state slots, --host-kv-mib, max private continuations / shared
prefixes / long anchors — auto-disabled with no-prefix-reuse), Speculative decoding
(--spec off/MTP/DFlash/DFlash2, --draft-tokens range-aware: 1–5 for MTP, 1–15
otherwise, --lm-head-draft; per-artifact capability check computed from the
catalog), reasoning-effort dropdown.
Advanced tab — Vision & media (--vision, residency frozen at startup,
--media-cache-mib, --media-live-mib, --media-preprocess-threads,
--max-request-mib), Sampling defaults (--no-thinking, --preserve-thinking,
--greedy, --temperature/--top-p/--top-k/--min-p/--presence-penalty/ --frequency-penalty/--seed — process-level; request fields override), Logging,
storage & misc (--log-level, --log-stats-interval-ms, --request-log-jsonl,
--response-store-max-records/-mib, --context-cost-presets, --cors). Every
control carries a tooltip quoting the engine docs; every omitted value means
"engine executable default."
Profiles tab — save/load named profiles, 1:1 with flags. Also downloads (HF
repo + file → hf download … --local-dir <modelsDir> with live output tail),
engine log (live tail, 2 s poll, auto-stick scroll, severity coloring — the startup
sequence: weights → host state/KV pinning → CUDA graphs → engine ready →
listening — is readable in-app), and engine source updates (drives
POST /api/engine/update: pull runs git pull --ff-only; build stops a
running engine first, then runs the configured buildCommand, one job at a time,
streaming stdout/stderr into a live log pane with a running/done/failed badge).
- Downloaded artifacts cards — filename, model/weights badges, size, mtime, public id, speculation support + vision, HF source link, "loaded" highlight when the running engine uses it, spec support line; unregistered files flagged.
- Registered catalog table (the five artifact identities) — local/downloaded/ download states with live download progress tail, launch/download actions, per-row spec support (mtp 1–5; dflash 1–15 on 35B-A3B; dflash2 1–15 on 3.8-27B with companion weights).
- Models directory card — path + copy, with the validation caveat (partial artifacts fail readiness).
Four tabs — Engine / Safety & Permissions / Agent / About:
-
Engine tab — engine paths (
ninfer-serve,ninferCLI, models dir,hf), default port, API key (Studio injects it on proxied requests), Coder lint/test commands, engine source pull/rebuild. Persisted toconfig.jsonvia the control plane — see Configuration. - Safety & Permissions tab — Safe Mode, Sandbox, and Commit Approval toggles (moved here from the Coder sidebar — see below), plus a default permissions template (tool allow/ask/deny tiers + denied path prefixes) that seeds a brand-new Coder workspace's permissions the first time it's created. Changing the template never touches an existing workspace's own permissions.
- Agent tab — reserved for future autonomy/tool-access configuration; currently a placeholder.
- About tab — architecture note, version.
All three screens (Chat, Coder, Settings) stay permanently mounted (see
Architecture), so Safe Mode/Sandbox/Commit Approval are backed by a shared React
context (CoderSafetyProvider) — toggling one in Settings is reflected in Coder
immediately, with no reload.
An agentic coding harness over the same engine: plan/act loop with file read/write/ edit, grep/glob, shell exec with sessions and background jobs, git integration, Scout / Verify / Critic harness passes (opt-in, labeled, collapsible), worker/subagent delegation with depth and step budgets, conversation checkpoints with restore, human-approval (HITL) gates, sandboxed vs. live execution modes, and a per-workspace memory bank — with a live prefill/decode indicator so the model thinking is never invisible.
Safe Mode, Sandbox, and Commit Approval now live in Settings > Safety & Permissions (see above) rather than the Coder sidebar. The sidebar still holds per-workspace tool permissions (allow/ask/deny tiers + denied paths) and approved risky commands — a separate, per-workspace concept from the Settings-level default template.
Backed by desktop/control/src/coder/ (exec.rs, fs.rs, grep.rs, search.rs,
memory.rs, web.rs, workspace.rs) via the /api/coder/* endpoints. See
Security for the confinement model of exec vs. the file tools, and the
SSRF protections on web_fetch.