fix: PR review nits — response shape, landing copy, form reset

- /llm/generate's "model is downloading" branch was raising HTTPException(202, detail={...}), which wraps the payload in {"detail": ...} and forces clients to parse a success status as if it were an error. Switched to JSONResponse so the payload sits at the top level.
- The landing page's "Language Models" card advertised "Qwen 3.5" with sizes 4B/2B/0.8B; we ship Qwen3 at 0.6B/1.7B/4B. Aligned to what's actually in the binary.
- ProfileForm's discard-draft button reset the form without touching `personality` or `avatarFile`, so stale persona text and an attached avatar would survive the discard. The other three resets in the file already include both fields — this brings the discard path in line.
This commit is contained in:
Jamie Pine
2026-04-25 01:21:21 -07:00
parent c5b7760a8c
commit 0aa3a8d6b4
3 changed files with 7 additions and 4 deletions
@@ -828,8 +828,10 @@ export function ProfileForm() {
name: '', name: '',
description: '', description: '',
language: 'en', language: 'en',
personality: '',
sampleFile: undefined, sampleFile: undefined,
referenceText: '', referenceText: '',
avatarFile: undefined,
}); });
setSampleMode('record'); setSampleMode('record');
}} }}
+3 -2
View File
@@ -1,6 +1,7 @@
"""LLM inference endpoints.""" """LLM inference endpoints."""
from fastapi import APIRouter, HTTPException from fastapi import APIRouter, HTTPException
from fastapi.responses import JSONResponse
from .. import models from .. import models
from ..backends import get_llm_model_configs from ..backends import get_llm_model_configs
@@ -39,9 +40,9 @@ async def llm_generate(request: models.LLMGenerateRequest):
task_manager.start_download(progress_model_name) task_manager.start_download(progress_model_name)
create_background_task(download_llm_background()) create_background_task(download_llm_background())
raise HTTPException( return JSONResponse(
status_code=202, status_code=202,
detail={ content={
"message": f"Qwen3 {model_size} is being downloaded. Please wait and try again.", "message": f"Qwen3 {model_size} is being downloaded. Please wait and try again.",
"model_name": progress_model_name, "model_name": progress_model_name,
"downloading": True, "downloading": True,
+2 -2
View File
@@ -138,9 +138,9 @@ const MODEL_GROUPS: ModelGroup[] = [
subtitle: 'Transcript refinement, persona replies, and on-device reasoning.', subtitle: 'Transcript refinement, persona replies, and on-device reasoning.',
models: [ models: [
{ {
name: 'Qwen 3.5', name: 'Qwen3',
author: 'Alibaba', author: 'Alibaba',
sizes: ['4B', '2B', '0.8B'], sizes: ['4B', '1.7B', '0.6B'],
description: description:
'Powers transcript cleanup, persona voice replies, and the voice I/O loop. Shares its runtime with the TTS/STT stack — one model cache, one GPU story.', 'Powers transcript cleanup, persona voice replies, and the voice I/O loop. Shares its runtime with the TTS/STT stack — one model cache, one GPU story.',
tags: [ tags: [