mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 11:26:25 -05:00
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:
parent
c7bdedea09
commit
320710ea7f
7 changed files with 381 additions and 0 deletions
|
|
@ -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});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue