diff --git a/.envrc b/.envrc index 8c4b7db..0fe0cac 100644 --- a/.envrc +++ b/.envrc @@ -13,6 +13,8 @@ source scripts/macos_build_secrets.sh || : export PATH=$PATH:$HOME/.cargo/bin export JB55=32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245 +export OLLAMA_HOST=http://ollama.jb55.com + # simple todo reminders export TODO_FILE=TODO 2>/dev/null todo.sh ls || : diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs index 911a1ae..4dd0bf4 100644 --- a/crates/notedeck_dave/src/lib.rs +++ b/crates/notedeck_dave/src/lib.rs @@ -356,7 +356,7 @@ impl Default for ModelConfig { impl ModelConfig { pub fn ollama() -> Self { ModelConfig { - endpoint: std::env::var("OLLAMA_HOST").ok(), + endpoint: std::env::var("OLLAMA_HOST").ok().map(|h| h + "/v1"), model: "hhao/qwen2.5-coder-tools:latest".to_string(), api_key: None, } @@ -382,8 +382,8 @@ impl Dave { } pub fn new(render_state: Option<&RenderState>) -> Self { - //let mut config = OpenAIConfig::new(); //.with_api_base("http://ollama.jb55.com/v1"); let model_config = ModelConfig::default(); + //let model_config = ModelConfig::ollama(); let client = Client::with_config(model_config.to_api()); let input = "".to_string();