model inference settings

This commit is contained in:
Storme-bit
2026-04-18 06:16:31 -07:00
parent daf5b9a8ae
commit 4b75529806
3 changed files with 39 additions and 0 deletions

View File

@@ -194,4 +194,10 @@ export async function getServiceHealth() {
const res = await fetch(`${BASE_URL}/health/services`);
if (!res.ok) throw new Error(`Failed to fetch health: ${res.status}`);
return res.json();
}
export async function getModelProps() {
const res = await fetch(`${BASE_URL}/models/props`);
if (!res.ok) throw new Error('Failed to fetch model props');
return res.json();
}

View File

@@ -2,6 +2,7 @@ import React, { useState, useEffect, useCallback } from 'react';
import { useSettings } from '../hooks/useSettings';
import { getServiceHealth } from '../api/orchestration';
import { useModels } from '../hooks/useModels';
import { getModelProps } from '../api/orchestration';
export default function SettingsView({ onNavigate }) {
const { settings, saveSetting, saving } = useSettings();
@@ -243,6 +244,11 @@ function ModelsSection({ onNavigate }) {
const [selectedInfo, setSelectedInfo] = useState(null);
const {settings, saveSetting, saving} = useSettings();
const [modelProps, setModelProps] = useState(null);
useEffect(() => {
getModelProps().then(setModelProps).catch(() => {});
}, []);
// Sync info panel when selection changes
useEffect(() => {
const m = models.find(m => m.value === selectedModel);
@@ -325,6 +331,15 @@ function ModelsSection({ onNavigate }) {
{selectedInfo.description && (
<InfoLine label="Description" value={selectedInfo.description} />
)}
<InfoLine
label="Context"
value={modelProps ? `${modelProps.contextWindow.toLocaleString()} tokens` : '—'}
/>
<InfoLine
label="Loaded"
value={modelProps?.modelAlias ?? '—'}
mono
/>
</div>
<p className="text-xs text-muted" style={{ marginTop: 4, fontStyle: 'italic' }}>
Model loading and parameter configuration coming soon