Skip to content

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

refactor(inference): adjust url formatting in catalog listing

Steven Enamakel753aef78d19b
diff --git a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
index 538747d07e..c97f6ef717 100644
--- a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
+++ b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
@@ -6,8 +6,8 @@
use super::super::openai_codex::resolve_openai_codex_routing;
use super::local_runtime::synthesize_local_runtime_entry;
use tinyinference_llm::catalog::{
- append_query_param, endpoint_hosts_models_listing, is_openrouter_provider,
- list_models, merge_openai_codex_model_hints, validate_openrouter_key, ModelInfo,
+ append_query_param, endpoint_hosts_models_listing, is_openrouter_provider, list_models,
+ merge_openai_codex_model_hints, validate_openrouter_key, ModelInfo,
};
use tinyinference_llm::model::discover::DiscoveryRequest;
use tinyinference_llm::providers::openai::codex::{
diff --git a/crates/openhuman-core/src/inference/provider/models/local_runtime.rs b/crates/openhuman-core/src/inference/provider/models/local_runtime.rs
index 624b76badf..b4f64acfb8 100644
--- a/crates/openhuman-core/src/inference/provider/models/local_runtime.rs
+++ b/crates/openhuman-core/src/inference/provider/models/local_runtime.rs
@@ -35,9 +35,10 @@ pub fn synthesize_local_runtime_entry(
}
_ => return None,
};
- let endpoint = tinyinference_local::provider::local_runtime_models_endpoint(slug, &runtime_base)?
- .strip_suffix("/models")?
- .to_string();
+ let endpoint =
+ tinyinference_local::provider::local_runtime_models_endpoint(slug, &runtime_base)?
+ .strip_suffix("/models")?
+ .to_string();
Some(CloudProviderCreds {
id: format!("synthetic_local_{slug}"),
diff --git a/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs b/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs
index bbf65e35ca..0a8fdeff44 100644
--- a/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs
+++ b/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs
@@ -134,7 +134,10 @@ pub(super) async fn list_models(
// session.
let session_attached = attach && session_token;
let mut discovery = DiscoveryRequest::new(
- format!("{}/openai/v1", effective_api_url(&config.api_url).trim_end_matches('/')),
+ format!(
+ "{}/openai/v1",
+ effective_api_url(&config.api_url).trim_end_matches('/')
+ ),
String::new(),
)
.with_listing_url(url.clone())
diff --git a/crates/openhuman-tinyhumans/src/inference/managed_catalog_tests.rs b/crates/openhuman-tinyhumans/src/inference/managed_catalog_tests.rs
index 05880553a2..f36a0c6314 100644
--- a/crates/openhuman-tinyhumans/src/inference/managed_catalog_tests.rs
+++ b/crates/openhuman-tinyhumans/src/inference/managed_catalog_tests.rs
@@ -8,7 +8,10 @@ use openhuman_embed::__host::security::credentials::{AuthService, APP_SESSION_PR
use std::sync::{Arc, Mutex};
use tempfile::TempDir;
-async fn catalog_server(status: StatusCode, body: &'static str) -> (String, Arc<Mutex<Vec<Option<String>>>>) {
+async fn catalog_server(
+ status: StatusCode,
+ body: &'static str,
+) -> (String, Arc<Mutex<Vec<Option<String>>>>) {
let authorization = Arc::new(Mutex::new(Vec::new()));
let captured = Arc::clone(&authorization);
let app = Router::new().route(
@@ -184,11 +187,8 @@ async fn managed_catalog_keeps_provider_key_401_as_a_provider_error() {
#[tokio::test]
async fn managed_catalog_does_not_infer_http_status_from_error_payload_text() {
- let (base_url, _authorization) = catalog_server(
- StatusCode::OK,
- r#"{"error":"401 session expired"}"#,
- )
- .await;
+ let (base_url, _authorization) =
+ catalog_server(StatusCode::OK, r#"{"error":"401 session expired"}"#).await;
let tmp = TempDir::new().unwrap();
let config = catalog_config(&tmp, &base_url);
crate::hosted::test_support::store_session(&config, "fixture-live-session");