notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 56534af698634c71f2330f8f6f737957af3c6543
parent 89b96aeab3a2f44597300ac58e7ae87e25f2be22
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 25 Mar 2025 12:47:02 -0700

dave: use local llama for testing for now

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mcrates/notedeck_dave/src/lib.rs | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs @@ -66,10 +66,11 @@ pub struct Dave { impl Dave { pub fn new(render_state: Option<&RenderState>) -> Self { - let mut config = OpenAIConfig::new(); + let mut config = OpenAIConfig::new().with_api_base("http://ollama.jb55.com/v1"); if let Ok(api_key) = std::env::var("OPENAI_API_KEY") { config = config.with_api_key(api_key); } + let client = Client::with_config(config); let input = "".to_string(); @@ -174,7 +175,8 @@ impl Dave { let mut token_stream = match client .chat() .create_stream(CreateChatCompletionRequest { - model: "gpt-4o".to_string(), + //model: "gpt-4o".to_string(), + model: "llama3.1:latest".to_string(), stream: Some(true), messages, user: Some(pubkey),