Skip to main content

App

Struct App 

Source
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: EditState

Implementations§

Source§

impl App

Source

pub async fn start_pending_download(&mut self)

Source

pub async fn start_pending_deletion(&mut self, path: PathBuf)

Source

pub fn start_pending_backend_deletion(&mut self, backend: Backend, tag: String)

Source

pub async fn poll_backend_resolution(&mut self)

Source

pub fn poll_download_progress(&mut self)

Source

pub fn poll_bench_tune_progress(&mut self)

Source

pub fn process_completed_downloads(&mut self)

Source

pub fn poll_server_logs(&mut self)

Source

pub fn poll_sync(&mut self)

Source

pub fn poll_metrics(&mut self)

Source

pub async fn poll_loading_completion(&mut self)

Source

pub async fn start_pending_spawn(&mut self)

Source

pub async fn poll_spawn_result(&mut self)

Source

pub async fn poll_bench_tune_result(&mut self)

Source

pub fn handle_pending_api_load(&mut self)

Source

pub fn handle_pending_api_unload(&mut self)

Source

pub async fn start_pending_kill(&mut self)

Source

pub fn update_metrics_model_name(&mut self)

Source

pub fn ensure_download_channel(&mut self) -> Sender<DownloadState>

Source

pub async fn update_ws_server(&mut self)

Source

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

Source

pub fn panel_help_lines(&self) -> Vec<Line<'static>>

Source§

impl App

Source

pub fn update_vram_estimate(&mut self)

Compute VRAM estimate from model file size and current settings.

Source

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

Source

pub fn is_panel_visible(&self, index: u8) -> bool

Check if a panel is visible.

Source

pub fn toggle_panel_visibility(&mut self, index: u8)

Toggle visibility of a panel.

Source

pub fn get_visible_panels(&self) -> Vec<ActivePanel>

Return a list of all currently visible and focusable panels in logical order.

Source

pub fn focus_next(&mut self)

Source

pub fn focus_prev(&mut self)

Source§

impl App

Source§

impl App

Source

pub fn apply_profile(&mut self, profile: &Profile)

Apply a profile’s settings to the current settings.

Source

pub fn resolve_system_prompt(&mut self)

Resolve system_prompt from the preset name.

Source

pub fn save_current_as_profile(&mut self, name: &str)

Save the current settings as a new profile.

Source

pub fn save_model_settings(&mut self)

Save current settings as an override for the selected model.

Source

pub fn is_settings_dirty(&self) -> bool

Check if any LLM settings have been modified since last save.

Source

pub fn settings_fingerprint(&self) -> u64

Compute a fingerprint of the current settings for cache invalidation.

Source

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.

Source

pub fn get_api_port_str(&self) -> String

Source§

impl App

Source

pub fn add_log(&mut self, message: impl Into<String>, level: LogLevel)

Source

pub fn handle_server_exit(&mut self)

Source

pub fn is_model_loaded(&self, display_name: &str) -> bool

Source

pub fn reset_loading_state(&mut self, is_crash: bool)

Reset loading state (progress bar and model status) on failure.

Source

pub fn tick_spinner(&mut self)

Source

pub fn is_loading(&self) -> bool

Source§

impl App

Source

pub fn render<T: Backend>(&mut self, terminal: &mut Terminal<T>) -> Result<()>

Source

pub fn discover_models(dirs: &[PathBuf]) -> Vec<DiscoveredModel>

Source

pub fn reset_to_defaults(&mut self)

Source

pub fn selected_model(&self) -> Option<&DiscoveredModel>

Source

pub fn selected_model_settings(&self) -> ModelSettings

Source

pub fn on_model_selection_change(&mut self)

Source

pub fn search_results_len(&self) -> usize

Return the current number of search results.

Source

pub fn get_filtered_model_indices(&self) -> Vec<usize>

Source§

impl App

Source

pub fn new(config: Config) -> Self

Source§

impl App

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<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,