pub struct App {Show 26 fields
pub running: bool,
pub config: Config,
pub models: Vec<DiscoveredModel>,
pub selected_model_idx: Option<usize>,
pub models_mode: ModelsMode,
pub settings: ModelSettings,
pub model_settings_cache: ModelSettings,
pub model_states: HashMap<String, ModelState>,
pub metrics: ServerMetrics,
pub max_threads: u32,
pub cancelled: Option<Arc<AtomicBool>>,
pub server_mode: ServerMode,
pub router_max_models: u32,
pub ws_server_handle: Option<JoinHandle<()>>,
pub background_tasks: HashMap<String, JoinHandle<()>>,
pub settings_state: SettingsState,
pub picker: PickerState,
pub download: DownloadState,
pub server: ServerState,
pub bench_tune: BenchTuneState,
pub log: LogState,
pub loading: LoadingState,
pub pending: PendingOperations,
pub search: SearchState,
pub ui: UIState,
pub edit: EditState,
}Expand description
The main application state.
Fields§
§running: bool§config: Config§models: Vec<DiscoveredModel>§selected_model_idx: Option<usize>§models_mode: ModelsMode§settings: ModelSettings§model_settings_cache: ModelSettings§model_states: HashMap<String, ModelState>§metrics: ServerMetrics§max_threads: u32§cancelled: Option<Arc<AtomicBool>>§server_mode: ServerMode§router_max_models: u32§ws_server_handle: Option<JoinHandle<()>>§background_tasks: HashMap<String, JoinHandle<()>>§settings_state: SettingsState§picker: PickerState§download: DownloadState§server: ServerState§bench_tune: BenchTuneState§log: LogState§loading: LoadingState§pending: PendingOperations§search: SearchState§ui: UIState§edit: EditStateImplementations§
Source§impl App
impl App
pub async fn start_pending_download(&mut self)
pub async fn start_pending_deletion(&mut self, path: PathBuf)
pub fn start_pending_backend_deletion(&mut self, backend: Backend, tag: String)
pub async fn poll_backend_resolution(&mut self)
pub fn poll_download_progress(&mut self)
pub fn poll_bench_tune_progress(&mut self)
pub fn process_completed_downloads(&mut self)
pub fn poll_server_logs(&mut self)
pub fn poll_sync(&mut self)
pub fn poll_metrics(&mut self)
pub async fn poll_loading_completion(&mut self)
pub async fn start_pending_spawn(&mut self)
pub async fn poll_spawn_result(&mut self)
pub async fn poll_bench_tune_result(&mut self)
pub fn handle_pending_api_load(&mut self)
pub fn handle_pending_api_unload(&mut self)
pub async fn start_pending_kill(&mut self)
pub async fn handle_pending_search(&mut self)
pub fn update_metrics_model_name(&mut self)
pub fn ensure_download_channel(&mut self) -> Sender<DownloadState>
pub async fn update_ws_server(&mut self)
Sourcepub async fn update_api_endpoint(&mut self)
pub async fn update_api_endpoint(&mut self)
Start/stop the API endpoint proxy based on settings.
The proxy can run before any model is loaded (it will accept connections
for /api/status and serve a proxy that returns errors until a model is
loaded). When a model is loaded later, or the loaded model changes, the
proxy is restarted so it points at the right llama-server port.
Source§impl App
impl App
Sourcepub fn update_vram_estimate(&mut self)
pub fn update_vram_estimate(&mut self)
Compute VRAM estimate from model file size and current settings.
Sourcepub fn update_model_metadata(&mut self)
pub fn update_model_metadata(&mut self)
Read metadata (layers, hidden size) from the model’s GGUF file.
Uses a single cache keyed by the model’s full path, so each unique model is parsed only once regardless of how many times it’s selected.
Source§impl App
impl App
Sourcepub fn is_panel_visible(&self, index: u8) -> bool
pub fn is_panel_visible(&self, index: u8) -> bool
Check if a panel is visible.
Sourcepub fn toggle_panel_visibility(&mut self, index: u8)
pub fn toggle_panel_visibility(&mut self, index: u8)
Toggle visibility of a panel.
Sourcepub fn get_visible_panels(&self) -> Vec<ActivePanel>
pub fn get_visible_panels(&self) -> Vec<ActivePanel>
Return a list of all currently visible and focusable panels in logical order.
pub fn focus_next(&mut self)
pub fn focus_prev(&mut self)
Source§impl App
impl App
Sourcepub fn apply_profile(&mut self, profile: &Profile)
pub fn apply_profile(&mut self, profile: &Profile)
Apply a profile’s settings to the current settings.
Sourcepub fn resolve_system_prompt(&mut self)
pub fn resolve_system_prompt(&mut self)
Resolve system_prompt from the preset name.
Sourcepub fn save_current_as_profile(&mut self, name: &str)
pub fn save_current_as_profile(&mut self, name: &str)
Save the current settings as a new profile.
Sourcepub fn save_model_settings(&mut self)
pub fn save_model_settings(&mut self)
Save current settings as an override for the selected model.
Sourcepub fn is_settings_dirty(&self) -> bool
pub fn is_settings_dirty(&self) -> bool
Check if any LLM settings have been modified since last save.
Sourcepub fn settings_fingerprint(&self) -> u64
pub fn settings_fingerprint(&self) -> u64
Compute a fingerprint of the current settings for cache invalidation.
Sourcepub fn delete_profile(&mut self, selected_idx: usize) -> bool
pub fn delete_profile(&mut self, selected_idx: usize) -> bool
Delete a user profile by index in the merged display list. Returns true if a profile was deleted, false otherwise.
pub fn get_api_port_str(&self) -> String
Source§impl App
impl App
pub fn add_log(&mut self, message: impl Into<String>, level: LogLevel)
pub fn handle_server_exit(&mut self)
pub fn is_model_loaded(&self, display_name: &str) -> bool
Sourcepub fn reset_loading_state(&mut self, is_crash: bool)
pub fn reset_loading_state(&mut self, is_crash: bool)
Reset loading state (progress bar and model status) on failure.
pub fn tick_spinner(&mut self)
pub fn is_loading(&self) -> bool
Source§impl App
impl App
pub fn render<T: Backend>(&mut self, terminal: &mut Terminal<T>) -> Result<()>
pub fn discover_models(dirs: &[PathBuf]) -> Vec<DiscoveredModel>
pub fn reset_to_defaults(&mut self)
pub fn selected_model(&self) -> Option<&DiscoveredModel>
pub fn selected_model_settings(&self) -> ModelSettings
pub fn on_model_selection_change(&mut self)
Sourcepub fn search_results_len(&self) -> usize
pub fn search_results_len(&self) -> usize
Return the current number of search results.
pub fn get_filtered_model_indices(&self) -> Vec<usize>
Source§impl App
impl App
pub fn tick_text_scrolls(&mut self)
pub fn init_scrolls_for_models(&mut self)
pub fn get_scroll_state(&self, key: &str) -> Option<&TextScrollState>
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl !UnwindSafe for App
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more