Adds tags and ps methods

This commit is contained in:
2025-12-23 22:04:38 +00:00
parent 4b96a0b9dc
commit 8a0c10c6fc
14 changed files with 2042 additions and 3 deletions

16
examples/ps.rs Normal file
View File

@@ -0,0 +1,16 @@
use std::{env, error::Error};
use ollama_rs::OllamaClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
tracing_subscriber::fmt().init();
let _ = dotenvy::dotenv();
let server_address = env::var("OLLAMA_SERVER")?;
let ollama_client = OllamaClient::new(server_address);
let models = ollama_client.list_runnning_models().await?;
for model in models {
println!("{:?}", model);
}
Ok(())
}