feat: first time automated ollama install experience and openrouter (#3881)

Co-authored-by: Zane Staggs <zane@squareup.com>
This commit is contained in:
Michael Neale
2025-08-08 11:41:53 +10:00
committed by GitHub
parent 43d6d1a492
commit e124bb084f
9 changed files with 1444 additions and 10 deletions
@@ -14,7 +14,7 @@ use tokio::sync::oneshot;
use tokio::time::timeout;
/// Default models for openrouter config configuration
const OPENROUTER_DEFAULT_MODEL: &str = "qwen/qwen3-coder";
const OPENROUTER_DEFAULT_MODEL: &str = "anthropic/claude-sonnet-4";
const OPENROUTER_AUTH_URL: &str = "https://openrouter.ai/auth";
const OPENROUTER_TOKEN_URL: &str = "https://openrouter.ai/api/v1/auth/keys";
+6
View File
@@ -202,6 +202,12 @@ fn create_request_based_on_model(
payload = update_request_for_anthropic(&payload);
}
// Always add transforms: ["middle-out"] for OpenRouter to handle prompts > context size
payload
.as_object_mut()
.unwrap()
.insert("transforms".to_string(), json!(["middle-out"]));
Ok(payload)
}