@@ -7067,22 +7067,22 @@ export function supportsForcedToolUse(modelId: string): boolean {
70677067 return capabilities ?. forcedToolUse ?? capabilities ?. toolUsageControl ?? false
70687068}
70697069
7070- /** A self-hosted server's model ids as free , capability-less catalog entries. */
7071- function toSelfHostedModels ( models : string [ ] ) : ModelDefinition [ ] {
7070+ /** Discovered model ids as unpriced , capability-less catalog entries. */
7071+ function toUnpricedModels ( models : string [ ] ) : ModelDefinition [ ] {
70727072 const updatedAt = new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ]
70737073 return models . map ( ( id ) => ( { id, pricing : { input : 0 , output : 0 , updatedAt } , capabilities : { } } ) )
70747074}
70757075
70767076export function updateOllamaModels ( models : string [ ] ) : void {
7077- PROVIDER_DEFINITIONS . ollama . models = toSelfHostedModels ( models )
7077+ PROVIDER_DEFINITIONS . ollama . models = toUnpricedModels ( models )
70787078}
70797079
70807080export function updateVLLMModels ( models : string [ ] ) : void {
7081- PROVIDER_DEFINITIONS . vllm . models = toSelfHostedModels ( models )
7081+ PROVIDER_DEFINITIONS . vllm . models = toUnpricedModels ( models )
70827082}
70837083
70847084export function updateLiteLLMModels ( models : string [ ] ) : void {
7085- PROVIDER_DEFINITIONS . litellm . models = toSelfHostedModels ( models )
7085+ PROVIDER_DEFINITIONS . litellm . models = toUnpricedModels ( models )
70867086}
70877087
70887088/**
@@ -7098,66 +7098,24 @@ export function updateFireworksModels(models: string[]): void {
70987098 const staticIds = new Set ( STATIC_FIREWORKS_MODELS . map ( ( model ) => model . id . toLowerCase ( ) ) )
70997099 PROVIDER_DEFINITIONS . fireworks . models = [
71007100 ...STATIC_FIREWORKS_MODELS ,
7101- ...models
7102- . filter ( ( modelId ) => ! staticIds . has ( modelId . toLowerCase ( ) ) )
7103- . map ( ( modelId ) => ( {
7104- id : modelId ,
7105- pricing : {
7106- input : 0 ,
7107- output : 0 ,
7108- updatedAt : new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
7109- } ,
7110- capabilities : { } ,
7111- } ) ) ,
7101+ ...toUnpricedModels ( models . filter ( ( modelId ) => ! staticIds . has ( modelId . toLowerCase ( ) ) ) ) ,
71127102 ]
71137103}
71147104
71157105export function updateTogetherModels ( models : string [ ] ) : void {
7116- PROVIDER_DEFINITIONS . together . models = models . map ( ( modelId ) => ( {
7117- id : modelId ,
7118- pricing : {
7119- input : 0 ,
7120- output : 0 ,
7121- updatedAt : new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
7122- } ,
7123- capabilities : { } ,
7124- } ) )
7106+ PROVIDER_DEFINITIONS . together . models = toUnpricedModels ( models )
71257107}
71267108
71277109export function updateBasetenModels ( models : string [ ] ) : void {
7128- PROVIDER_DEFINITIONS . baseten . models = models . map ( ( modelId ) => ( {
7129- id : modelId ,
7130- pricing : {
7131- input : 0 ,
7132- output : 0 ,
7133- updatedAt : new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
7134- } ,
7135- capabilities : { } ,
7136- } ) )
7110+ PROVIDER_DEFINITIONS . baseten . models = toUnpricedModels ( models )
71377111}
71387112
71397113export function updateOllamaCloudModels ( models : string [ ] ) : void {
7140- PROVIDER_DEFINITIONS [ 'ollama-cloud' ] . models = models . map ( ( modelId ) => ( {
7141- id : modelId ,
7142- pricing : {
7143- input : 0 ,
7144- output : 0 ,
7145- updatedAt : new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
7146- } ,
7147- capabilities : { } ,
7148- } ) )
7114+ PROVIDER_DEFINITIONS [ 'ollama-cloud' ] . models = toUnpricedModels ( models )
71497115}
71507116
71517117export function updateOpenRouterModels ( models : string [ ] ) : void {
7152- PROVIDER_DEFINITIONS . openrouter . models = models . map ( ( modelId ) => ( {
7153- id : modelId ,
7154- pricing : {
7155- input : 0 ,
7156- output : 0 ,
7157- updatedAt : new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
7158- } ,
7159- capabilities : { } ,
7160- } ) )
7118+ PROVIDER_DEFINITIONS . openrouter . models = toUnpricedModels ( models )
71617119}
71627120
71637121export const EMBEDDING_MODEL_PRICING : Record < string , ModelPricing > = {
0 commit comments