Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(inference): update raw model checks to include workload roles

Steven Enamakel3c338e6a6949
diff --git a/crates/openhuman-core/src/inference/provider_model_tests.rs b/crates/openhuman-core/src/inference/provider_model_tests.rs
index 81130d175b..084d825573 100644
--- a/crates/openhuman-core/src/inference/provider_model_tests.rs
+++ b/crates/openhuman-core/src/inference/provider_model_tests.rs
@@ -18,6 +18,8 @@ fn abstract_hint_markers_do_not_become_raw_model_ids() {
assert!(is_abstract_model("missing-provider", "hint:unknown"));
assert!(!is_raw_model("missing-provider", "hint:unknown"));
assert!(is_raw_model("missing-provider", "vendor/model-id"));
+ assert!(!is_raw_model("missing-provider", "chat"));
+ assert!(!is_raw_model("missing-provider", "coding"));
assert_eq!(
role_for_provider_model("missing-provider", "hint:coding"),
"coding"
diff --git a/crates/openhuman-core/src/inference/registry.rs b/crates/openhuman-core/src/inference/registry.rs
index b49c20b832..7cdda7a9f4 100644
--- a/crates/openhuman-core/src/inference/registry.rs
+++ b/crates/openhuman-core/src/inference/registry.rs
@@ -233,6 +233,7 @@ pub fn provider_model_is_raw(provider_id: &str, model: &str) -> bool {
let model = model.trim();
!model.is_empty()
&& !model.starts_with("hint:")
+ && !crate::config::WORKLOAD_ROLES.contains(&model)
&& provider_model_hooks(provider_id).map_or(true, |hooks| (hooks.is_raw_model)(model))
}
diff --git a/crates/openhuman-tinyhumans/src/inference/tiers.rs b/crates/openhuman-tinyhumans/src/inference/tiers.rs
index f42c60a9e2..ec4a80f6d5 100644
--- a/crates/openhuman-tinyhumans/src/inference/tiers.rs
+++ b/crates/openhuman-tinyhumans/src/inference/tiers.rs
@@ -42,11 +42,18 @@ fn hint_role(model: &str) -> Option<&'static str> {
pub(crate) fn role_for_model(model: &str) -> Option<String> {
hint_role(model)
.or_else(|| legacy_tier_role(model))
+ .or_else(|| {
+ openhuman_embed::__host::config::WORKLOAD_ROLES
+ .contains(&model.trim())
+ .then(|| model.trim())
+ })
.map(str::to_string)
}
pub(crate) fn is_alias(model: &str) -> bool {
- hint_role(model).is_some() || legacy_tier_role(model).is_some()
+ hint_role(model).is_some()
+ || legacy_tier_role(model).is_some()
+ || openhuman_embed::__host::config::WORKLOAD_ROLES.contains(&model.trim())
}
pub(crate) fn is_raw_model(model: &str) -> bool {