Assume all LiteLLM models support native tools (#9736)

This commit is contained in:
Matt Rubens 2025-12-02 00:22:48 -05:00 committed by GitHub
parent 700fe42669
commit 6f0addfab7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 17 deletions

View file

@ -222,7 +222,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 200000,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: 3,
outputPrice: 15,
cacheWritesPrice: undefined,
@ -234,7 +234,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: 10,
outputPrice: 30,
cacheWritesPrice: undefined,
@ -305,7 +305,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 200000,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -318,7 +318,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 200000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -455,7 +455,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 200000,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -468,7 +468,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -533,7 +533,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 200000,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -546,7 +546,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -559,7 +559,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -673,7 +673,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 200000,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -687,7 +687,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,
@ -701,7 +701,7 @@ describe("getLiteLLMModels", () => {
contextWindow: 100000,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: false,
supportsNativeTools: true,
inputPrice: undefined,
outputPrice: undefined,
cacheWritesPrice: undefined,

View file

@ -45,11 +45,7 @@ export async function getLiteLLMModels(apiKey: string, baseUrl: string): Promise
contextWindow: modelInfo.max_input_tokens || 200000,
supportsImages: Boolean(modelInfo.supports_vision),
supportsPromptCache: Boolean(modelInfo.supports_prompt_caching),
supportsNativeTools: Boolean(
modelInfo.supports_function_calling ||
modelInfo.supports_tool_choice ||
modelInfo.supports_tool_use,
),
supportsNativeTools: true,
inputPrice: modelInfo.input_cost_per_token ? modelInfo.input_cost_per_token * 1000000 : undefined,
outputPrice: modelInfo.output_cost_per_token
? modelInfo.output_cost_per_token * 1000000