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
1 change: 1 addition & 0 deletions changelog.d/features/unifically-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **feat(providers):** Added Unifically as an OpenAI-compatible API-key gateway (`https://api.unifically.com/v1`), with live model discovery via `passthroughModels`. Discovery is scoped to `/v1/models?category=llm`, because the same catalog also lists image, video and audio models that run through a separate async task API and are not chat-completion targets.
3 changes: 2 additions & 1 deletion config/quality/file-size-baseline.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_rebaseline_2026_10_08_14182_unifically_gateways": "PR #14182 (unifically-dev) reconcile onto release/v3.8.52 35f63906 (2026-10-08): src/shared/constants/providers/apikey/gateways.ts tip 1573 -> 1575 (+2 = one import of the dedicated apikey/unifically.ts entry and one ...unificallyGateway spread, the same wiring #14297 onomeo uses). The Unifically catalog entry itself lives in src/shared/constants/providers/apikey/unifically.ts (under cap); the PR's earlier doc-comment shrink was already taken by the tip, so the two wiring lines are irreducible. Measured with split(\"\\n\").length on the merged tree. Covered by tests/unit/unifically-provider.test.ts.",
"_rebaseline_2026_10_07_13016_hf_bill_to_reconcile": "PR #13016 reconcile onto release/v3.8.52 tip f8a8131 (2026-10-07): EditConnectionModal.tsx tip ceiling 1634 (Onda A #14907) + this PR's own +15 (the owner-approved HF X-HF-Bill-To field already covered by _rebaseline_2026_09_23_13016_huggingface_bill_to) -> 1649, measured with split(\"\\n\").length by check-file-size on the merged tree. No slack.",
"_rebaseline_2026_09_23_13016_huggingface_bill_to": "PR #13016 own growth: EditConnectionModal.tsx merge-base 1603 -> tip 1621 (tip-only growth, within the 1631 ceiling) -> 1637 (+16 = the optional Hugging Face X-HF-Bill-To billing-account field: form-state init + a single Input gated to provider huggingface + providerSpecificData wiring, mirroring the customUserAgent call-site pattern). Irreducible call-site wiring in the frozen modal; header logic lives in open-sse/executors/base/headers.ts and persistence in connectionProviderSpecificData.ts. Covered by tests/unit/huggingface-bill-to-header.test.ts. Owner-approved rebaseline 2026-09-23.",
"_rebaseline_2026_10_07_wave_c_gateways": "Onda C 2026-10-07, measured with split(\"\\n\").length on the post-squash tip f83a3019. src/shared/constants/providers/apikey/gateways.ts 1547->1574 (#15131 Y-API catalog entry; the baseline hunk stayed out of the product squash). Ceiling is the measured size, not slack.",
Expand Down Expand Up @@ -585,7 +586,7 @@
"src/lib/tailscaleTunnel.ts": 1208,
"src/lib/tokenHealthCheck.ts": 1254,
"src/shared/components/RequestLoggerV2.tsx": 1762,
"src/shared/constants/providers/apikey/gateways.ts": 1574,
"src/shared/constants/providers/apikey/gateways.ts": 1575,
"src/shared/services/cliRuntime.ts": 1296,
"src/sse/handlers/chat.ts": 2688,
"src/sse/services/auth.ts": 3678,
Expand Down
2 changes: 2 additions & 0 deletions open-sse/config/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ import { literouterProvider } from "./registry/literouter/index.ts";
import { greenptProvider } from "./registry/greenpt/index.ts";
import { onomeoProvider } from "./registry/onomeo/index.ts";
import { eurouterProvider } from "./registry/eurouter/index.ts";
import { unificallyProvider } from "./registry/unifically/index.ts";
import { yApiProvider } from "./registry/y-api/index.ts";
import { mnnAiProvider } from "./registry/mnn-ai/index.ts";
import { meganovaAiProvider } from "./registry/meganova-ai/index.ts";
Expand Down Expand Up @@ -533,6 +534,7 @@ export const REGISTRY: Record<string, RegistryEntry> = {
greenpt: greenptProvider,
onomeo: onomeoProvider,
eurouter: eurouterProvider,
unifically: unificallyProvider,
"y-api": yApiProvider,
"mnn-ai": mnnAiProvider,
"meganova-ai": meganovaAiProvider,
Expand Down
14 changes: 14 additions & 0 deletions open-sse/config/providers/registry/unifically/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { RegistryEntry } from "../../shared.ts";
import { buildOpenAiCompatibleRegistryEntry } from "../../shared.ts";

// Unifically serves text, image, video and audio models from one catalog.
// `?category=llm` narrows /v1/models to the chat models, which are the only
// ones /v1/chat/completions accepts.
export const unificallyProvider: RegistryEntry = buildOpenAiCompatibleRegistryEntry({
id: "unifically",
alias: "unifically",
baseUrl: "https://api.unifically.com/v1/chat/completions",
modelsUrl: "https://api.unifically.com/v1/models?category=llm",
models: [],
passthroughModels: true,
});
1 change: 1 addition & 0 deletions src/shared/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const PROVIDER_ENDPOINTS = {
greenpt: "https://api.greenpt.ai/v1/chat/completions",
onomeo: "https://onomeo.com/v1/chat/completions",
eurouter: "https://api.eurouter.ai/v1/chat/completions",
unifically: "https://api.unifically.com/v1/chat/completions",
"y-api": "https://api.y-api.bestvirtualgoods.com/v1/chat/completions",
"mnn-ai": "https://api.mnnai.ru/v1/chat/completions",
"meganova-ai": "https://api.meganova.ai/v1/chat/completions",
Expand Down
1 change: 1 addition & 0 deletions src/shared/constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const AGGREGATOR_PROVIDER_IDS = new Set([
"literouter",
"onomeo",
"eurouter",
"unifically",
"y-api",
"mnn-ai",
"meganova-ai",
Expand Down
2 changes: 2 additions & 0 deletions src/shared/constants/providers/apikey/gateways.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { onomeoGateway } from "./onomeo";
import { unificallyGateway } from "./unifically";
/** APIKEY provider catalog — gateways family. Pure data; merged by apikey/index.ts via spread. */
export const APIKEY_PROVIDERS_GATEWAYS = {
...onomeoGateway,
...unificallyGateway,
// 1min.ai (https://docs.1min.ai) — multi-model chat aggregator with its own
// custom API (single `prompt` string + real SSE, not OpenAI-compatible).
// OmniRoute's oneminai executor translates both directions.
Expand Down
25 changes: 25 additions & 0 deletions src/shared/constants/providers/apikey/unifically.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Unifically API-key catalog entry. Kept out of gateways.ts so that frozen file
* does not grow past its 1544-line ceiling (#14182).
*/
export const unificallyGateway = {
unifically: {
id: "unifically",
serviceKinds: ["llm"],
alias: "unifically",
name: "Unifically",
icon: "hub",
color: "#10B981",
textIcon: "UNI",
passthroughModels: true,
website: "https://unifically.com",
// New accounts get a small one-time starting balance, not a recurring free
// tier, so no Free badge.
hasFree: false,
// Only the chat models are wired here. The image, video and audio models in
// the same catalog run through an async task API (POST /v1/tasks), which
// the default executor does not speak.
apiHint:
"Create a Unifically API key at https://unifically.com/api-keys, then use https://api.unifically.com/v1 as the OpenAI-compatible base URL. Pay per use, no subscription. Chat models only through this entry; the media models in the same catalog use a separate async task API.",
},
} as const;
23 changes: 23 additions & 0 deletions tests/snapshots/provider/translate-path.json
Original file line number Diff line number Diff line change
Expand Up @@ -5944,6 +5944,29 @@
"stream": "https://hermes.ai.unturf.com/v1/chat/completions"
}
},
"unifically": {
"format": "openai",
"headers": {
"apiKey": {
"Accept": "text/event-stream",
"Authorization": "Bearer <TOK>",
"Content-Type": "application/json"
},
"nonStream": {
"Authorization": "Bearer <TOK>",
"Content-Type": "application/json"
},
"oauth": {
"Accept": "text/event-stream",
"Authorization": "Bearer <TOK>",
"Content-Type": "application/json"
}
},
"url": {
"nonStream": "https://api.unifically.com/v1/chat/completions",
"stream": "https://api.unifically.com/v1/chat/completions"
}
},
"unorouter": {
"format": "openai",
"headers": {
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/provider-node-reserved-prefix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ test("shared set size includes live REGISTRY and retired Designer + Felo + Qwen
// (413 -> 412). Measured, not hand-derived: RESERVED_PROVIDER_PREFIXES.size on this head.
// origin/release/v3.8.52 already measures 413 (test still 412, inherited).
// onomeo registers id "onomeo" with the same alias — one REGISTRY member (413 -> 414).
assert.equal(RESERVED_PREFIX_COUNT, 414);
// Unifically (#14182) registers id "unifically" with the same alias — one REGISTRY member
// (414 -> 415).
assert.equal(RESERVED_PREFIX_COUNT, 415);
});

test("isReservedProviderPrefix rejects non-string input", () => {
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/providers-constants-split.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
// Retiring suno (#14224, 4af4937e) removes one specialty-media apikey entry — 241.
// origin/release/v3.8.52 already measures 242 live APIKEY entries (test still 241, inherited).
// onomeo (gateways) adds one apikey entry — 243.
// Unifically (gateways, #14182) adds one apikey entry — 244.
import { test } from "node:test";
import assert from "node:assert/strict";

const P = await import("../../src/shared/constants/providers.ts");

const APIKEY_PROVIDER_COUNT = 243;
const APIKEY_PROVIDER_COUNT = 244;

test("barrel still exports every catalog + key helpers", () => {
for (const name of [
Expand Down
69 changes: 69 additions & 0 deletions tests/unit/unifically-provider.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import assert from "node:assert/strict";
import test from "node:test";

import { unificallyProvider } from "../../open-sse/config/providers/registry/unifically/index.ts";

const { REGISTRY } = await import("../../open-sse/config/providerRegistry.ts");
const { DefaultExecutor, getExecutor } = await import("../../open-sse/executors/index.ts");
const { PROVIDER_ENDPOINTS } = await import("../../src/shared/constants/config.ts");
const { isValidModel } = await import("../../src/shared/constants/models.ts");
const { APIKEY_PROVIDERS } = await import("../../src/shared/constants/providers/apikey/index.ts");
const { AGGREGATOR_PROVIDER_IDS } = await import("../../src/shared/constants/providers.ts");

const CHAT_URL = "https://api.unifically.com/v1/chat/completions";
const MODELS_URL = "https://api.unifically.com/v1/models?category=llm";

test("unifically is an OpenAI-compatible Bearer registry entry", () => {
assert.equal(unificallyProvider.id, "unifically");
assert.equal(unificallyProvider.alias, "unifically");
assert.equal(unificallyProvider.format, "openai");
assert.equal(unificallyProvider.executor, "default");
assert.equal(unificallyProvider.authType, "apikey");
assert.equal(unificallyProvider.authHeader, "bearer");
assert.equal(unificallyProvider.baseUrl, CHAT_URL);
assert.equal(unificallyProvider.passthroughModels, true);
});

test("unifically discovery is scoped to chat models", () => {
// /v1/models returns image, video and audio models too. Those run through
// POST /v1/tasks, not chat completions, so an unscoped listing would offer
// models that fail on every request.
assert.equal(unificallyProvider.modelsUrl, MODELS_URL);
assert.ok(new URL(String(unificallyProvider.modelsUrl)).searchParams.get("category") === "llm");
assert.deepEqual(unificallyProvider.models, []);
});

test("unifically is wired through registry, metadata, endpoint and default executor", async () => {
assert.equal(REGISTRY.unifically?.baseUrl, CHAT_URL);
assert.equal(PROVIDER_ENDPOINTS.unifically, CHAT_URL);
assert.equal(APIKEY_PROVIDERS.unifically?.id, "unifically");
assert.equal(APIKEY_PROVIDERS.unifically?.alias, "unifically");
assert.deepEqual(APIKEY_PROVIDERS.unifically?.serviceKinds, ["llm"]);
assert.ok((await getExecutor("unifically")) instanceof DefaultExecutor);
assert.equal(isValidModel("unifically", "future/live-catalog-model"), true);
});

test("unifically is listed as an aggregator", () => {
// It routes to third-party model providers rather than serving its own inference.
assert.equal(AGGREGATOR_PROVIDER_IDS.has("unifically"), true);
});

test("unifically advertises no free tier", () => {
// New accounts get a one-time starting balance. That is not a recurring free
// allowance, so no Free badge is claimed.
assert.equal(APIKEY_PROVIDERS.unifically?.hasFree, false);
assert.equal(APIKEY_PROVIDERS.unifically?.freeNote, undefined);
});

test("unifically copy says media models are out of scope for this entry", () => {
const hint = String(APIKEY_PROVIDERS.unifically?.apiHint ?? "");
assert.ok(hint.includes("https://api.unifically.com/v1"));
assert.ok(hint.toLowerCase().includes("chat models only"));
});

test("unifically claims no capability that was not exercised", () => {
const metadata = APIKEY_PROVIDERS.unifically as Record<string, unknown>;
for (const key of ["supportsTools", "supportsVision", "capabilities"]) {
assert.equal(metadata[key], undefined, `${key} must not be declared unverified`);
}
});