aquafire / simple_llm.rs

Last active 6 months ago

Like 0

aquafire revised this gist 11 months ago · f418b11

1 file changed, 19 insertions

simple_llm.rs (file created)
@@ -0,0 +1,19 @@
1 + async fn main() -> Result<(), Box<dyn std::error::Error>> {
2 + let client = LlmClient::openai_with_base_url("", "http://192.168.0.11:1234")?;
3 +
4 + let models = client.models().await?;
5 + for model in models {
6 + println!("Available model: {}", model);
7 + }
8 +
9 + let request = ChatRequest {
10 + model: "qwen/qwen3-vl-30b".to_string(),
11 + messages: vec![Message::text(Role::User, "Привет! Развлеки меня")],
12 + ..Default::default()
13 + };
14 +
15 + let response = client.chat(&request).await?;
16 + println!("Response: {}", response.content);
17 +
18 + Ok(())
19 + }