@@ -11,11 +11,15 @@ use crate::caps::{
1111 default_rejection_threshold, relative_to_full_url, normalize_string, resolve_relative_urls,
1212} ;
1313use crate :: caps:: providers;
14+ use crate :: llm:: WireFormat ;
1415
1516#[ derive( Debug , Deserialize , Clone , Default ) ]
1617pub struct SelfHostedCapsModelRecord {
1718 pub n_ctx : usize ,
1819
20+ #[ serde( default ) ]
21+ pub wire_format : WireFormat ,
22+
1923 #[ serde( default ) ]
2024 pub supports_scratchpads : HashMap < String , serde_json:: Value > ,
2125
@@ -218,22 +222,16 @@ impl SelfHostedCapsModelRecord {
218222 let mut base = BaseModelRecord {
219223 n_ctx : self . n_ctx ,
220224 enabled : true ,
225+ wire_format : self . wire_format ,
221226 ..Default :: default ( )
222227 } ;
223228
224229 let ( scratchpad, scratchpad_patch) = self . get_chat_scratchpad ( ) ;
225230
226- // Non passthrough models, don't support endpoints of `/v1/chat/completions` in openai style, only `/v1/completions`
227- let endpoint_to_use = if scratchpad == "PASSTHROUGH" {
228- & self_hosted_caps. chat . endpoint
229- } else {
230- & self_hosted_caps. completion . endpoint
231- } ;
232-
233231 configure_base_model (
234232 & mut base,
235233 model_name,
236- endpoint_to_use ,
234+ & self_hosted_caps . chat . endpoint ,
237235 & self_hosted_caps. cloud_name ,
238236 & self_hosted_caps. tokenizer_endpoints ,
239237 caps_url,
@@ -385,6 +383,7 @@ impl SelfHostedCaps {
385383 embedding_endpoint : self . embedding . endpoint . clone ( ) ,
386384 api_key : cmdline_api_key. to_string ( ) ,
387385 tokenizer_api_key : cmdline_api_key. to_string ( ) ,
386+ extra_headers : std:: collections:: HashMap :: new ( ) ,
388387 code_completion_n_ctx : 0 ,
389388 support_metadata : self . support_metadata ,
390389 completion_models : IndexMap :: new ( ) ,
0 commit comments