Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions codex-rs/model-provider/src/amazon_bedrock/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,28 @@ pub(crate) fn static_model_catalog() -> ModelsResponse {
gpt_5_bedrock_model(
GPT_5_5_OPENAI_MODEL_ID,
AMAZON_BEDROCK_GPT_5_5_MODEL_ID,
"GPT-5.5",
/*priority*/ 0,
),
gpt_5_bedrock_model(
GPT_5_4_OPENAI_MODEL_ID,
AMAZON_BEDROCK_GPT_5_4_MODEL_ID,
"GPT-5.4",
/*priority*/ 1,
),
gpt_5_6_bedrock_model(
AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID,
"Sol",
"GPT-5.6 Sol",
/*priority*/ 2,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the 5.6 models be the highest priority? In the Codex service it seems we put the 5.6 models at the top of the list (in Sol, Terra, Luna order)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good call!

),
gpt_5_6_bedrock_model(
AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID,
"Terra",
"GPT-5.6 Terra",
/*priority*/ 3,
),
gpt_5_6_bedrock_model(
AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID,
"Luna",
"GPT-5.6 Luna",
/*priority*/ 4,
),
],
Expand All @@ -55,9 +57,15 @@ pub(crate) fn with_default_only_service_tier(mut catalog: ModelsResponse) -> Mod
catalog
}

fn gpt_5_bedrock_model(openai_slug: &str, bedrock_slug: &str, priority: i32) -> ModelInfo {
fn gpt_5_bedrock_model(
openai_slug: &str,
bedrock_slug: &str,
display_name: &str,
priority: i32,
) -> ModelInfo {
let mut model = bundled_openai_model(openai_slug);
model.slug = bedrock_slug.to_string();
model.display_name = display_name.to_string();
model.priority = priority;
model.context_window = Some(GPT_5_BEDROCK_CONTEXT_WINDOW);
model.max_context_window = Some(GPT_5_BEDROCK_CONTEXT_WINDOW);
Expand All @@ -67,8 +75,12 @@ fn gpt_5_bedrock_model(openai_slug: &str, bedrock_slug: &str, priority: i32) ->
}

fn gpt_5_6_bedrock_model(bedrock_slug: &str, display_name: &str, priority: i32) -> ModelInfo {
let mut model = gpt_5_bedrock_model(GPT_5_5_OPENAI_MODEL_ID, bedrock_slug, priority);
model.display_name = display_name.to_string();
let mut model = gpt_5_bedrock_model(
GPT_5_5_OPENAI_MODEL_ID,
bedrock_slug,
display_name,
priority,
);
model
.supported_reasoning_levels
.push(ReasoningEffortPreset {
Expand Down Expand Up @@ -148,9 +160,9 @@ mod tests {
.expect("Bedrock catalog should include GPT-5.5");

for (slug, display_name, priority) in [
(AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID, "Sol", 2),
(AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID, "Terra", 3),
(AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID, "Luna", 4),
(AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID, "GPT-5.6 Sol", 2),
(AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID, "GPT-5.6 Terra", 3),
(AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID, "GPT-5.6 Luna", 4),
] {
let mut expected = gpt_5_5.clone();
expected.slug = slug.to_string();
Expand Down
16 changes: 8 additions & 8 deletions codex-rs/model-provider/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,20 +653,20 @@ mod tests {
provider.models_manager(test_codex_home(), /*config_model_catalog*/ None);

let catalog = manager.raw_model_catalog(RefreshStrategy::Online).await;
let model_ids = catalog
let models = catalog
.models
.iter()
.map(|model| model.slug.as_str())
.map(|model| (model.slug.as_str(), model.display_name.as_str()))
.collect::<Vec<_>>();

assert_eq!(
model_ids,
models,
vec![
"openai.gpt-5.5",
"openai.gpt-5.4",
"openai.gpt-5.6-sol",
"openai.gpt-5.6-terra",
"openai.gpt-5.6-luna",
("openai.gpt-5.5", "GPT-5.5"),
("openai.gpt-5.4", "GPT-5.4"),
("openai.gpt-5.6-sol", "GPT-5.6 Sol"),
("openai.gpt-5.6-terra", "GPT-5.6 Terra"),
("openai.gpt-5.6-luna", "GPT-5.6 Luna"),
]
);

Expand Down
Loading