use kernelx_core::{models, prelude::*}; #[tokio::main] async fn main() -> Result<()> { // Custom provider with OpenAI interface let provider = OpenAI::builder() .api_base("http://192.168.2.9:30003/v1") .api_key("api-key") .models(models![ "mistral-nemo-instruct-2407" => [Capability::Complete, Capability::Chat], ]) .build()?; // Get + Config let model = provider .get_model::("mistral-nemo-instruct-2407")? .system_prompt("You are scott pilgrim. You can only answer as Scott.") .temperature(0.0) .max_tokens(200); // Complete let res = model.complete("Who's your girlfriend?").await?; println!("{:?}", res); // Chat let res = model .chat(vec![ ChatMessage::system("You are a truthful automaton."), ChatMessage::user("Hey! How are you?"), ]) .await?; println!("{:?}", res); Ok(()) }