Files
Kaname/src/hooks/use-hostname.ts
T
Pascal LinxweilerandClaude Opus 5.5 ea1f18cc74 Deployments: API keys, deploy from the library, reorganized form
- Settings → API keys (generate or paste, show again, delete). Deployments with
  "Require an API key" get them via LLAMA_API_KEY / VLLM_API_KEY (--api-key for
  several vLLM keys); values are masked in the stored/shown command and in logs.
  The chat proxy sends a key.
- "Deploy" in the library and on the model page preselects the model and a
  runtime that can serve it; library rows and the model page link to the
  model's deployments.
- Deployment form: grouped launch options with flags next to labels, command in
  its own step, extra arguments as flag/value rows (runtime form too).
- Native selects follow the dark theme (color-scheme), fixing unreadable options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 12:28:25 +02:00

21 lines
686 B
TypeScript

"use client";
import { useSyncExternalStore } from "react";
/** The browser's host name; null while rendering on the server, so hydration matches. */
export function useHostname(): string | null {
return useSyncExternalStore(
() => () => {},
() => window.location.hostname,
() => null,
);
}
/** llama-server's built-in chat UI, served at / on the published host port. */
export function webUiUrl(
d: { engine: string; hostPort: number | null; options: { webui?: boolean | null } },
hostname: string | null,
): string | null {
return d.engine === "llama.cpp" && d.options.webui !== false && d.hostPort && hostname ? `http://${hostname}:${d.hostPort}/` : null;
}