Public Rust SDK for arknet.
Provides an async Client with OpenAI-compatible methods:
chat_completion— non-streaming completionschat_completion_stream— streaming SSE completionslist_models— query the on-chain model registry
Example
# async
Public Rust SDK for arknet.
Provides an async Client with OpenAI-compatible methods:
chat_completion — non-streaming completionschat_completion_stream — streaming SSE completionslist_models — query the on-chain model registry# async fn demo() -> arknet_sdk::Result<()> {
let client = arknet_sdk::Client::new("http://127.0.0.1:3000")?;
let resp = client.chat_completion(arknet_sdk::ChatRequest {
model: "meta-llama/Llama-3-8B".into(),
messages: vec![arknet_sdk::Message {
role: "user".into(),
content: "Hello!".into(),
}],
max_tokens: Some(64),
..Default::default()
}).await?;
println!("{}", resp.choices[0].message.content);
# Ok(())
# }