Skip to content

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

refactor(inference): update custom provider string formatting

Steven Enamakel76bdc620b7ef
diff --git a/crates/openhuman-core/src/inference/embedding_host/factory.rs b/crates/openhuman-core/src/inference/embedding_host/factory.rs
index b125473646..f322b79a1c 100644
--- a/crates/openhuman-core/src/inference/embedding_host/factory.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/factory.rs
@@ -3,6 +3,7 @@
use std::sync::Arc;
use crate::config::Config;
+use tinyinference_providers::route::custom_provider_string;
use tinyinference_embeddings::factory::{
create_configured_embedding_model, create_default_embedding_model, CredentialResolver,
EmbeddingFactorySettings, ManagedModelFactory,
@@ -64,7 +65,7 @@ pub fn create_embedding_provider_with_credentials(
) -> anyhow::Result<Box<dyn EmbeddingModel>> {
let provider = custom_endpoint
.filter(|_| provider == "custom")
- .map(|endpoint| format!("custom:{endpoint}"))
+ .map(|endpoint| custom_provider_string("custom", Some(endpoint)))
.unwrap_or_else(|| provider.to_owned());
let api_key = api_key.to_owned();
let credentials: CredentialResolver = Arc::new(move |_| api_key.clone());
@@ -132,7 +133,7 @@ pub fn create_embedding_provider_for_chat(
) -> anyhow::Result<Box<dyn EmbeddingModel>> {
let provider = custom_endpoint
.filter(|_| provider == "custom")
- .map(|endpoint| format!("custom:{endpoint}"))
+ .map(|endpoint| custom_provider_string("custom", Some(endpoint)))
.unwrap_or_else(|| provider.to_owned());
let selected = settings(
&provider,
diff --git a/crates/openhuman-core/src/inference/http/backend_tests.rs b/crates/openhuman-core/src/inference/http/backend_tests.rs
index 24b3213759..dc2935d433 100644
--- a/crates/openhuman-core/src/inference/http/backend_tests.rs
+++ b/crates/openhuman-core/src/inference/http/backend_tests.rs
@@ -23,3 +23,15 @@ fn configured_models_lists_sentinel_and_strips_temperature_suffix() {
assert!(ids.contains(&"acme:claude".to_string()));
assert!(ids.contains(&"ollama:qwen".to_string()));
}
+
+#[test]
+fn configured_managed_default_keeps_colon_bearing_model_owner() {
+ let config = Config {
+ default_model: Some("qwen3:14b".to_string()),
+ ..Config::default()
+ };
+ let listed = configured_models(&config);
+ assert!(listed.iter().any(|model| {
+ model.id == "qwen3:14b" && model.owned_by == "openhuman"
+ }));
+}