Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions packages/core/test/fireworks-ai-catalog.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { expect, test } from "bun:test";
import path from "node:path";

const expectedReasoningOptions = {
"accounts/fireworks/models/deepseek-v4-flash": [
{ type: "toggle" },
{ type: "effort", values: ["high", "max"] },
],
"accounts/fireworks/models/deepseek-v4-pro": [
{ type: "toggle" },
{ type: "effort", values: ["high", "max"] },
],
"accounts/fireworks/models/gpt-oss-120b": [{ type: "effort", values: ["low", "medium", "high"] }],
"accounts/fireworks/models/gpt-oss-20b": [{ type: "effort", values: ["low", "medium", "high"] }],
"accounts/fireworks/models/minimax-m2p5": [{ type: "effort", values: ["low", "medium", "high"] }],
"accounts/fireworks/models/minimax-m2p7": [{ type: "effort", values: ["low", "medium", "high"] }],
"accounts/fireworks/models/qwen3p6-plus": [
{ type: "toggle" },
{ type: "effort", values: ["low", "medium", "high"] },
{ type: "budget_tokens", min: 1 },
],
} as const;

const unresolvedReasoningOptions = [
"accounts/fireworks/models/glm-5p1",
"accounts/fireworks/models/kimi-k2p5",
"accounts/fireworks/models/kimi-k2p6",
"accounts/fireworks/routers/glm-5p1-fast",
"accounts/fireworks/routers/kimi-k2p6-fast",
"accounts/fireworks/routers/kimi-k2p6-turbo",
] as const;

test("Fireworks models declare only positively verified reasoning controls", async () => {
const root = path.join(import.meta.dirname, "..", "..", "..");
const modelsDir = path.join(root, "providers", "fireworks-ai", "models");
const actualIds: string[] = [];

for await (const relativePath of new Bun.Glob("**/*.toml").scan(modelsDir)) {
const id = relativePath.slice(0, -".toml".length);
const model = Bun.TOML.parse(await Bun.file(path.join(modelsDir, relativePath)).text()) as {
base_model?: string;
reasoning?: boolean;
reasoning_options?: unknown[];
};
const reasoning = model.reasoning ?? (model.base_model
? (Bun.TOML.parse(await Bun.file(path.join(root, "models", `${model.base_model}.toml`)).text()) as {
reasoning: boolean;
}).reasoning
: false);

actualIds.push(id);
if (!reasoning) {
expect(model.reasoning_options, id).toBeUndefined();
continue;
}

if (id in expectedReasoningOptions) {
expect(model.reasoning_options, id).toEqual(expectedReasoningOptions[id as keyof typeof expectedReasoningOptions]);
} else {
expect(unresolvedReasoningOptions, id).toContain(id);
expect(model.reasoning_options, id).toBeUndefined();
}
}

expect(actualIds.sort()).toEqual([...Object.keys(expectedReasoningOptions), ...unresolvedReasoningOptions].sort());
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ temperature = true
tool_call = true
open_weights = true

[[reasoning_options]]
type = "toggle"

[cost]
input = 1.40
output = 4.40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ temperature = true
tool_call = true
open_weights = true

[[reasoning_options]]
type = "toggle"

[cost]
cache_read = 0.10
input = 0.60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ temperature = true
tool_call = true
open_weights = true

[[reasoning_options]]
type = "toggle"

[cost]
cache_read = 0.16
input = 0.95
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ type = "toggle"
type = "effort"
values = ["low", "medium", "high"]

[[reasoning_options]]
type = "budget_tokens"
min = 1

[cost]
cache_read = 0.10
input = 0.50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ temperature = true
tool_call = true
open_weights = true

[[reasoning_options]]
type = "toggle"

[cost]
input = 2.80
output = 8.80
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ temperature = true
tool_call = true
open_weights = true

[[reasoning_options]]
type = "toggle"

[cost]
cache_read = 0.30
input = 2.00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ temperature = true
tool_call = true
open_weights = true

[[reasoning_options]]
type = "toggle"

[cost]
cache_read = 0.30
input = 2.00
Expand Down
Loading