Compare commits

...

4 Commits

Author SHA1 Message Date
Z User
dca0fcc59f fix: TTS logs in Logs tab + TTS generate buffer fix + Russian voice hint + v0.8.2
## Fixes

### 1. TTS logs in Logs tab
Added 'tts' to the logs target selector in the Logs tab. Now you can
stream docker logs from the TTS container.

### 2. TTS generate fetch failed
Changed /api/tts/generate from streaming res.body directly to
res.arrayBuffer() first, then returning the buffer. Next.js sometimes
cuts off streaming responses from server-side fetch — buffering avoids
this.

Also improved error messages:
- ECONNREFUSED / fetch failed → 'TTS container is not running...'
- ENOTFOUND → 'TTS container not found on Docker network...'

### 3. Russian voice accent
Built-in voices (alloy, nova, shimmer) are English-trained and will
speak Russian with an accent. Added a prominent hint in the TTS tab
explaining that for natural Russian, you need to upload a custom WAV
sample of a Russian speaker.

## Version → 0.8.2
2026-10-29 21:42:08 +00:00
5161de152a Merge pull request 'fix: add --perf flag for live TPS/TTFT in /slots + v0.8.1' (#19) from fix/perf-flag into master
Reviewed-on: https://gitea.mikan/mikan/GPU-Node/pulls/19
2026-10-29 21:29:08 +00:00
Z User
b1cc715077 fix: add --perf flag for live TPS/TTFT in /slots + v0.8.1
## Problem
'TPS и TPS Prefill как-то слабовато обновляются' — /slots endpoint
doesn't return per-slot timings without --perf flag. Without it, the
Perf tab shows 'No per-token timings' even during generation.

## Fix
Added `perf: boolean` to DashboardConfig (default: true).
- buildLlamaExtraArgs: emits `--perf` when enabled
- parseLlamaExtraArgs: parses `--perf` / `--no-perf`
- mergeConfig: includes perf field
- ConfigTab: new 'Perf timings' toggle in Performance flags section
  with hint 'Per-slot TPS/TTFT in /slots (needed for Perf tab)'

With --perf enabled, /slots returns real-time timings:
  timings: {
    prompt_n, prompt_ms, prompt_per_second,
    predicted_n, predicted_ms, predicted_per_second,
    cache_hit_rate
  }

These update every 1.5s while the Perf tab is polling.

## Version → 0.8.1
2026-10-29 21:16:52 +00:00
17b4cf88d7 Merge pull request 'feat: TTS dashboard tab — generate, voice upload, start/stop + v0.8.0' (#18) from feat/tts-dashboard into master
Reviewed-on: https://gitea.mikan/mikan/GPU-Node/pulls/18
2026-10-29 21:12:12 +00:00
6 changed files with 52 additions and 10 deletions

View File

@@ -41,6 +41,7 @@ function mergeConfig(
contBatching: patch.contBatching ?? base.contBatching,
embeddings: patch.embeddings ?? base.embeddings,
metrics: patch.metrics ?? base.metrics,
perf: patch.perf ?? base.perf,
ropeFreqScale: patch.ropeFreqScale ?? base.ropeFreqScale,
ropeScale: patch.ropeScale ?? base.ropeScale,
yarnExtFactor: patch.yarnExtFactor ?? base.yarnExtFactor,

View File

@@ -120,7 +120,7 @@ export async function GET() {
ok: envError === null,
error: envError,
},
version: "0.8.0",
version: "0.8.2",
timestamp: new Date().toISOString(),
});
}

View File

@@ -62,16 +62,28 @@ export async function POST(req: NextRequest) {
res.headers.get("content-type") || "audio/mpeg";
const format = body.response_format || "mp3";
// Stream the audio response back to the browser
return new Response(res.body, {
// Read the full response into a buffer, then return it as a Response.
// (Streaming res.body directly sometimes doesn't work through Next.js
// server components — the connection gets cut off.)
const arrayBuffer = await res.arrayBuffer();
return new Response(arrayBuffer, {
headers: {
"Content-Type": contentType,
"Content-Disposition": `attachment; filename="tts-output.${format}"`,
"Content-Length": `${arrayBuffer.byteLength}`,
},
});
} catch (err) {
const msg = (err as Error).message;
const hint =
msg.includes("ECONNREFUSED") || msg.includes("fetch failed")
? "TTS container is not running. Start it from the TTS tab or: docker compose --profile tts up -d tts"
: msg.includes("ENOTFOUND")
? "TTS container not found on Docker network. Is it running?"
: msg;
return Response.json(
{ ok: false, error: (err as Error).message },
{ ok: false, error: hint },
{ status: 503 }
);
}

View File

@@ -114,6 +114,7 @@ interface DashboardConfig {
contBatching: boolean;
embeddings: boolean;
metrics: boolean;
perf: boolean;
ropeFreqScale: number;
ropeScale: number;
yarnExtFactor: number;
@@ -203,6 +204,7 @@ const DEFAULT_CONFIG: DashboardConfig = {
contBatching: true,
embeddings: false,
metrics: false,
perf: true,
ropeFreqScale: 1.0,
ropeScale: 1.0,
yarnExtFactor: 1.0,
@@ -266,7 +268,7 @@ export default function DashboardPage() {
>([]);
const [logsAutoScroll, setLogsAutoScroll] = React.useState(true);
const [logsTarget, setLogsTarget] = React.useState<
"llama" | "comfyui" | "dashboard" | "ssh"
"llama" | "comfyui" | "dashboard" | "ssh" | "tts"
>("llama");
const logsEndRef = React.useRef<HTMLDivElement | null>(null);
const logsEventSourceRef = React.useRef<EventSource | null>(null);
@@ -2152,6 +2154,12 @@ function ConfigTab({
checked={config.metrics}
onChange={(v) => update("metrics", v)}
/>
<ToggleRow
label="Perf timings"
hint="Per-slot TPS/TTFT in /slots (needed for Perf tab)"
checked={config.perf}
onChange={(v) => update("perf", v)}
/>
</div>
</div>
@@ -3307,8 +3315,8 @@ function LogsTab({
onClear,
logsEndRef,
}: {
target: "llama" | "comfyui" | "dashboard" | "ssh";
setTarget: (t: "llama" | "comfyui" | "dashboard" | "ssh") => void;
target: "llama" | "comfyui" | "dashboard" | "ssh" | "tts";
setTarget: (t: "llama" | "comfyui" | "dashboard" | "ssh" | "tts") => void;
liveLogs: { stream: "stdout" | "stderr"; line: string; ts?: number }[];
autoScroll: boolean;
setAutoScroll: (v: boolean) => void;
@@ -3340,6 +3348,7 @@ function LogsTab({
<SelectItem value="comfyui">comfyui</SelectItem>
<SelectItem value="dashboard">dashboard</SelectItem>
<SelectItem value="ssh">ssh-main</SelectItem>
<SelectItem value="tts">tts</SelectItem>
</SelectContent>
</Select>
<label className="flex items-center gap-2 text-xs text-muted-foreground">
@@ -4726,8 +4735,16 @@ function TTSTab({
</p>
)}
<p className="text-[10px] text-muted-foreground">
For XTTS voice cloning: mono 22050 Hz WAV, 6-30 seconds, clean sample.
Russian is supported by XTTSv2. After upload, restart TTS to apply.
<strong className="text-foreground">For natural Russian:</strong>{" "}
built-in voices (alloy, nova, shimmer) are English-trained and will
speak Russian with an accent. Upload a clean WAV sample of a Russian
speaker (10-20s, mono 22050 Hz, no noise) → restart TTS → select
the new voice. XTTSv2 supports Russian natively.
<br />
<span className="mt-1 block">
Good sources: audiobook samples (lib.ru), news clips, or record
yourself. Avoid music, breathing, or partial words.
</span>
</p>
</div>
</CardContent>
@@ -4892,6 +4909,7 @@ function buildPreviewArgs(cfg: DashboardConfig): string {
if (!cfg.contBatching) parts.push("--no-cont-batching");
if (cfg.embeddings) parts.push("--embeddings");
if (cfg.metrics) parts.push("--metrics");
if (cfg.perf) parts.push("--perf");
if (cfg.ropeFreqScale !== 1.0)
parts.push(`--rope-freq-scale ${cfg.ropeFreqScale}`);
if (cfg.ropeScale !== 1.0)

View File

@@ -240,6 +240,9 @@ export interface DashboardConfig {
embeddings: boolean;
/** Enable /metrics (Prometheus) endpoint */
metrics: boolean;
/** Enable internal libllama performance timings in /slots responses.
* Without this, /slots doesn't return per-slot timings (TPS, TTFT, etc.) */
perf: boolean;
/** RoPE frequency scale (NTK-aware, 1.0 = default) */
ropeFreqScale: number;
/** RoPE context scaling factor (1.0 = default) */
@@ -315,6 +318,7 @@ export const DEFAULT_CONFIG: DashboardConfig = {
contBatching: true,
embeddings: false,
metrics: false,
perf: true,
ropeFreqScale: 1.0,
ropeScale: 1.0,
yarnExtFactor: 1.0,
@@ -493,6 +497,12 @@ export function parseLlamaExtraArgs(
case "--metrics":
cfg.metrics = true;
break;
case "--perf":
cfg.perf = true;
break;
case "--no-perf":
cfg.perf = false;
break;
case "--rope-freq-scale":
cfg.ropeFreqScale = Number(next) || cfg.ropeFreqScale;
i++;
@@ -646,6 +656,7 @@ export function buildLlamaExtraArgs(cfg: DashboardConfig): string {
if (!cfg.contBatching) parts.push("--no-cont-batching");
if (cfg.embeddings) parts.push("--embeddings");
if (cfg.metrics) parts.push("--metrics");
if (cfg.perf) parts.push("--perf");
// RoPE / YaRN
if (cfg.ropeFreqScale !== 1.0)
parts.push(`--rope-freq-scale ${cfg.ropeFreqScale}`);

View File

@@ -4,7 +4,7 @@
* Displayed in the footer and available via /api/debug so the user can
* verify the update actually took effect.
*/
export const DASHBOARD_VERSION = "0.8.0";
export const DASHBOARD_VERSION = "0.8.2";
/**
* Build timestamp — set at build time by Next.js.