ai: the AI nav page — Manage tab (model catalog, settings, service)

New AI nav item and /ai route with Chat and Manage tabs (Chat is a
placeholder until the SSE chat lands).  The Manage tab mirrors the
Map/Zim download UX: the model catalog with the RAM-based tier
recommendation and a Pi 4 performance hint, downloads through the
download manager (progress on the Downloads page), active-model
select, enable toggle, idle-unload minutes, and llama-server
start/stop through the Controller (compose service name in docker,
systemd unit natively).  AiModelRow is in the theme-sample gallery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-08-25 21:56:36 -06:00
parent c7bdedea09
commit 320710ea7f
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
7 changed files with 381 additions and 0 deletions

View file

@ -2438,3 +2438,33 @@ export async function setPlaylistTag(playlistId, tagName, directory) {
toast({type: 'error', title: 'Error', description: message, time: 5000});
throw Error(message);
}
// --- AI assistant ---
export async function getAiCatalog() {
const response = await apiGet(`${API_URI}/ai/manage/catalog`);
if (response.ok) {
return await response.json();
}
const message = await getErrorMessage(response, 'Failed to fetch AI catalog.');
toast({type: 'error', title: 'Error', description: message, time: 5000});
}
export async function postAiSettings(settings) {
const response = await apiPost(`${API_URI}/ai/manage/settings`, settings);
if (response.ok) {
return await response.json();
}
const message = await getErrorMessage(response, 'Failed to save AI settings.');
toast({type: 'error', title: 'Error', description: message, time: 5000});
throw Error(message);
}
export async function getChatModes() {
const response = await apiGet(`${API_URI}/chat/modes`);
if (response.ok) {
return (await response.json())['modes'];
}
const message = await getErrorMessage(response, 'Failed to fetch chat modes.');
toast({type: 'error', title: 'Error', description: message, time: 5000});
}