From e8dde5e4474f2bb033a44190b0784ab241f25e67 Mon Sep 17 00:00:00 2001 From: minpeter Date: Mon, 12 Jan 2026 20:46:25 +0900 Subject: [PATCH] feat(friendli): add variants support and filter tool_call models - Add variants field to model schema for reasoning toggle support - Add variants (enable_thinking on/off) to 5 models: Qwen3-32B, Qwen3-30B-A3B, EXAONE-4.0.1-32B, K-EXAONE-236B-A23B, GLM-4.6 - Filter out models without tool_call support in generator - Remove Llama-4-Scout and Llama-4-Maverick (tool_call=false) - Rename provider to FriendliAI --- packages/core/script/generate-friendli.ts | 8 +++++++- packages/core/src/schema.ts | 7 +++++++ .../models/LGAI-EXAONE/EXAONE-4.0.1-32B.toml | 8 +++++++- .../models/LGAI-EXAONE/K-EXAONE-236B-A23B.toml | 8 +++++++- .../friendli/models/Qwen/Qwen3-30B-A3B.toml | 8 +++++++- providers/friendli/models/Qwen/Qwen3-32B.toml | 8 +++++++- .../Llama-4-Maverick-17B-128E-Instruct.toml | 18 ------------------ .../Llama-4-Scout-17B-16E-Instruct.toml | 18 ------------------ providers/friendli/models/zai-org/GLM-4.6.toml | 8 +++++++- providers/friendli/provider.toml | 2 +- 10 files changed, 50 insertions(+), 43 deletions(-) delete mode 100644 providers/friendli/models/meta-llama/Llama-4-Maverick-17B-128E-Instruct.toml delete mode 100644 providers/friendli/models/meta-llama/Llama-4-Scout-17B-16E-Instruct.toml diff --git a/packages/core/script/generate-friendli.ts b/packages/core/script/generate-friendli.ts index 1b0735587..c9cfa2725 100644 --- a/packages/core/script/generate-friendli.ts +++ b/packages/core/script/generate-friendli.ts @@ -408,7 +408,13 @@ async function main() { process.exit(1); } - const apiModels = parsed.data.data; + const apiModels = parsed.data.data.filter((model) => { + if (!model.functionality.tool_call) { + console.log(`Skipping ${model.id}: tool_call not supported`); + return false; + } + return true; + }); // Get existing files (recursively) const existingFiles = new Set(); diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.ts index 2bcc14946..10c924369 100644 --- a/packages/core/src/schema.ts +++ b/packages/core/src/schema.ts @@ -75,6 +75,13 @@ export const Model = z api: z.string().optional(), }) .optional(), + variants: z + .record( + z.object({ + chat_template_kwargs: z.record(z.union([z.boolean(), z.string(), z.number()])).optional(), + }) + ) + .optional(), }) .strict() .refine( diff --git a/providers/friendli/models/LGAI-EXAONE/EXAONE-4.0.1-32B.toml b/providers/friendli/models/LGAI-EXAONE/EXAONE-4.0.1-32B.toml index a61fd84b0..66a7d141c 100644 --- a/providers/friendli/models/LGAI-EXAONE/EXAONE-4.0.1-32B.toml +++ b/providers/friendli/models/LGAI-EXAONE/EXAONE-4.0.1-32B.toml @@ -6,7 +6,7 @@ tool_call = true structured_output = true temperature = true release_date = "2025-07-31" -last_updated = "2025-12-23" +last_updated = "2026-01-12" open_weights = true [cost] @@ -20,3 +20,9 @@ output = 131_072 [modalities] input = ["text"] output = ["text"] + +[variants.off] +chat_template_kwargs = { enable_thinking = false } + +[variants.on] +chat_template_kwargs = { enable_thinking = true } diff --git a/providers/friendli/models/LGAI-EXAONE/K-EXAONE-236B-A23B.toml b/providers/friendli/models/LGAI-EXAONE/K-EXAONE-236B-A23B.toml index 6dedf0b88..58958648a 100644 --- a/providers/friendli/models/LGAI-EXAONE/K-EXAONE-236B-A23B.toml +++ b/providers/friendli/models/LGAI-EXAONE/K-EXAONE-236B-A23B.toml @@ -6,7 +6,7 @@ tool_call = true structured_output = true temperature = true release_date = "2025-12-31" -last_updated = "2026-01-08" +last_updated = "2026-01-12" open_weights = true [cost] @@ -20,3 +20,9 @@ output = 262_144 [modalities] input = ["text"] output = ["text"] + +[variants.off] +chat_template_kwargs = { enable_thinking = false } + +[variants.on] +chat_template_kwargs = { enable_thinking = true } diff --git a/providers/friendli/models/Qwen/Qwen3-30B-A3B.toml b/providers/friendli/models/Qwen/Qwen3-30B-A3B.toml index 4637edc7e..142d6a824 100644 --- a/providers/friendli/models/Qwen/Qwen3-30B-A3B.toml +++ b/providers/friendli/models/Qwen/Qwen3-30B-A3B.toml @@ -6,7 +6,7 @@ tool_call = true structured_output = true temperature = true release_date = "2025-06-16" -last_updated = "2025-12-23" +last_updated = "2026-01-12" open_weights = true [limit] @@ -16,3 +16,9 @@ output = 8_000 [modalities] input = ["text"] output = ["text"] + +[variants.off] +chat_template_kwargs = { enable_thinking = false } + +[variants.on] +chat_template_kwargs = { enable_thinking = true } diff --git a/providers/friendli/models/Qwen/Qwen3-32B.toml b/providers/friendli/models/Qwen/Qwen3-32B.toml index ffe5337b9..231d0500f 100644 --- a/providers/friendli/models/Qwen/Qwen3-32B.toml +++ b/providers/friendli/models/Qwen/Qwen3-32B.toml @@ -6,7 +6,7 @@ tool_call = true structured_output = true temperature = true release_date = "2025-06-16" -last_updated = "2025-12-23" +last_updated = "2026-01-12" open_weights = true [limit] @@ -16,3 +16,9 @@ output = 8_000 [modalities] input = ["text"] output = ["text"] + +[variants.off] +chat_template_kwargs = { enable_thinking = false } + +[variants.on] +chat_template_kwargs = { enable_thinking = true } diff --git a/providers/friendli/models/meta-llama/Llama-4-Maverick-17B-128E-Instruct.toml b/providers/friendli/models/meta-llama/Llama-4-Maverick-17B-128E-Instruct.toml deleted file mode 100644 index 6ef3f7b40..000000000 --- a/providers/friendli/models/meta-llama/Llama-4-Maverick-17B-128E-Instruct.toml +++ /dev/null @@ -1,18 +0,0 @@ -name = "Llama 4 Maverick 17B 128E Instruct" -family = "llama" -attachment = false -reasoning = true -tool_call = false -structured_output = true -temperature = true -release_date = "2025-06-16" -last_updated = "2025-12-23" -open_weights = true - -[limit] -context = 131_072 -output = 8_000 - -[modalities] -input = ["text"] -output = ["text"] diff --git a/providers/friendli/models/meta-llama/Llama-4-Scout-17B-16E-Instruct.toml b/providers/friendli/models/meta-llama/Llama-4-Scout-17B-16E-Instruct.toml deleted file mode 100644 index b1cceef6a..000000000 --- a/providers/friendli/models/meta-llama/Llama-4-Scout-17B-16E-Instruct.toml +++ /dev/null @@ -1,18 +0,0 @@ -name = "Llama 4 Scout 17B 16E Instruct" -family = "llama" -attachment = false -reasoning = true -tool_call = false -structured_output = true -temperature = true -release_date = "2025-06-16" -last_updated = "2025-12-23" -open_weights = true - -[limit] -context = 131_072 -output = 8_000 - -[modalities] -input = ["text"] -output = ["text"] diff --git a/providers/friendli/models/zai-org/GLM-4.6.toml b/providers/friendli/models/zai-org/GLM-4.6.toml index 0bf3b123f..c80cb62a0 100644 --- a/providers/friendli/models/zai-org/GLM-4.6.toml +++ b/providers/friendli/models/zai-org/GLM-4.6.toml @@ -6,7 +6,7 @@ tool_call = true structured_output = true temperature = true release_date = "2025-10-31" -last_updated = "2025-12-23" +last_updated = "2026-01-12" open_weights = true [limit] @@ -16,3 +16,9 @@ output = 131_072 [modalities] input = ["text"] output = ["text"] + +[variants.off] +chat_template_kwargs = { enable_thinking = false } + +[variants.on] +chat_template_kwargs = { enable_thinking = true } diff --git a/providers/friendli/provider.toml b/providers/friendli/provider.toml index 277b34f7b..185f1ede6 100644 --- a/providers/friendli/provider.toml +++ b/providers/friendli/provider.toml @@ -1,4 +1,4 @@ -name = "Friendli" +name = "FriendliAI" env = ["FRIENDLI_TOKEN"] npm = "@ai-sdk/openai-compatible" api = "https://api.friendli.ai/serverless/v1"