Skip to content
Open
27 changes: 27 additions & 0 deletions models/liquid/d1.2-ultra.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# https://www.liquid.ai/blog/d1-2 (hosted release, 2026-11-16)
# https://docs.liquid.ai/lfm/models/d1 (per-question input limit and typed answers without generated tokens)
# d1.2 image formats (JPEG, PNG, WebP): https://github.com/Liquid4All/docs/blob/d4c58eb76305b9d20d7167ee7d1fffcb976aea98/lfm/models/d1.mdx#L1220-L1224
# d1.2 audio formats (WAV with PCM or float samples, MP3, FLAC, Ogg Opus or Vorbis): https://github.com/Liquid4All/docs/blob/d4c58eb76305b9d20d7167ee7d1fffcb976aea98/lfm/models/d1.mdx#L1314-L1318
schema = 2
v2_only = true
type = "decision"
name = "d1.2-ultra"
description = "Higher-accuracy Liquid decision model for classification, span extraction and object localization over shared multimodal state."
family = "liquid-decision"
open_weights = false
release_date = "2026-11-16"

[modalities]
input = ["text", "image/jpeg", "image/png", "image/webp", "audio/wav", "audio/mpeg", "audio/flac", "audio/ogg"]
output = ["decision"]

[capabilities]
tools = { supported = false }
reasoning = { supported = false }
temperature = false
top_p = false
top_k = false

[limit]
context = 65_536
output = 0
27 changes: 27 additions & 0 deletions models/liquid/d1.2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# https://www.liquid.ai/blog/d1-2 (hosted release, 2026-11-16)
# https://docs.liquid.ai/lfm/models/d1 (per-question input limit and typed answers without generated tokens)
# d1.2 image formats (JPEG, PNG, WebP): https://github.com/Liquid4All/docs/blob/d4c58eb76305b9d20d7167ee7d1fffcb976aea98/lfm/models/d1.mdx#L1220-L1224
# d1.2 audio formats (WAV with PCM or float samples, MP3, FLAC, Ogg Opus or Vorbis): https://github.com/Liquid4All/docs/blob/d4c58eb76305b9d20d7167ee7d1fffcb976aea98/lfm/models/d1.mdx#L1314-L1318
schema = 2
v2_only = true
type = "decision"
name = "d1.2"
description = "Classifies text, images and audio, extracts spans and locates objects in images using typed questions."
family = "liquid-decision"
open_weights = false
release_date = "2026-11-16"

[modalities]
input = ["text", "image/jpeg", "image/png", "image/webp", "audio/wav", "audio/mpeg", "audio/flac", "audio/ogg"]
output = ["decision"]

[capabilities]
tools = { supported = false }
reasoning = { supported = false }
temperature = false
top_p = false
top_k = false

[limit]
context = 65_536
output = 0
32 changes: 32 additions & 0 deletions models/perplexity/pplx-decider-flash-v1.3.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://www.perplexity.ai/hub/blog/perplexity-decider (v1.3 release and distillation)
# https://docs.perplexity.ai/docs/decisions/decisions (256K context, image formats and typed decisions)
# https://huggingface.co/perplexity-ai/pplx-decider-flash-v1.3 (Apache-2.0 weights and zero generated tokens)
# https://openrouter.ai/perplexity/pplx-decider-flash-v1.3:free (public release on 2026-11-12)
schema = 2
v2_only = true
type = "decision"
name = "pplx-decider-flash-v1.3"
family = "pplx-decider-flash"
description = "Smaller model distilled from Decider v1.3 for probabilistic classification and span extraction over text and images."
open_weights = true
release_date = "2026-11-12"
license = "Apache-2.0"

[modalities]
input = ["text", "image/png", "image/jpeg", "image/webp"]
output = ["decision"]

[capabilities]
tools = { supported = false }
reasoning = { supported = false }
temperature = false
top_p = false
top_k = false

[limit]
context = 262_144
output = 0

[[weights]]
label = "Hugging Face"
url = "https://huggingface.co/perplexity-ai/pplx-decider-flash-v1.3"
32 changes: 32 additions & 0 deletions models/perplexity/pplx-decider-v1.3.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://www.perplexity.ai/hub/blog/perplexity-decider (v1.3 release and distillation)
# https://docs.perplexity.ai/docs/decisions/decisions (256K context, image formats and typed decisions)
# https://huggingface.co/perplexity-ai/pplx-decider-v1.3 (Apache-2.0 weights and zero generated tokens)
# https://openrouter.ai/perplexity/pplx-decider-v1.3:free (public release on 2026-11-12)
schema = 2
v2_only = true
type = "decision"
name = "pplx-decider-v1.3"
family = "pplx-decider"
description = "Open-weight decision model for classifying text and images, scoring options and extracting verbatim spans."
open_weights = true
release_date = "2026-11-12"
license = "Apache-2.0"

[modalities]
input = ["text", "image/png", "image/jpeg", "image/webp"]
output = ["decision"]

[capabilities]
tools = { supported = false }
reasoning = { supported = false }
temperature = false
top_p = false
top_k = false

[limit]
context = 262_144
output = 0

[[weights]]
label = "Hugging Face"
url = "https://huggingface.co/perplexity-ai/pplx-decider-v1.3"
41 changes: 35 additions & 6 deletions packages/core/src/sync/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const CANONICAL_PROVIDER_PREFIXES = {
moonshotai: { provider: "moonshotai", metadata: "moonshotai" },
openai: { provider: "openai", metadata: "openai" },
nvidia: { provider: "nvidia", metadata: "nvidia" },
perplexity: { provider: "perplexity", metadata: "perplexity" },
qwen: { provider: "alibaba", metadata: "alibaba" },
sakana: { provider: "sakana", metadata: "sakana" },
stepfun: { provider: "stepfun", metadata: "stepfun" },
Expand Down Expand Up @@ -152,6 +153,8 @@ export const OpenRouterVideoModels = z.object({

export const OpenRouterModel = z.object({
id: z.string(),
description: z.string().nullish(),
alias_target: z.object({ slug: z.string().nullish() }).nullish(),
name: z.string(),
created: z.number(),
hugging_face_id: z.string().nullable(),
Expand Down Expand Up @@ -221,6 +224,8 @@ export type OpenRouterModel = z.infer<typeof OpenRouterModel>;
export const openrouter = {
id: "openrouter",
name: "OpenRouter",
// The translator preserves fixed routes itself. A rolling alias can lose its target.
preserveBaseModels: false,
modelsDir: "providers/openrouter/models",
async fetchModels() {
const headers = process.env.OPENROUTER_API_KEY
Expand Down Expand Up @@ -285,6 +290,9 @@ export const openrouter = {
];
},
translateModel(model, context) {
const alias = model.id.startsWith("~");
const slug = alias ? model.alias_target?.slug : undefined;
const targetBase = slug ? context.authored(slug)?.base_model : undefined;
const type = mediaType(model);
if (type !== undefined) {
const current = context.v2?.(model.id);
Expand All @@ -293,7 +301,7 @@ export const openrouter = {
}
return {
id: model.id,
v2: buildOpenRouterMediaModel(model, type, current),
v2: buildOpenRouterMediaModel(model, type, current, targetBase),
header: MEDIA_HEADERS[type],
};
}
Expand All @@ -306,7 +314,9 @@ export const openrouter = {
const authored = context.authored(model.id);
return authored === undefined ? undefined : { id: model.id, model: authored as SyncedModel };
}
const built = buildOpenRouterModel(model, context.existing(model.id));
// An alias keeps its own overrides, never facts inherited from its previous target.
const existing = alias ? context.authored(model.id) : context.existing(model.id);
const built = buildOpenRouterModel(model, existing, targetBase);
// Factoring compares v1 modality kinds, which collapse all image formats.
// Keep a real v2 host-format override when the catalog still lists those kinds.
const formats = context.v2?.(model.id)?.modalities;
Expand Down Expand Up @@ -840,20 +850,37 @@ function isUnavailableMedia(model: OpenRouterModel) {
return [prompt, completion, image, audio].some((value) => value !== undefined && Number(value) < 0);
}

function openRouterBaseModel(
model: OpenRouterModel,
existing: string | undefined,
targetBase: string | undefined,
resolve: (id: string) => string | undefined,
) {
if (!model.id.startsWith("~")) return existing ?? targetBase ?? resolve(model.id);
const slug = model.alias_target?.slug;
if (slug == null) return resolve(model.id); // includes curated alias mappings
if (!/^[a-z0-9][\w.-]*\/[a-z0-9][\w.:-]*$/i.test(slug)) return undefined;
return targetBase ?? resolve(slug) ?? resolveModelMetadataBaseModel(slug);
}

export function buildOpenRouterMediaModel(
model: OpenRouterModel,
type: MediaType,
current?: Record<string, unknown>,
targetBase?: string,
): Record<string, unknown> {
const base = typeof current?.base_model === "string" ? current.base_model : resolveMediaBaseModel(model.id);
const existingBase = typeof current?.base_model === "string" ? current.base_model : undefined;
const base = openRouterBaseModel(model, existingBase, targetBase, resolveMediaBaseModel);
const lab = base === undefined ? undefined : rawLabModel(base);
const doc: Record<string, unknown> = { schema: 2, v2_only: true };
const modalities = mediaModalities(model, type);
const context = model.context_length;
const api = MEDIA_APIS[type];

const description = typeof current?.description === "string" ? current.description : model.description;
if (base !== undefined && lab !== undefined) {
doc.base_model = base;
if (model.id.startsWith("~") && description) doc.description = description;
const labCapabilities = (lab.capabilities ?? {}) as Record<string, unknown>;
const labContext = (lab.limit as { context?: number } | undefined)?.context;
// A lab of another type (a chat model served on a transcription endpoint)
Expand Down Expand Up @@ -897,6 +924,7 @@ export function buildOpenRouterMediaModel(
doc.name = model.name.replace(/^[^:]+:\s+/, "");
doc.description = typeof current?.description === "string"
? current.description
: model.id.startsWith("~") && description ? description
: type === "embedding" && modalities.input.length > 1
? "Multimodal embedding model"
: MEDIA_DESCRIPTIONS[type];
Expand Down Expand Up @@ -1573,7 +1601,7 @@ export function buildOpenRouterModel(
tiers: costTiers(model, existing),
}
: existing?.cost;
const canonical = existing?.base_model ?? baseModel ?? resolveCanonicalBaseModel(model.id);
const canonical = openRouterBaseModel(model, existing?.base_model, baseModel, resolveCanonicalBaseModel);
const catalogOutput = isPlaceholderOutputLimit(model) ? undefined : model.top_provider.max_completion_tokens;
const limit = {
context,
Expand All @@ -1586,6 +1614,7 @@ export function buildOpenRouterModel(
?? existing?.limit?.output
?? context),
};
const description = existing?.description ?? (model.id.startsWith("~") ? model.description ?? undefined : undefined);

if (canonical !== undefined) {
const canonicalOverride = canonicalBaseModelOverride(model.id);
Expand All @@ -1598,7 +1627,7 @@ export function buildOpenRouterModel(
: undefined,
family: freeFamily(canonical, existing?.family),
// The lab describes a decision model; don't override it with a generic chat description.
description: decision ? existing?.description : existing?.description ?? describeModel({
description: decision ? description : description ?? describeModel({
id: model.id,
name,
family: familyValue,
Expand Down Expand Up @@ -1630,7 +1659,7 @@ export function buildOpenRouterModel(
return {
type,
name,
description: existing?.description ?? (decision ? DECISION_DESCRIPTION : describeModel({
description: description ?? (decision ? DECISION_DESCRIPTION : describeModel({
id: model.id,
name,
family: familyValue,
Expand Down
70 changes: 70 additions & 0 deletions packages/core/test/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,76 @@ test("xAI sync clears cost tiers when API reports no long-context band", () => {
expect(model.cost?.tiers).toBeUndefined();
});

test("OpenRouter rewrites rolling aliases when their target changes or disappears", async () => {
const root = await mkdtemp(path.join(tmpdir(), "openrouter-alias-"));
const modelsDir = path.join(root, "providers/openrouter/models");
const id = "~openai/gpt-astra-latest";
const file = path.join(modelsDir, id + ".toml");
const targets = ["openai/gpt-6.2-astra", "openai/gpt-6.2-sol"];
let slug: string | undefined;
const provider = {
...openrouter,
modelsDir,
fetchModels: async () => ({ data: [openRouterModel({
id, name: "OpenAI: GPT Astra Latest", description: "A rolling route",
alias_target: slug === undefined ? undefined : { slug },
supported_parameters: ["tools"],
top_provider: { context_length: 1_000_000, max_completion_tokens: null },
})] }),
};
const read = async () => Bun.TOML.parse(await readFile(file, "utf8"));
try {
await mkdir(path.dirname(file), { recursive: true });
await mkdir(path.join(root, "models/openai"), { recursive: true });
for (const target of targets) {
await copyFile(`models/${target}.toml`, path.join(root, `models/${target}.toml`));
}
// Start with the unlinked file that earlier syncs wrote.
expect(await syncProvider(provider)).toMatchObject({ created: 1 });
for (slug of targets) {
expect(await syncProvider(provider)).toMatchObject({ updated: 1 });
expect(await read()).toMatchObject({ base_model: slug, name: "GPT Astra Latest", description: "A rolling route" });
const linked = await read();
expect(linked).not.toHaveProperty("release_date");
expect(linked).not.toHaveProperty("limit.output");
expect(await syncProvider(provider)).toMatchObject({ unchanged: 1 });
}
for (const unresolved of ["openai/missing-target", undefined]) {
slug = unresolved;
await syncProvider(provider);
const standalone = await read();
expect(standalone).not.toHaveProperty("base_model");
expect(standalone).toHaveProperty("release_date");
slug = targets[0];
expect(await syncProvider(provider)).toMatchObject({ updated: 1 });
}
} finally {
await rm(root, { recursive: true, force: true });
}
});

test("OpenRouter caps a retargeted alias at the serving context when the output limit is missing or a placeholder", () => {
for (const output of [null, 90_000]) {
const model = buildOpenRouterModel(openRouterModel({
id: "~openai/gpt-astra-latest",
alias_target: { slug: "openai/gpt-6.2-astra" },
context_length: 1_050_000,
top_provider: { context_length: 100_000, max_completion_tokens: output },
}), { base_model: "openai/gpt-4.1-nano" });
expect(model).toMatchObject({ base_model: "openai/gpt-6.2-astra", limit: { output: 100_000 } });
}
});

test("OpenRouter media aliases resolve the advertised target ahead of the previous lab", () => {
const source = openRouterMediaModel({
id: "~openai/speech-latest", name: "OpenAI: Speech Latest", description: "Rolling speech route",
alias_target: { slug: "openai/tts-1-hd" },
});
const linked = buildOpenRouterMediaModel(source, "speech", { base_model: "openai/tts-1" });
expect(linked).toMatchObject({ base_model: "openai/tts-1-hd", name: "Speech Latest", description: source.description });
expect(buildOpenRouterMediaModel({ ...source, alias_target: null }, "speech", linked).base_model).toBeUndefined();
});

test("OpenRouter sync maps pricing.overrides into cost tiers", () => {
const model = buildOpenRouterModel(openRouterModel({
id: "x-ai/grok-4.5",
Expand Down
21 changes: 6 additions & 15 deletions providers/openrouter/models/liquid/d1.2-ultra.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# OpenRouter lists text and image input. Image MIME types follow Liquid's d1.2 Image Requirements:
# https://github.com/Liquid4All/docs/blob/d4c58eb76305b9d20d7167ee7d1fffcb976aea98/lfm/models/d1.mdx#L1220-L1224
# https://openrouter.ai/api/v1/models?output_modalities=decisions
schema = 2
type = "decision"
name = "d1.2-ultra"
description = "Decision model for typed evaluation of shared state"
family = "liquid"
open_weights = false
release_date = "2026-11-16"
base_model = "liquid/d1.2-ultra"

[modalities]
input = ["text", "image"]
output = ["text"]
input = ["text", "image/jpeg", "image/png", "image/webp"]
output = ["decision"]

[capabilities]
tools = { supported = false }
reasoning = { supported = false }
structured_output = false
temperature = false

[limit]
context = 65_536
output = 0

[api.systemone]
sdk = { aisdk = "@ai-sdk/typesafe-ai", opencodeai = "@opencode/ai/providers/openrouter/decisions" }
Expand Down
21 changes: 6 additions & 15 deletions providers/openrouter/models/liquid/d1.2.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# OpenRouter lists text and image input. Image MIME types follow Liquid's d1.2 Image Requirements:
# https://github.com/Liquid4All/docs/blob/d4c58eb76305b9d20d7167ee7d1fffcb976aea98/lfm/models/d1.mdx#L1220-L1224
# https://openrouter.ai/api/v1/models?output_modalities=decisions
schema = 2
type = "decision"
name = "d1.2"
description = "Decision model for typed evaluation of shared state"
family = "liquid"
open_weights = false
release_date = "2026-11-16"
base_model = "liquid/d1.2"

[modalities]
input = ["text", "image"]
output = ["text"]
input = ["text", "image/jpeg", "image/png", "image/webp"]
output = ["decision"]

[capabilities]
tools = { supported = false }
reasoning = { supported = false }
structured_output = false
temperature = false

[limit]
context = 65_536
output = 0

[api.systemone]
sdk = { aisdk = "@ai-sdk/typesafe-ai", opencodeai = "@opencode/ai/providers/openrouter/decisions" }
Expand Down
Loading
Loading