Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Improve custom bedrock model support (#64953)

mpyuglgwkxcmodyrpo7ea5428f0c1d
diff --git a/crates/bedrock/src/models.rs b/crates/bedrock/src/models.rs
index a5cc56a841f..45b04b5770e 100644
--- a/crates/bedrock/src/models.rs
+++ b/crates/bedrock/src/models.rs
@@ -44,6 +44,17 @@ pub struct BedrockModelCacheConfiguration {
pub min_total_token: u64,
}
+#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
+#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)]
+pub struct BedrockThinkingConfig {
+ #[serde(default)]
+ pub adaptive: bool,
+ #[serde(default)]
+ pub has_xhigh: bool,
+ #[serde(default)]
+ pub budget_tokens: Option<u64>,
+}
+
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, EnumIter)]
pub enum ConverseModel {
@@ -231,6 +242,12 @@ pub enum ConverseModel {
max_output_tokens: Option<u64>,
default_temperature: Option<f32>,
cache_configuration: Option<BedrockModelCacheConfiguration>,
+ #[serde(default)]
+ supports_tool_use: Option<bool>,
+ #[serde(default)]
+ supports_images: Option<bool>,
+ #[serde(default)]
+ thinking: Option<BedrockThinkingConfig>,
},
}
@@ -514,25 +531,13 @@ impl ConverseModel {
}
}
- pub fn default_temperature(&self) -> f32 {
+ pub fn default_temperature(&self) -> Option<f32> {
match self {
- Self::ClaudeFable5
- | Self::ClaudeOpus5
- | Self::ClaudeOpus4_8
- | Self::ClaudeOpus4_7
- | Self::ClaudeOpus4_6
- | Self::ClaudeOpus4_5
- | Self::ClaudeOpus4_1
- | Self::ClaudeSonnet5
- | Self::ClaudeSonnet4_6
- | Self::ClaudeSonnet4_5
- | Self::ClaudeSonnet4
- | Self::ClaudeHaiku4_5 => 1.0,
Self::Custom {
default_temperature,
..
- } => default_temperature.unwrap_or(1.0),
- _ => 1.0,
+ } => *default_temperature,
+ _ => Some(1.0),
}
}
@@ -567,6 +572,9 @@ impl ConverseModel {
Self::GLM5 | Self::GLM4_7 | Self::GLM4_7Flash => true,
Self::KimiK2Thinking | Self::KimiK2_5 => true,
Self::DeepSeekR1 | Self::DeepSeekV3_1 | Self::DeepSeekV3_2 => true,
+ Self::Custom {
+ supports_tool_use, ..
+ } => supports_tool_use.unwrap_or(false),
_ => false,
}
}
@@ -589,6 +597,9 @@ impl ConverseModel {
Self::PixtralLarge => true,
Self::Qwen3VL235B => true,
Self::KimiK2_5 => true,
+ Self::Custom {
+ supports_images, ..
+ } => supports_images.unwrap_or(false),
_ => false,
}
}
@@ -616,44 +627,69 @@ impl ConverseModel {
}
pub fn supports_thinking(&self) -> bool {
- matches!(
- self,
+ match self {
Self::ClaudeFable5
- | Self::ClaudeOpus5
- | Self::ClaudeOpus4_8
- | Self::ClaudeOpus4_7
- | Self::ClaudeOpus4_6
- | Self::ClaudeOpus4_5
- | Self::ClaudeOpus4_1
- | Self::ClaudeSonnet5
- | Self::ClaudeSonnet4_6
- | Self::ClaudeSonnet4_5
- | Self::ClaudeSonnet4
- | Self::ClaudeHaiku4_5
- )
+ | Self::ClaudeOpus5
+ | Self::ClaudeOpus4_8
+ | Self::ClaudeOpus4_7
+ | Self::ClaudeOpus4_6
+ | Self::ClaudeOpus4_5
+ | Self::ClaudeOpus4_1
+ | Self::ClaudeSonnet5
+ | Self::ClaudeSonnet4_6
+ | Self::ClaudeSonnet4_5
+ | Self::ClaudeSonnet4
+ | Self::ClaudeHaiku4_5 => true,
+ Self::Custom { thinking, .. } => thinking.is_some(),
+ _ => false,
+ }
}
pub fn supports_adaptive_thinking(&self) -> bool {
- matches!(
- self,
+ match self {
Self::ClaudeFable5
- | Self::ClaudeOpus5
- | Self::ClaudeOpus4_8
- | Self::ClaudeOpus4_7
- | Self::ClaudeOpus4_6
- | Self::ClaudeSonnet5
- | Self::ClaudeSonnet4_6
- )
+ | Self::ClaudeOpus5
+ | Self::ClaudeOpus4_8
+ | Self::ClaudeOpus4_7
+ | Self::ClaudeOpus4_6
+ | Self::ClaudeSonnet5
+ | Self::ClaudeSonnet4_6 => true,
+ Self::Custom { thinking, .. } => {
+ thinking.as_ref().is_some_and(|thinking| thinking.adaptive)
+ }
+ _ => false,
+ }
}
pub fn supports_xhigh_adaptive_thinking(&self) -> bool {
- matches!(
- self,
- Self::ClaudeFable5 | Self::ClaudeOpus5 | Self::ClaudeOpus4_8 | Self::ClaudeSonnet5
- )
+ match self {
+ Self::ClaudeFable5 | Self::ClaudeOpus5 | Self::ClaudeOpus4_8 | Self::ClaudeSonnet5 => {
+ true
+ }
+ Self::Custom { thinking, .. } => {
+ thinking.as_ref().is_some_and(|thinking| thinking.has_xhigh)
+ }
+ _ => false,
+ }
}
pub fn thinking_mode(&self) -> BedrockModelMode {
+ if let Self::Custom {
+ thinking: Some(thinking),
+ ..
+ } = self
+ {
+ return if thinking.adaptive {
+ BedrockModelMode::AdaptiveThinking {
+ effort: BedrockAdaptiveThinkingEffort::default(),
+ }
+ } else {
+ BedrockModelMode::Thinking {
+ budget_tokens: Some(thinking.budget_tokens.unwrap_or(4096)),
+ }
+ };
+ }
+
if self.supports_adaptive_thinking() {
BedrockModelMode::AdaptiveThinking {
effort: BedrockAdaptiveThinkingEffort::default(),
@@ -673,6 +709,10 @@ impl ConverseModel {
allow_global: bool,
) -> anyhow::Result<String> {
let model_id = self.request_id();
+ // custom models return the name exactly
+ if matches!(self, Self::Custom { .. }) {
+ return Ok(model_id.into());
+ }
let supports_global = matches!(
self,
@@ -736,8 +776,6 @@ impl ConverseModel {
};
match (self, region_group) {
- (Self::Custom { .. }, _) => Ok(model_id.into()),
-
// Global inference profiles
(
Self::ClaudeFable5
@@ -1390,6 +1428,9 @@ mod tests {
max_output_tokens: Some(8192),
default_temperature: Some(0.7),
cache_configuration: None,
+ supports_tool_use: None,
+ supports_images: None,
+ thinking: None,
};
assert_eq!(
@@ -1400,6 +1441,75 @@ mod tests {
custom_model.cross_region_inference_id("eu-west-1", true)?,
"custom.my-model-v1:0"
);
+
+ let prefixed = ConverseModel::Custom {
+ name: "us.anthropic.claude-sonnet-4-7".to_string(),
+ max_tokens: 200_000,
+ display_name: None,
+ max_output_tokens: None,
+ default_temperature: None,
+ cache_configuration: None,
+ supports_tool_use: None,
+ supports_images: None,
+ thinking: None,
+ };
+ assert_eq!(
+ prefixed.cross_region_inference_id("us-east-1", false)?,
+ "us.anthropic.claude-sonnet-4-7"
+ );
+ assert_eq!(
+ prefixed.cross_region_inference_id("eu-west-1", false)?,
+ "us.anthropic.claude-sonnet-4-7"
+ );
+
+ let unprefixed = ConverseModel::Custom {
+ name: "anthropic.claude-sonnet-4-7".to_string(),
+ max_tokens: 200_000,
+ display_name: None,
+ max_output_tokens: None,
+ default_temperature: None,
+ cache_configuration: None,
+ supports_tool_use: None,
+ supports_images: None,
+ thinking: None,
+ };
+ assert_eq!(
+ unprefixed.cross_region_inference_id("us-east-1", false)?,
+ "anthropic.claude-sonnet-4-7"
+ );
+
+ let grok = ConverseModel::Custom {
+ name: "xai.grok-4.6".to_string(),
+ max_tokens: 500_000,
+ display_name: None,
+ max_output_tokens: None,
+ default_temperature: None,
+ cache_configuration: None,
+ supports_tool_use: None,
+ supports_images: None,
+ thinking: None,
+ };
+ assert_eq!(
+ grok.cross_region_inference_id("us-east-1", false)?,
+ "xai.grok-4.6"
+ );
+
+ let arn = ConverseModel::Custom {
+ name: "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc"
+ .to_string(),
+ max_tokens: 200_000,
+ display_name: None,
+ max_output_tokens: None,
+ default_temperature: None,
+ cache_configuration: None,
+ supports_tool_use: None,
+ supports_images: None,
+ thinking: None,
+ };
+ assert_eq!(
+ arn.cross_region_inference_id("us-east-1", false)?,
+ "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc"
+ );
Ok(())
}
@@ -1553,4 +1663,131 @@ mod tests {
assert!(!ConverseModel::Llama4Scout17B.supports_caching());
assert!(!ConverseModel::NovaPro.supports_caching());
}
+
+ fn custom_model(
+ supports_tool_use: Option<bool>,
+ supports_images: Option<bool>,
+ thinking: Option<BedrockThinkingConfig>,
+ ) -> ConverseModel {
+ ConverseModel::Custom {
+ name: "us.anthropic.claude-custom-v1:0".to_string(),
+ max_tokens: 200_000,
+ display_name: Some("Custom Claude".to_string()),
+ max_output_tokens: Some(8192),
+ default_temperature: None,
+ cache_configuration: None,
+ supports_tool_use,
+ supports_images,
+ thinking,
+ }
+ }
+
+ #[test]
+ fn test_custom_model_defaults_disable_optional_capabilities() {
+ let model = custom_model(None, None, None);
+ assert!(!model.supports_tool_use());
+ assert!(!model.supports_images());
+ assert!(!model.supports_thinking());
+ assert!(!model.supports_adaptive_thinking());
+ assert!(!model.supports_xhigh_adaptive_thinking());
+ assert_eq!(model.thinking_mode(), BedrockModelMode::Default);
+ assert_eq!(model.default_temperature(), None);
+ assert_eq!(
+ ConverseModel::ClaudeSonnet4_5.default_temperature(),
+ Some(1.0)
+ );
+ }
+
+ #[test]
+ fn test_custom_model_optional_capabilities() {
+ let model = custom_model(
+ Some(true),
+ Some(true),
+ Some(BedrockThinkingConfig {
+ adaptive: false,
+ has_xhigh: false,
+ budget_tokens: None,
+ }),
+ );
+ assert!(model.supports_tool_use());
+ assert!(model.supports_images());
+ assert!(model.supports_thinking());
+ assert!(!model.supports_adaptive_thinking());
+ assert_eq!(
+ model.thinking_mode(),
+ BedrockModelMode::Thinking {
+ budget_tokens: Some(4096)
+ }
+ );
+ }
+
+ #[test]
+ fn test_custom_model_thinking_budget_tokens() {
+ let model = custom_model(
+ None,
+ None,
+ Some(BedrockThinkingConfig {
+ adaptive: false,
+ has_xhigh: false,
+ budget_tokens: Some(8192),
+ }),
+ );
+ assert!(model.supports_thinking());
+ assert_eq!(
+ model.thinking_mode(),
+ BedrockModelMode::Thinking {
+ budget_tokens: Some(8192)
+ }
+ );
+ }
+
+ #[test]
+ fn test_custom_model_adaptive_thinking() {
+ let model = custom_model(
+ None,
+ None,
+ Some(BedrockThinkingConfig {
+ adaptive: true,
+ has_xhigh: false,
+ budget_tokens: None,
+ }),
+ );
+ assert!(model.supports_thinking());
+ assert!(model.supports_adaptive_thinking());
+ assert!(!model.supports_xhigh_adaptive_thinking());
+ assert_eq!(
+ model.thinking_mode(),
+ BedrockModelMode::AdaptiveThinking {
+ effort: BedrockAdaptiveThinkingEffort::High
+ }
+ );
+
+ let model = custom_model(
+ None,
+ None,
+ Some(BedrockThinkingConfig {
+ adaptive: true,
+ has_xhigh: true,
+ budget_tokens: None,
+ }),
+ );
+ assert!(model.supports_xhigh_adaptive_thinking());
+ }
+
+ #[test]
+ fn test_custom_model_legacy_config_deserializes() {
+ let model: ConverseModel = serde_json::from_value(serde_json::json!({
+ "custom": {
+ "name": "eu.anthropic.claude-new-v1:0",
+ "max_tokens": 200000
+ }
+ }))
+ .expect("legacy custom model config should deserialize");
+
+ assert_eq!(model.id(), "eu.anthropic.claude-new-v1:0");
+ assert!(!model.supports_tool_use());
+ assert!(!model.supports_images());
+ assert!(!model.supports_thinking());
+ assert_eq!(model.thinking_mode(), BedrockModelMode::Default);
+ }
}
diff --git a/crates/language_models/src/provider/bedrock.rs b/crates/language_models/src/provider/bedrock.rs
index 548fadf0099..f4bf4d883d3 100644
--- a/crates/language_models/src/provider/bedrock.rs
+++ b/crates/language_models/src/provider/bedrock.rs
@@ -175,6 +175,28 @@ impl From<settings::BedrockAuthMethodContent> for BedrockAuthMethod {
}
}
+fn thinking_from_settings(
+ thinking: Option<&settings::BedrockThinkingSettings>,
+) -> Option<bedrock::BedrockThinkingConfig> {
+ match thinking {
+ None | Some(settings::BedrockThinkingSettings::Enabled(false)) => None,
+ Some(settings::BedrockThinkingSettings::Enabled(true)) => {
+ Some(bedrock::BedrockThinkingConfig {
+ adaptive: false,
+ has_xhigh: false,
+ budget_tokens: None,
+ })
+ }
+ Some(settings::BedrockThinkingSettings::Config(thinking)) => {
+ Some(bedrock::BedrockThinkingConfig {
+ adaptive: thinking.adaptive.unwrap_or(false),
+ has_xhigh: thinking.has_xhigh.unwrap_or(false),
+ budget_tokens: thinking.budget_tokens,
+ })
+ }
+ }
+}
+
fn mantle_protocol_from_settings(value: settings::BedrockMantleProtocolContent) -> MantleProtocol {
match value {
settings::BedrockMantleProtocolContent::ChatCompletions => MantleProtocol::ChatCompletions,
@@ -659,6 +681,9 @@ impl BedrockLanguageModelProvider {
min_total_token: config.min_total_token,
}
}),
+ supports_tool_use: model.supports_tools,
+ supports_images: model.supports_images,
+ thinking: thinking_from_settings(model.thinking.as_ref()),
},
);
}
@@ -1052,7 +1077,7 @@ impl BedrockLanguageModelProvider {
let request = match into_bedrock(
request,
- model_id,
+ model_id.clone(),
config.default_temperature(),
config.max_output_tokens(),
config.thinking_mode(),
@@ -1066,7 +1091,6 @@ impl BedrockLanguageModelProvider {
};
let request = self.stream_bedrock_request(request, cx);
- let display_name = config.display_name().to_string();
let executor = cx.background_executor().clone();
let future = request_limiter.stream(async move {
let response = request.await.map_err(|err| match err {
@@ -1076,10 +1100,7 @@ impl BedrockLanguageModelProvider {
PROVIDER_NAME,
None,
Some("ValidationException".to_string()),
- format!(
- "{display_name} is not available in {region}. \
- Try switching to a region where this model is supported."
- ),
+ format!("Bedrock rejected model ID `{model_id}` in {region}: {msg}"),
None,
ProviderErrorCategory::InvalidRequest,
)
@@ -2022,7 +2043,7 @@ fn deny_tool_use_events(
pub fn into_bedrock(
request: LanguageModelRequest,
model: String,
- default_temperature: f32,
+ default_temperature: Option<f32>,
max_output_tokens: u64,
thinking_mode: BedrockModelMode,
supports_caching: bool,
@@ -2376,7 +2397,7 @@ pub fn into_bedrock(
thinking,
metadata: None,
stop_sequences: Vec::new(),
- temperature: request.temperature.or(Some(default_temperature)),
+ temperature: request.temperature.or(default_temperature),
top_k: None,
top_p: None,
guardrail_identifier,
@@ -2961,7 +2982,7 @@ mod tests {
..Default::default()
},
"claude-sonnet-4-5".to_string(),
- 1.0,
+ Some(1.0),
4096,
BedrockModelMode::Default,
true,
@@ -3027,6 +3048,101 @@ mod tests {
));
}
+ #[gpui::test]
+ fn custom_converse_model_capabilities_come_from_settings(cx: &mut gpui::TestAppContext) {
+ cx.update(|cx| {
+ let settings_store = SettingsStore::test(cx);
+ cx.set_global(settings_store);
+ gpui_tokio::init(cx);
+ let content = serde_json::json!({
+ "language_models": {
+ "bedrock": {
+ "available_models": [{
+ "name": "us.anthropic.claude-custom-v1:0",
+ "display_name": "Custom Claude",
+ "max_tokens": 200000,
+ "supports_tools": true,
+ "supports_images": true,
+ "thinking": {
+ "budget_tokens": 8192
+ }
+ }],
+ }
+ }
+ })
+ .to_string();
+ cx.update_global::<SettingsStore, _>(|store, cx| {
+ store
+ .set_user_settings(&content, cx)
+ .expect("test settings should parse");
+ });
+ });
+ let provider = cx.update(|cx| {
+ BedrockLanguageModelProvider::new(
+ http_client::FakeHttpClient::with_404_response(),
+ Arc::new(NoCredentialsProvider),
+ cx,
+ )
+ });
+
+ let custom = cx
+ .update(|cx| provider.provided_models(cx))
+ .into_iter()
+ .find(|model| model.id.0.as_ref() == "us.anthropic.claude-custom-v1:0")
+ .expect("custom converse model should be offered");
+ assert!(custom.supports_tools);
+ assert!(custom.supports_images);
+ assert!(custom.supports_thinking);
+
+ let config = cx
+ .update(|cx| provider.config(&custom, cx))
+ .expect("the offered model should resolve");
+ match config {
+ BedrockModelConfig::Converse(model) => {
+ assert!(model.supports_tool_use());
+ assert!(model.supports_images());
+ assert!(model.supports_thinking());
+ assert_eq!(
+ model.thinking_mode(),
+ BedrockModelMode::Thinking {
+ budget_tokens: Some(8192)
+ }
+ );
+ }
+ BedrockModelConfig::Mantle(_) => panic!("expected a converse model"),
+ }
+ }
+
+ #[test]
+ fn thinking_settings_accept_bool_or_object() {
+ assert_eq!(
+ thinking_from_settings(Some(&settings::BedrockThinkingSettings::Enabled(true))),
+ Some(bedrock::BedrockThinkingConfig {
+ adaptive: false,
+ has_xhigh: false,
+ budget_tokens: None,
+ })
+ );
+ assert_eq!(
+ thinking_from_settings(Some(&settings::BedrockThinkingSettings::Enabled(false))),
+ None
+ );
+ assert_eq!(
+ thinking_from_settings(Some(&settings::BedrockThinkingSettings::Config(
+ settings::BedrockThinkingConfigSettings {
+ adaptive: Some(true),
+ has_xhigh: Some(true),
+ budget_tokens: Some(10_000),
+ }
+ ))),
+ Some(bedrock::BedrockThinkingConfig {
+ adaptive: true,
+ has_xhigh: true,
+ budget_tokens: Some(10_000),
+ })
+ );
+ }
+
#[test]
fn environment_bearer_token_prefers_the_bedrock_variable_like_the_aws_sdk() {
let environment = |variables: &[(&str, &str)]| {
@@ -3240,7 +3356,7 @@ mod tests {
..Default::default()
},
model.to_string(),
- 1.0,
+ Some(1.0),
128_000,
BedrockModelMode::AdaptiveThinking {
effort: bedrock::BedrockAdaptiveThinkingEffort::High,
@@ -3267,6 +3383,50 @@ mod tests {
}
}
+ #[test]
+ fn test_custom_models_omit_temperature_unless_configured() {
+ let messages = vec![LanguageModelRequestMessage {
+ role: Role::User,
+ content: vec![MessageContent::Text("Hi".into())],
+ cache: false,
+ reasoning_details: None,
+ }];
+
+ let omitted = into_bedrock(
+ LanguageModelRequest {
+ messages: messages.clone(),
+ ..Default::default()
+ },
+ "us.xai.grok-4.6".to_string(),
+ None,
+ 4096,
+ BedrockModelMode::Default,
+ false,
+ true,
+ None,
+ None,
+ )
+ .unwrap();
+ assert_eq!(omitted.temperature, None);
+
+ let configured = into_bedrock(
+ LanguageModelRequest {
+ messages,
+ ..Default::default()
+ },
+ "us.anthropic.claude-sonnet-4-7".to_string(),
+ Some(0.7),
+ 4096,
+ BedrockModelMode::Default,
+ false,
+ true,
+ None,
+ None,
+ )
+ .unwrap();
+ assert_eq!(configured.temperature, Some(0.7));
+ }
+
#[test]
fn test_cache_marked_message_that_filters_to_empty_is_dropped() {
let request = into_bedrock_request(vec![
diff --git a/crates/settings_content/src/language_model.rs b/crates/settings_content/src/language_model.rs
index 94d49f90eca..68078725e96 100644
--- a/crates/settings_content/src/language_model.rs
+++ b/crates/settings_content/src/language_model.rs
@@ -142,7 +142,24 @@ pub struct BedrockAvailableModel {
pub max_output_tokens: Option<u64>,
#[serde(serialize_with = "crate::serialize_optional_f32_with_two_decimal_places")]
pub default_temperature: Option<f32>,
- pub mode: Option<ModelMode>,
+ pub supports_tools: Option<bool>,
+ pub supports_images: Option<bool>,
+ pub thinking: Option<BedrockThinkingSettings>,
+}
+
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)]
+#[serde(untagged)]
+pub enum BedrockThinkingSettings {
+ Enabled(bool),
+ Config(BedrockThinkingConfigSettings),
+}
+
+#[with_fallible_options]
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)]
+pub struct BedrockThinkingConfigSettings {
+ pub adaptive: Option<bool>,
+ pub has_xhigh: Option<bool>,
+ pub budget_tokens: Option<u64>,
}
#[with_fallible_options]
diff --git a/docs/src/ai/use-a-gateway.md b/docs/src/ai/use-a-gateway.md
index 111de74b109..909d4029f0a 100644
--- a/docs/src/ai/use-a-gateway.md
+++ b/docs/src/ai/use-a-gateway.md
@@ -213,6 +213,45 @@ Some AWS environments require a guardrail on every Bedrock API call. Add `guardr
}
```
+### Custom Bedrock Models {#bedrock-custom-models}
+
+Add models that are not yet built into Zed with `available_models`. Use the Bedrock model ID as `name`, including a region prefix when you want a specific inference profile:
+
+```json [settings]
+{
+ "language_models": {
+ "bedrock": {
+ "available_models": [
+ {
+ "name": "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abcdef123456",
+ "display_name": "Grok 4.3 (ARN)",
+ "max_tokens": 500000,
+ "max_output_tokens": 131072,
+ "supports_tools": true,
+ "supports_images": true,
+ "thinking": true
+ },
+ {
+ "name": "us.moonshotai.kimi-k3",
+ "display_name": "Kimi K3",
+ "max_tokens": 1000000,
+ "max_output_tokens": 64000,
+ "supports_tools": true,
+ "supports_images": true,
+ "thinking": {
+ "adaptive": true,
+ "has_xhigh": true,
+ "budget_tokens": 5000
+ }
+ }
+ ]
+ }
+ }
+}
+```
+
+`name` is sent to Bedrock as the model ID. Use the full ID, including a geo prefix or ARN when the model requires one (for example `us.anthropic.claude-sonnet-4-7` or `us.xai.grok-4.6`). Set `supports_tools` and `supports_images` for models that support those features. Set `thinking` to `true` to enable thinking, or to an object with `"adaptive": true`, optional `"has_xhigh": true`, and optional `budget_tokens`. Leave `default_temperature` unset for models that reject the temperature field, such as xAI and MoonshotAI models.
+
### Bedrock Mantle Models {#bedrock-mantle-models}
Some models, such as the GPT-5.6 family (Sol, Terra, and Luna), GPT-5.5, GPT-5.4, and Grok 4.3, aren't available through Bedrock's Converse API and are only reachable through `bedrock-mantle`, AWS's OpenAI-compatible inference endpoint. Zed routes these models through `bedrock-mantle` automatically; they appear alongside the rest of the Bedrock models in the model picker once you're authenticated, with no extra configuration required.