@@ -455,6 +455,63 @@ describe("buildConfigModels", () => {
455455 } ) ;
456456 } ) ;
457457
458+ it ( "merges Moonshot AI with OpenCode's built-in provider" , ( ) => {
459+ const modelsDevData = {
460+ moonshotai : {
461+ models : {
462+ "kimi-k3" : {
463+ id : "kimi-k3" ,
464+ name : "Kimi K3" ,
465+ limit : { context : 1048576 , output : 131072 } ,
466+ attachment : true ,
467+ reasoning : true ,
468+ temperature : false ,
469+ tool_call : true ,
470+ interleaved : { field : "reasoning_content" } ,
471+ modalities : {
472+ input : [ "text" , "image" , "video" ] ,
473+ output : [ "text" ] ,
474+ } ,
475+ cost : { input : 3 , output : 15 , cache_read : 0.3 } ,
476+ } ,
477+ } ,
478+ } ,
479+ } ;
480+ const hubData = {
481+ providers : {
482+ moonshotai : {
483+ models : {
484+ "kimi-k3" : { display_name : "Kimi K3 from Hub" } ,
485+ } ,
486+ } ,
487+ } ,
488+ } ;
489+
490+ const { models, warnings } = buildConfigModels ( modelsDevData , hubData ) ;
491+
492+ expect ( warnings ) . toEqual ( [ ] ) ;
493+ expect ( models [ "kimi-k3" ] ) . toEqual ( {
494+ id : "kimi-k3" ,
495+ name : "Kimi K3" ,
496+ provider : {
497+ api : "https://hub.coreinfra.ai/openai/api/v1" ,
498+ npm : "@ai-sdk/openai-compatible" ,
499+ } ,
500+ attachment : true ,
501+ reasoning : true ,
502+ temperature : false ,
503+ tool_call : true ,
504+ modalities : {
505+ input : [ "text" , "image" , "video" ] ,
506+ output : [ "text" ] ,
507+ } ,
508+ cost : { input : 3 , output : 15 , cache_read : 0.3 , cache_write : 0 } ,
509+ limit : { context : 1048576 , output : 131072 } ,
510+ interleaved : { field : "reasoning_content" } ,
511+ headers : { } ,
512+ } ) ;
513+ } ) ;
514+
458515 it ( "uses Responses API for openai but Chat Completions for zai" , ( ) => {
459516 const modelsDevData = {
460517 openai : { models : { "gpt-x" : { name : "GPT X" } } } ,
0 commit comments