aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichelle Tilley <michelle@michelletilley.net>2026-05-19 10:32:46 -0700
committerGitHub <noreply@github.com>2026-05-19 10:32:46 -0700
commit6ecbc8a5d88536a718de6370e1171d6f900dd39a (patch)
tree8dd5135685494a89c134298cebfef10a6c320f5e
parentdocs: Highlight `Ctrl-r` keybinding on docs page (#3489) (diff)
downloadatuin-6ecbc8a5d88536a718de6370e1171d6f900dd39a.zip
Allow overriding model with env var (#3493)
This PR allows overriding the Atuin AI model for feature-flagged users with the `ATUIN_AI__MODEL` environment variable. Any OpenRouter model is accepted; it's recommended to include an explicit `openrouter:` provider prefix, so models with colons in their names are interpreted correctly, e.g. `ATUIN_AI__MODEL=openrouter:deepseek/deepseek-v4-flash:free`.
-rw-r--r--crates/atuin-ai/src/stream.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/atuin-ai/src/stream.rs b/crates/atuin-ai/src/stream.rs
index d921b39c..084e8238 100644
--- a/crates/atuin-ai/src/stream.rs
+++ b/crates/atuin-ai/src/stream.rs
@@ -137,6 +137,13 @@ pub(crate) fn create_chat_stream(
}
}
+ if let Ok(model) = std::env::var("ATUIN_AI__MODEL")
+ && !model.trim().is_empty() {
+ config["model"] = serde_json::json!(model.trim());
+
+ }
+
+
let mut request_body = serde_json::json!({
"messages": request.messages,
"context": context,