Skip to content

feat: improve instance creation clarity and live model status - #225

Open
rwfraser wants to merge 1 commit into
lordmathis:mainfrom
rwfraser:feat/instance-creation-clarity
Open

feat: improve instance creation clarity and live model status#225
rwfraser wants to merge 1 commit into
lordmathis:mainfrom
rwfraser:feat/instance-creation-clarity

Conversation

@rwfraser

Copy link
Copy Markdown

Summary

This PR addresses three pain points in the llamactl web UI:

1. Router mode is now explained during instance creation

When creating a llama.cpp instance without specifying a model, hf_repo, or a preset, the Backend tab now shows a blue informational callout explaining that llama-server will start in router mode and may auto-discover cached HF model presets. It lists the three ways to configure a specific model (local path, HF repo+file, or Preset tab), so users are not surprised by unexpected multi-model behaviour.

The callout disappears as soon as any of those fields are filled in.

2. Instance card shows live model status

The instance card now polls model state every 10 seconds while an instance is running (previously it fetched once on mount and never updated again):

  • Single-model instance: shows the loaded model's id/alias as a badge directly on the card.
  • Multi-model / router instance: keeps the existing X/N models count badge, but it now stays current after load/unload operations without a manual page refresh.
  • Models dialog: fires a callback immediately after any load or unload action so the card badge refreshes at once, not just when the next poll fires.

3. Field labels, descriptions, and tooltips improved

  • hf_repo placeholder changed from microsoft/DialoGPT-medium (a vLLM example) to ggml-org/gemma-3-1b-it-GGUF, which is a GGUF repository.
  • hf_file added as a basic llama.cpp field with an example filename.
  • model, hf_repo, hf_file, gpu_layers, and models_preset all received expanded descriptions and tooltip text (shown via a small ? icon next to the label).
  • Fixed merge order in basicBackendFieldsConfig so llama.cpp field metadata takes precedence over the vLLM config for shared keys such as model.
  • GeneralTab: expanded descriptions for instance name, group, idle timeout, and on-demand start fields.

Tests

All 68 frontend tests pass (npm run test:run), type-check is clean (npm run type-check), and the build completes without errors (npm run build).

New test coverage added:

  • InstanceCard: single-model badge display, multi-model badge display, no badge on stopped instance, polling interval setup.
  • InstanceModal: router mode callout shows on Backend tab when no model is set; callout absent when editing an instance that already has a model configured.

Testing context

These changes were developed and tested against a local llamactl instance running two llama.cpp instances (a router-mode instance serving 6 cached models, and a direct Qwen3.6-35B instance).


Note: This replaces PR #224, which was closed because unrelated commits had been pushed to that branch after the PR was opened. This branch contains only the changes described above.

Co-Authored-By: Oz oz-agent@warp.dev

- InstanceCard: poll llama.cpp model state every 10s while running;
  show loaded model name for single-model instances; show X/N badge
  for multi-model router instances; refresh immediately on Models
  dialog close or load/unload action
- ModelsDialog: add onModelsChange callback fired after load/unload
- BackendTab: show informational callout when llama.cpp instance has
  no model, hf_repo, or preset configured, explaining router mode
  and how to configure a specific model
- zodFormUtils: fix field metadata for llama.cpp backend - corrected
  hf_repo placeholder from DialoGPT to a GGUF example; added hf_file
  as a basic field; expanded descriptions and tooltips for model,
  hf_repo, hf_file, gpu_layers, and models_preset; fixed merge order
  so llama.cpp config takes precedence over vllm for shared keys
- GeneralTab: expand descriptions for idle_timeout, on_demand_start,
  instance name, and group fields
- BackendFormField: add HelpCircle tooltip icon to field labels using
  the tooltip text from basicBackendFieldsConfig
- Tests: add model badge, polling, and router mode callout coverage

Co-Authored-By: Oz <oz-agent@warp.dev>
@lordmathis

Copy link
Copy Markdown
Owner

Thanks for the PR! I like the improvements but there are few issues to address.

  1. I think the router mode callout is quite loud and could be disruptive. It could be just the headline - "No model specified — router mode will be used" and then could be expanded with the full explanation on click.
  2. For field labels, placeholders and tooltips - the issue here is that these are not currently backend specific and the info leaks between the backends. This is visible for shared fields such as model. Previously for llama.cpp backend it showed vLLM model just because it was the last backend in the list. Your change just switches this to llama.cpp so now the placeholder and tooltip show gguf model info for all backends. The fix is to make the lookup backend-aware. backendFieldConfigs (zodFormUtils.ts:137) is already a per-backend map keyed by 'llama_cpp' | 'mlx_lm' | 'vllm' (same values as BackendType) — it just isn't exported. BackendFormField already receives formData (which has backend_type), so look up backendFieldConfigs[backend_type]?.[fieldKey] first, falling back to the merged basicBackendFieldsConfig.
  3. Related to the 2. point, there is a models_preset branch in BackendFormField.tsx:40 — it hardcodes its text and bypasses the config, so its new tooltip never renders.

@rwfraser

rwfraser commented Jul 16, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants