Skip to content
Merged
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
56 changes: 27 additions & 29 deletions packages/core/script/generate-venice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { z } from "zod";
import path from "node:path";
import { readdir } from "node:fs/promises";
import * as readline from "node:readline";
import { ModelFamilyValues } from "../src/family.js";

// Venice API endpoint
const API_ENDPOINT = "https://api.venice.ai/api/v1/models?type=text";
Expand Down Expand Up @@ -83,31 +84,35 @@ const VeniceResponse = z
})
.passthrough();

// Family inference patterns
const familyPatterns: [RegExp, string][] = [
[/^llama-3\.3/i, "llama-3.3"],
[/^llama-3\.2/i, "llama-3.2"],
[/^qwen3/i, "qwen3"],
[/^deepseek/i, "deepseek"],
[/^mistral/i, "mistral"],
[/^devstral/i, "devstral"],
[/^gemini/i, "gemini"],
[/^grok/i, "grok"],
[/^claude/i, "claude"],
[/^hermes/i, "hermes"],
[/^google-gemma/i, "gemma"],
[/^kimi/i, "kimi"],
[/glm-4.6/i, "glm-4.6"],
[/^venice/i, "venice-uncensored"],
[/^openai-gpt/i, "openai-gpt"],
];
function matchesFamily(target: string, family: string): boolean {
const targetLower = target.toLowerCase();
const familyLower = family.toLowerCase();
let familyIdx = 0;

for (let i = 0; i < targetLower.length && familyIdx < familyLower.length; i++) {
if (targetLower[i] === familyLower[familyIdx]) {
familyIdx++;
}
}

return familyIdx === familyLower.length;
}

function inferFamily(modelId: string, modelName: string): string | undefined {
for (const [pattern, family] of familyPatterns) {
if (pattern.test(modelId) || pattern.test(modelName)) {
const sortedFamilies = [...ModelFamilyValues].sort((a, b) => b.length - a.length);

for (const family of sortedFamilies) {
if (matchesFamily(modelId, family)) {
return family;
}
}

for (const family of sortedFamilies) {
if (matchesFamily(modelName, family)) {
return family;
}
}

return undefined;
}

Expand Down Expand Up @@ -282,15 +287,8 @@ function mergeModel(
};
}

// Preserve from existing OR infer
if (existing?.family) {
merged.family = existing.family;
} else {
const inferred = inferFamily(apiModel.id, spec.name);
if (inferred) {
merged.family = inferred;
}
}
const inferred = inferFamily(apiModel.id, spec.name);
merged.family = inferred ?? existing?.family;

// Preserve manual fields from existing
if (existing?.knowledge) {
Expand Down
25 changes: 25 additions & 0 deletions providers/venice/models/claude-sonnet-45.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name = "Claude Sonnet 4.5"
family = "claude-sonnet"
attachment = true
reasoning = true
tool_call = true
structured_output = true
temperature = true
knowledge = "2025-09"
release_date = "2025-01-15"
last_updated = "2026-01-15"
open_weights = false

[cost]
input = 3.75
output = 18.75
cache_read = 0.375
cache_write = 4.69

[limit]
context = 202_752
output = 50_688

[modalities]
input = ["text", "image"]
output = ["text"]
4 changes: 2 additions & 2 deletions providers/venice/models/hermes-3-llama-3.1-405b.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name = "Hermes 3 Llama 3.1 405b"
family = "llama"
family = "hermes"
attachment = false
reasoning = false
tool_call = false
temperature = true
knowledge = "2024-04"
release_date = "2025-09-25"
last_updated = "2025-12-29"
last_updated = "2026-01-15"
open_weights = true

[cost]
Expand Down
24 changes: 24 additions & 0 deletions providers/venice/models/openai-gpt-52-codex.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name = "GPT-5.2 Codex"
family = "gpt-codex"
attachment = true
reasoning = true
tool_call = true
structured_output = true
temperature = true
knowledge = "2025-08"
release_date = "2025-01-15"
last_updated = "2026-01-15"
open_weights = false

[cost]
input = 2.19
output = 17.5
cache_read = 0.219

[limit]
context = 262_144
output = 65_536

[modalities]
input = ["text", "image"]
output = ["text"]
7 changes: 5 additions & 2 deletions providers/venice/models/zai-org-glm-4.6v.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name = "GLM 4.6V"
family = "glm"
family = "glmv"
attachment = true
reasoning = false
tool_call = true
structured_output = true
temperature = true
release_date = "2025-12-11"
last_updated = "2025-12-29"
last_updated = "2026-01-15"
open_weights = true

[cost]
Expand All @@ -20,3 +20,6 @@ output = 32_768
[modalities]
input = ["text", "image"]
output = ["text"]

[interleaved]
field = "reasoning_details"