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
5 changes: 4 additions & 1 deletion packages/core/src/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { modular } from "./providers/modular.js";
import { nanoGpt } from "./providers/nano-gpt.js";
import { nearai } from "./providers/nearai.js";
import { novitaAi } from "./providers/novita-ai.js";
import { axforge } from "./providers/axforge.js";
import { ollamaCloud } from "./providers/ollama-cloud.js";
import { openai } from "./providers/openai.js";
import { opencheap } from "./providers/opencheap.js";
Expand Down Expand Up @@ -230,6 +231,7 @@ export const providers: {
"novita-ai": SyncProvider<any>;
obscurify: SyncProvider<any>;
ofox: SyncProvider<any>;
"axforge": SyncProvider<any>;
"ollama-cloud": SyncProvider<any>;
openai: SyncProvider<any>;
opencheap: SyncProvider<any>;
Expand Down Expand Up @@ -286,6 +288,7 @@ export const providers: {
"novita-ai": novitaAi,
obscurify,
ofox,
"axforge": axforge,
"ollama-cloud": ollamaCloud,
openai,
opencheap,
Expand Down Expand Up @@ -334,7 +337,7 @@ export const groups = {
"void-api",
],
cloudflare: ["cloudflare-ai-gateway", "cloudflare-workers-ai"],
direct: ["aiand", "ambient", "anthropic", "baseten", "chutes", "cortecs", "deepinfra", "digitalocean", "engy", "fireworks-ai", "friendli", "github-copilot", "google", "hyper", "meta", "mistral", "modular", "morph", "nearai", "obscurify", "ollama-cloud", "openai", "ovhcloud", "pioneer", "sambanova", "tinfoil", "venice", "wandb", "xai"],
direct: ["aiand", "ambient", "anthropic", "axforge", "baseten", "chutes", "cortecs", "deepinfra", "digitalocean", "engy", "fireworks-ai", "friendli", "github-copilot", "google", "hyper", "meta", "mistral", "modular", "morph", "nearai", "obscurify", "ollama-cloud", "openai", "ovhcloud", "pioneer", "sambanova", "tinfoil", "venice", "wandb", "xai"],
} as const;

type ProviderID = keyof typeof providers;
Expand Down
85 changes: 85 additions & 0 deletions packages/core/src/sync/providers/axforge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { z } from "zod";

import { AuthoredModel } from "../../schema.js";
import type { ExistingModel, SyncProvider, SyncedBaseModel, SyncedModel } from "../index.js";

// AxForge's model list, public and without a key: each serving model once, by the id it is called by.
const API_ENDPOINT = "https://api.axforge.ai/v1/public/models";

export const AxForgeModel = z.object({
id: z.string().min(1),
object: z.literal("model"),
created: z.number().int().nonnegative(),
owned_by: z.string(),
display_name: z.string().optional(),
// chat, decision, embeddings, rerank, image, speech, transcription, ocr, music
type: z.string().optional(),
context_length: z.number().int().positive().optional(),
max_output_tokens: z.number().int().positive().optional(),
input: z.array(z.string()).optional(),
tools: z.boolean().optional(),
}).passthrough();

const AxForgeResponse = z.object({
object: z.literal("list"),
data: z.array(AxForgeModel),
}).passthrough();

export type AxForgeModel = z.infer<typeof AxForgeModel>;

export function parseAxForgeModels(raw: unknown) {
return AxForgeResponse.parse(raw).data;
}

function preserveAuthoredModel(id: string, authored: ExistingModel): SyncedModel {
if (authored.base_model !== undefined) return authored as SyncedBaseModel;

const parsed = AuthoredModel.safeParse({ id, ...authored });
if (!parsed.success) {
parsed.error.cause = { provider: "axforge", model: id };
throw parsed.error;
}
const { id: _id, ...model } = parsed.data;
return model;
}

export async function fetchAxForgeModels(fetcher: typeof fetch = fetch) {
const response = await fetcher(API_ENDPOINT);
if (!response.ok) {
throw new Error(`AxForge models request failed: ${response.status} ${response.statusText}`);
}
return response.json();
}

// Chat models only: the list's other kinds (embeddings, OCR, speech, ...) are not catalogued here yet.
// A chat model the list has and the catalog lacks becomes a missing-model issue (its metadata is hand-authored);
// one the list drops keeps its file, so a model reloading at sync time is never removed. AxForge removes a retired
// model by its own pull request.
export const axforge = {
id: "axforge",
name: "AxForge",
modelsDir: "providers/axforge/models",
skipCreates: true,
trackMissingModels: true,
deleteMissing: false,
sourceID(model) {
return model.type === undefined || model.type === "chat" ? model.id : undefined;
},
skippedNotice(ids) {
if (ids.length === 0) return [];
return [
`${ids.length} AxForge chat models returned by the API are missing from the local catalog and require hand-authored metadata.`,
`Missing remote IDs: ${ids.map((id) => `\`${id}\``).join(", ")}`,
];
},
async fetchModels() {
return fetchAxForgeModels();
},
parseModels: parseAxForgeModels,
translateModel(model, context) {
if (model.type !== undefined && model.type !== "chat") return undefined;
const authored = context.authored(model.id);
if (authored === undefined) return undefined;
return { id: model.id, model: preserveAuthoredModel(model.id, authored) };
},
} satisfies SyncProvider<AxForgeModel>;
52 changes: 52 additions & 0 deletions packages/core/test/axforge.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { expect, test } from "bun:test";

import { axforge, fetchAxForgeModels, parseAxForgeModels, type AxForgeModel } from "../src/sync/providers/axforge.js";

function model(overrides: Partial<AxForgeModel> = {}): AxForgeModel {
return {
id: "glm-5.3-flash",
object: "model",
created: 0,
owned_by: "axforge",
display_name: "GLM-5.3-Flash",
type: "chat",
context_length: 262_144,
max_output_tokens: 65_536,
input: ["text"],
tools: true,
...overrides,
};
}

test("parses the public AxForge model list", () => {
expect(parseAxForgeModels({ object: "list", data: [model()] })).toEqual([model()]);
});

test("fetches the public AxForge model list without authentication", async () => {
let request: RequestInfo | URL | undefined;
const fetcher: typeof fetch = async (input) => {
request = input;
return Response.json({ object: "list", data: [model()] });
};
await expect(fetchAxForgeModels(fetcher)).resolves.toEqual({ object: "list", data: [model()] });
expect(String(request)).toBe("https://api.axforge.ai/v1/public/models");
});

test("tracks remote-only chat models as issues, without creating or deleting TOMLs", () => {
expect(axforge.skipCreates).toBe(true);
expect(axforge.trackMissingModels).toBe(true);
expect(axforge.deleteMissing).toBe(false);
expect(axforge.sourceID(model())).toBe("glm-5.3-flash");
});

test("leaves the list's other kinds out", () => {
const embeddings = model({ id: "qwen3-embed", type: "embeddings", input: undefined, tools: undefined });
expect(axforge.sourceID(embeddings)).toBeUndefined();
expect(axforge.translateModel(embeddings, { authored: () => undefined } as never)).toBeUndefined();
});

test("keeps an existing AxForge file as authored", () => {
const authored = { base_model: "zhipuai/glm-5.3-flash", limit: { context: 262_144, output: 65_536 } };
const out = axforge.translateModel(model(), { authored: () => authored } as never);
expect(out).toEqual({ id: "glm-5.3-flash", model: authored as never });
});
5 changes: 5 additions & 0 deletions providers/axforge/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions providers/axforge/models/glm-5.3-flash.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Served by AxForge as glm-5.3-flash: https://api.axforge.ai/v1/public/models (read 2026-11-14).
# Context 500,000 tokens on our servers (the engine's max_model_len, read 2026-11-14); our API caps an answer at
# 65,536 tokens.
# Reads pictures (jpeg, png, webp, tried live on our servers 2026-11-16); videos and PDFs are not served.
# Effort: reasoning_effort = none|low|high|max (thinks by default; none turns thinking off)
# Verified live on POST https://api.axforge.ai/v1/chat/completions 2026-11-16: reasoning_content present by default
# and at low, high and max, absent at none.
# No cost: our prices are in EUR and follow a live price sheet, https://axforge.ai/pricing/
schema = 2
base_model = "zhipuai/glm-5.3-flash"

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

[capabilities]
reasoning = { supported = true, effort = ["none", "low", "high", "max"] }

[limit]
context = 500_000
output = 65_536
20 changes: 20 additions & 0 deletions providers/axforge/models/mimo-v2.6-flash.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Served by AxForge as mimo-v2.6-flash: https://api.axforge.ai/v1/public/models (read 2026-11-14).
# Context 262,144 tokens on our servers (the engine's max_model_len, read 2026-11-14); our API caps an answer at 65,536 tokens.
# Reads pictures (jpeg, png, webp, tried live on our servers 2026-11-16); videos are not served.
# Effort: reasoning_effort = none|low|medium|high (thinking off by default; low and up turn it on)
# Verified live on POST https://api.axforge.ai/v1/chat/completions 2026-11-16: no reasoning_content by default or at
# none, present at low, medium and high. thinking.type = enabled does not turn it on here.
# No cost: our prices are in EUR and follow a live price sheet, https://axforge.ai/pricing/
schema = 2
base_model = "xiaomi/mimo-v2.6-flash"

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

[capabilities]
reasoning = { supported = true, default = { type = "effort", value = "none" }, effort = ["none", "low", "medium", "high"] }

[limit]
context = 262_144
output = 65_536
20 changes: 20 additions & 0 deletions providers/axforge/models/qwen3.8-27b.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Served by AxForge as qwen3.8-27b: https://api.axforge.ai/v1/public/models (read 2026-11-14).
# Reads pictures (our vision model); videos are not served. Context 262,144 tokens; our API caps an answer at 65,536
# tokens.
# Toggle: chat_template_kwargs.enable_thinking = true|false (off by default)
# Verified live on POST https://api.axforge.ai/v1/chat/completions 2026-11-16: reasoning_content present only with
# enable_thinking = true; reasoning_effort does not change it here.
# No cost: our prices are in EUR and follow a live price sheet, https://axforge.ai/pricing/
schema = 2
base_model = "alibaba/qwen3.8-27b"

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

[capabilities]
reasoning = { supported = true, default = { type = "toggle", value = false }, toggle = true }

[limit]
context = 262_144
output = 65_536
21 changes: 21 additions & 0 deletions providers/axforge/models/qwen3.8-flash-next.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Served by AxForge as qwen3.8-flash-next: https://api.axforge.ai/v1/public/models (read 2026-11-14).
# Reads pictures; videos are not served. Context 500,000 tokens on our servers (the engine's max_model_len, read
# 2026-11-14); our API caps an answer at 65,536 tokens.
# Toggle: chat_template_kwargs.enable_thinking = true|false (off by default on our servers)
# Effort: reasoning_effort = low|medium|high (any of them turns thinking on)
# Verified live on POST https://api.axforge.ai/v1/chat/completions 2026-11-16: no reasoning_content by default,
# present with enable_thinking = true or a reasoning_effort level.
# No cost: our prices are in EUR and follow a live price sheet, https://axforge.ai/pricing/
schema = 2
base_model = "alibaba/qwen3.8-flash-next"

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

[capabilities]
reasoning = { supported = true, default = { type = "toggle", value = false }, toggle = true, effort = ["low", "medium", "high"] }

[limit]
context = 500_000
output = 65_536
10 changes: 10 additions & 0 deletions providers/axforge/provider.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AxForge: open models served from our own hardware in Stockholm (eu-se-1), one OpenAI-compatible API.
# Prices are in EUR, without VAT, and change with our price sheet, so they are left out here: https://axforge.ai/pricing/
# The model list, readable without a key: https://api.axforge.ai/v1/public/models (the sync module in
# packages/core/src/sync/providers/axforge.ts follows it).
name = "AxForge"
npm = "@ai-sdk/openai-compatible"
opencodeai = "@opencode/ai/providers/openai-compatible"
env = ["AXFORGE_API_KEY"]
api = "https://api.axforge.ai/v1"
doc = "https://dev.axforge.ai/docs/connect/opencode/"
2 changes: 2 additions & 0 deletions sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Pioneer and Ofox track remote-only chat models as missing-model issues. Their AP

Ollama Cloud tracks every remote-only ID from its public `/v1/models` endpoint as a missing-model issue. Existing provider TOMLs and entries absent from the endpoint are preserved because the inventory does not provide enough metadata to author complete entries or determine removals safely.

AxForge tracks every remote-only chat model from its public `/v1/public/models` endpoint as a missing-model issue and leaves the list's other kinds (embeddings, OCR, speech) out. Entries absent from the endpoint are preserved: a model reloading at sync time is never removed, and AxForge removes a retired model by its own pull request.

OpenAI also sets `trackMissingModels: false`: `/v1/models` is scoped to the automation account and mixes public models with legacy, internal experiment, dated snapshot, and non-catalog IDs without lifecycle metadata. Existing OpenAI TOMLs are still preserved by the availability sync.

Google sets `trackMissingModels: false`: `/v1beta/models` does not expose lifecycle metadata and can retain shut-down models, superseded snapshots, moving aliases, and EAP IDs. Existing Google TOMLs are still updated from API-authoritative fields.
Expand Down
Loading