pub struct LmsHarness {
pub binary_path: Option<PathBuf>,
}Expand description
LM Studio CLI Harness for automated lifecycle management. Ports the “LMS Mastery” patterns from Codex-RS to ensure Hematite can auto-start and auto-load models.
Fields§
§binary_path: Option<PathBuf>Implementations§
Source§impl LmsHarness
impl LmsHarness
pub fn new() -> Self
Sourcepub async fn is_server_responding(&self, base_url: &str) -> bool
pub async fn is_server_responding(&self, base_url: &str) -> bool
Check if the LM Studio server is responding on the expected port.
Sourcepub fn ensure_server_running(&self) -> Result<()>
pub fn ensure_server_running(&self) -> Result<()>
Attempt to start the LM Studio server if it’s not responding.
Sourcepub fn list_models(&self) -> Result<Vec<String>>
pub fn list_models(&self) -> Result<Vec<String>>
Get a list of models currently known to LM Studio.
Sourcepub fn list_loaded_models(&self) -> Result<Vec<String>>
pub fn list_loaded_models(&self) -> Result<Vec<String>>
Get a list of models currently loaded in memory.
Sourcepub fn load_model(&self, model_id: &str) -> Result<()>
pub fn load_model(&self, model_id: &str) -> Result<()>
Load a specific model into the server.
Sourcepub fn unload_model(&self, model_id: &str) -> Result<()>
pub fn unload_model(&self, model_id: &str) -> Result<()>
Unload a specific model from the server.
Sourcepub fn unload_all_models(&self) -> Result<()>
pub fn unload_all_models(&self) -> Result<()>
Unload all loaded models from the server.
Auto Trait Implementations§
impl Freeze for LmsHarness
impl RefUnwindSafe for LmsHarness
impl Send for LmsHarness
impl Sync for LmsHarness
impl Unpin for LmsHarness
impl UnsafeUnpin for LmsHarness
impl UnwindSafe for LmsHarness
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
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 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>
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