| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- /**
- * vim: set noet ts=8:
- * DuckCoding AI Custom Provider
- *
- * Provides access to DuckCoding AI models via an OpenAI-compatible API.
- *
- * Usage:
- * Set the DUCKCODING_API_KEY environment variable with your API key.
- * Then use /model to select duckcoding/<model-id>.
- *
- * Model availability and rates come from DuckCoding's pricing endpoint.
- * The authenticated `/v1/models` list narrows that catalog to the models the
- * API key's billing group can actually use; the result is cached for an hour
- * and revalidated on refresh. Capabilities and limits come from the Pi model
- * catalog: the public catalog is fetched when the cache is refreshed, and Pi's
- * local registry re-applies catalog metadata at session start so an offline or
- * partial refresh still resolves correctly. The cache is refreshed after seven
- * days by default. Set DUCKCODING_MODEL_CACHE_TTL_MS to override the cache
- * lifetime.
- */
- import { createHash } from "node:crypto";
- import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
- import { homedir } from "node:os";
- import { join } from "node:path";
- import type { ExtensionAPI, ProviderModelConfig } from "@earendil-works/pi-coding-agent";
- type ChatModelConfig = Extract<ProviderModelConfig, { reasoning: boolean }>;
- type DuckCodingPricingModel = {
- model_name?: string;
- vendor_id?: number;
- quota_type?: number;
- supported_endpoint_types?: string[];
- enable_groups?: string[];
- model_price?: number;
- model_ratio?: number;
- completion_ratio?: number;
- cache_ratio?: number;
- create_cache_ratio?: number;
- billing_expr?: string;
- };
- type DuckCodingPricingResponse = {
- success?: boolean;
- vendors?: Array<{ id?: number; name?: string }>;
- data?: DuckCodingPricingModel[];
- };
- type DuckCodingModelsResponse = {
- data?: Array<{ id?: string }>;
- };
- type CatalogModel = {
- id?: string;
- provider?: string;
- type?: string;
- reasoning?: boolean;
- input?: string[];
- contextWindow?: number;
- maxTokens?: number;
- thinkingLevelMap?: ChatModelConfig["thinkingLevelMap"];
- };
- type CatalogIndex = Map<string, Map<string, CatalogModel>>;
- type ModelSet = {
- models: ChatModelConfig[];
- /** DuckCoding model ID → Pi catalog provider ID (google, anthropic, …). */
- vendorProviders: Map<string, string>;
- };
- type CachedModels = {
- version: number;
- fetchedAt: number;
- degraded?: boolean;
- models: ChatModelConfig[];
- vendorProviders: Record<string, string>;
- };
- type CachedAvailability = {
- version: number;
- keyHash: string;
- checkedAt: number;
- ids: string[];
- };
- const PRICING_URL = "https://www.duckcoding.ai/api/pricing";
- const MODELS_URL = "https://api.duckcoding.ai/v1/models";
- const CATALOG_BASE_URL = "https://pi.dev";
- const CATALOG_TIMEOUT_MS = 5_000;
- const CATALOG_TOTAL_BUDGET_MS = 12_000;
- const PRICING_TIMEOUT_MS = 15_000;
- const AVAILABILITY_TIMEOUT_MS = 6_000;
- const AVAILABILITY_TTL_MS = 60 * 60 * 1000;
- const AVAILABILITY_CACHE_VERSION = 1;
- const DEFAULT_MODEL_CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1000;
- // Retry sooner when the Pi catalog could not be fetched and some limits fell
- // back to family defaults.
- const DEGRADED_CACHE_TTL_MS = 6 * 60 * 60 * 1000;
- const CACHE_VERSION = 2;
- const MODEL_CACHE_DIR = join(homedir(), ".cache", "pi-agent-duckcoding");
- const MODEL_CACHE_PATH = join(MODEL_CACHE_DIR, "models.json");
- const AVAILABILITY_CACHE_PATH = join(MODEL_CACHE_DIR, "availability.json");
- /** DuckCoding vendor names mapped to Pi catalog provider IDs. */
- const VENDOR_CATALOG_PROVIDERS: Record<string, string> = {
- gemini: "google",
- anthropic: "anthropic",
- openai: "openai",
- grok: "xai",
- deepseek: "deepseek",
- zhipu: "zai",
- "智谱": "zai",
- };
- type FamilyDefaults = {
- reasoning: boolean;
- contextWindow: number;
- maxTokens: number;
- };
- function titleCaseModelName(modelName: string) {
- return modelName
- .split(/[-_/]+/)
- .map((part) => (part ? part[0].toUpperCase() + part.slice(1) : part))
- .join(" ");
- }
- /** Fallback limits for models missing from the Pi catalog. */
- function inferFamilyDefaults(modelName: string): FamilyDefaults {
- if (/gemini-3|gemini-2\.5/i.test(modelName)) {
- return { reasoning: true, contextWindow: 1048576, maxTokens: 65536 };
- }
- if (/^claude/i.test(modelName)) {
- return { reasoning: true, contextWindow: 1000000, maxTokens: 128000 };
- }
- if (/^gpt-6|^gpt-5\.6/i.test(modelName)) {
- return { reasoning: true, contextWindow: 272000, maxTokens: 128000 };
- }
- if (/^gpt-5|^o[34]/i.test(modelName)) {
- return { reasoning: true, contextWindow: 400000, maxTokens: 128000 };
- }
- if (/^grok-[5-9]|^grok-4\.[5-9]/i.test(modelName)) {
- return { reasoning: true, contextWindow: 500000, maxTokens: 500000 };
- }
- if (/^grok-4/i.test(modelName)) {
- return { reasoning: true, contextWindow: 200000, maxTokens: 32000 };
- }
- if (/^deepseek/i.test(modelName)) {
- return { reasoning: true, contextWindow: 1000000, maxTokens: 384000 };
- }
- if (/^glm-5/i.test(modelName)) {
- return { reasoning: true, contextWindow: 1000000, maxTokens: 131072 };
- }
- if (/reasoner|thinking|codex/i.test(modelName)) {
- return { reasoning: true, contextWindow: 400000, maxTokens: 128000 };
- }
- return { reasoning: false, contextWindow: 128000, maxTokens: 16384 };
- }
- function inferInputModes(endpoints: string[] = []) {
- const input: ChatModelConfig["input"] = ["text"];
- if (endpoints.some((endpoint) => ["openai", "anthropic", "gemini"].includes(endpoint))) {
- input.push("image");
- }
- return input;
- }
- function normalizeInput(input: string[] | undefined): ChatModelConfig["input"] {
- const modes: ChatModelConfig["input"] = [];
- for (const mode of input ?? []) {
- if ((mode === "text" || mode === "image") && !modes.includes(mode)) modes.push(mode);
- }
- if (modes.length === 0) modes.push("text");
- return modes;
- }
- function roundRate(value: number) {
- return Number.isFinite(value) ? Number(value.toFixed(6)) : 0;
- }
- /**
- * DuckCoding bills through a small expression language. The standard tier is
- * listed first; `p`, `c`, `cr`, and `cc` are USD per million input, output,
- * cache-read, and cache-write tokens.
- */
- function parseBillingExpr(expr: string | undefined) {
- if (!expr) return undefined;
- const rate = (variable: string) => {
- const match = expr.match(new RegExp(`(?:^|[^a-zA-Z0-9_])${variable}\\s*\\*\\s*([0-9]+(?:\\.[0-9]+)?)`));
- return match ? roundRate(Number(match[1])) : 0;
- };
- return {
- input: rate("p"),
- output: rate("c"),
- cacheRead: rate("cr"),
- cacheWrite: rate("cc"),
- };
- }
- function inferCost(model: DuckCodingPricingModel): ChatModelConfig["cost"] {
- const parsed = parseBillingExpr(model.billing_expr);
- if (parsed && (parsed.input || parsed.output || parsed.cacheRead || parsed.cacheWrite)) return parsed;
- // Legacy fallback: `model_ratio` is a quota ratio, not USD per token.
- const input = roundRate((model.model_ratio ?? 0) * 2);
- return {
- input,
- output: roundRate(input * (model.completion_ratio ?? 0)),
- cacheRead: roundRate(input * (model.cache_ratio ?? 0)),
- cacheWrite: roundRate(input * (model.create_cache_ratio ?? 0)),
- };
- }
- /** Exclude image, video, embedding, and classifier entries billed per request. */
- function isChatModel(model: DuckCodingPricingModel) {
- if (!model.model_name) return false;
- if (model.quota_type !== undefined && model.quota_type !== 0) return false;
- if (!(model.supported_endpoint_types ?? []).some((endpoint) => endpoint === "openai" || endpoint === "anthropic")) {
- return false;
- }
- return !/^jev-/i.test(model.model_name);
- }
- function vendorCatalogProvider(vendorId: number | undefined, vendors: Map<number, string>) {
- if (vendorId === undefined) return undefined;
- const name = vendors.get(vendorId)?.trim().toLowerCase();
- return name ? VENDOR_CATALOG_PROVIDERS[name] : undefined;
- }
- function catalogIdCandidates(id: string) {
- const candidates = [id];
- const compactStripped = id.replace(/-openai-compact$/, "");
- if (compactStripped !== id) candidates.push(compactStripped);
- return candidates;
- }
- function findCatalogModel(catalogs: CatalogIndex, provider: string | undefined, modelName: string) {
- if (!provider) return undefined;
- const catalog = catalogs.get(provider);
- if (!catalog) return undefined;
- for (const candidate of catalogIdCandidates(modelName)) {
- const entry = catalog.get(candidate);
- if (entry) return entry;
- }
- return undefined;
- }
- function withCatalogMetadata(model: ChatModelConfig, catalog: CatalogModel | undefined) {
- if (!catalog) return model;
- return {
- ...model,
- reasoning: catalog.reasoning ?? model.reasoning,
- input: catalog.input ? normalizeInput(catalog.input) : model.input,
- contextWindow: catalog.contextWindow ?? model.contextWindow,
- maxTokens: catalog.maxTokens ?? model.maxTokens,
- thinkingLevelMap: catalog.thinkingLevelMap ?? model.thinkingLevelMap,
- };
- }
- function sameModelMetadata(a: ChatModelConfig, b: ChatModelConfig) {
- return (
- a.reasoning === b.reasoning &&
- a.contextWindow === b.contextWindow &&
- a.maxTokens === b.maxTokens &&
- JSON.stringify(a.input) === JSON.stringify(b.input) &&
- JSON.stringify(a.thinkingLevelMap ?? null) === JSON.stringify(b.thinkingLevelMap ?? null)
- );
- }
- function applyCatalogMetadata(models: ChatModelConfig[], vendorProviders: Map<string, string>, catalogs: CatalogIndex) {
- return models.map((model) =>
- withCatalogMetadata(model, findCatalogModel(catalogs, vendorProviders.get(model.id), model.id)),
- );
- }
- async function fetchCatalogProvider(provider: string, timeoutMs: number) {
- const url = `${CATALOG_BASE_URL}/api/models/providers/${encodeURIComponent(provider)}?types=chat`;
- try {
- const response = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
- if (!response.ok) return undefined;
- const payload = (await response.json()) as unknown;
- const entries = Array.isArray(payload)
- ? payload
- : typeof payload === "object" && payload !== null && Array.isArray((payload as { models?: unknown }).models)
- ? ((payload as { models: unknown[] }).models as unknown[])
- : [];
- const models = new Map<string, CatalogModel>();
- for (const entry of entries) {
- if (typeof entry !== "object" || entry === null) continue;
- const model = entry as CatalogModel;
- if (typeof model.id !== "string") continue;
- if (model.type !== undefined && model.type !== "chat") continue;
- models.set(model.id, model);
- }
- return models.size > 0 ? models : undefined;
- } catch {
- return undefined;
- }
- }
- function collectCatalogProviders(pricing: DuckCodingPricingResponse) {
- const vendors = new Map<number, string>();
- for (const vendor of pricing.vendors ?? []) {
- if (vendor.id !== undefined && vendor.name) vendors.set(vendor.id, vendor.name);
- }
- const providers = new Set<string>();
- for (const model of pricing.data ?? []) {
- if (!isChatModel(model)) continue;
- const provider = vendorCatalogProvider(model.vendor_id, vendors);
- if (provider) providers.add(provider);
- }
- return [...providers];
- }
- async function fetchCatalogs(pricing: DuckCodingPricingResponse) {
- const providers = collectCatalogProviders(pricing);
- const deadline = Date.now() + CATALOG_TOTAL_BUDGET_MS;
- const catalogs: CatalogIndex = new Map();
- const pending = new Set(providers);
- // Keep catalog work bounded. A few quick parallel requests cover the normal
- // case; failures are retried one at a time while the budget lasts, which is
- // more reliable than hammering a proxy with a second parallel wave.
- await Promise.all(
- providers.map(async (provider) => {
- const remaining = deadline - Date.now();
- if (remaining <= 0) return;
- const models = await fetchCatalogProvider(provider, Math.min(CATALOG_TIMEOUT_MS, remaining));
- if (models) {
- catalogs.set(provider, models);
- pending.delete(provider);
- }
- }),
- );
- for (const provider of [...pending]) {
- const remaining = deadline - Date.now();
- if (remaining <= 0) break;
- const models = await fetchCatalogProvider(provider, Math.min(CATALOG_TIMEOUT_MS, remaining));
- if (models) {
- catalogs.set(provider, models);
- pending.delete(provider);
- }
- }
- return { catalogs, degraded: pending.size > 0 };
- }
- /** Build a catalog index from the models Pi already has registered locally. */
- function localCatalogIndex(models: readonly CatalogModel[]): CatalogIndex {
- const catalogs: CatalogIndex = new Map();
- for (const model of models) {
- if (typeof model.id !== "string" || typeof model.provider !== "string") continue;
- if (!Object.values(VENDOR_CATALOG_PROVIDERS).includes(model.provider)) continue;
- const provider = model.provider;
- let catalog = catalogs.get(provider);
- if (!catalog) catalogs.set(provider, (catalog = new Map()));
- catalog.set(model.id, model);
- }
- return catalogs;
- }
- function createModels(pricing: DuckCodingPricingResponse, catalogs: CatalogIndex): ModelSet {
- const vendors = new Map<number, string>();
- for (const vendor of pricing.vendors ?? []) {
- if (vendor.id !== undefined && vendor.name) vendors.set(vendor.id, vendor.name);
- }
- const vendorProviders = new Map<string, string>();
- const models = (pricing.data ?? [])
- .filter(isChatModel)
- .map((model): ChatModelConfig => {
- const id = model.model_name!;
- const provider = vendorCatalogProvider(model.vendor_id, vendors);
- if (provider) vendorProviders.set(id, provider);
- const fallback = inferFamilyDefaults(id);
- return withCatalogMetadata(
- {
- id,
- name: titleCaseModelName(id),
- reasoning: fallback.reasoning,
- input: inferInputModes(model.supported_endpoint_types),
- cost: inferCost(model),
- contextWindow: fallback.contextWindow,
- maxTokens: fallback.maxTokens,
- },
- findCatalogModel(catalogs, provider, id),
- );
- })
- .sort((a, b) => a.id.localeCompare(b.id));
- return { models, vendorProviders };
- }
- async function readCachedModels() {
- try {
- const cached = JSON.parse(await readFile(MODEL_CACHE_PATH, "utf8")) as CachedModels;
- if (
- cached.version === CACHE_VERSION &&
- Array.isArray(cached.models) &&
- typeof cached.fetchedAt === "number" &&
- typeof cached.vendorProviders === "object" &&
- cached.vendorProviders !== null
- ) {
- return cached;
- }
- } catch {
- // A missing, outdated, or invalid cache is treated as a cache miss.
- }
- return undefined;
- }
- async function writeCachedModels(set: ModelSet, degraded: boolean) {
- const temporaryPath = `${MODEL_CACHE_PATH}.tmp`;
- await mkdir(MODEL_CACHE_DIR, { recursive: true });
- await writeFile(
- temporaryPath,
- JSON.stringify(
- {
- version: CACHE_VERSION,
- fetchedAt: Date.now(),
- degraded,
- models: set.models,
- vendorProviders: Object.fromEntries(set.vendorProviders),
- },
- null,
- 2,
- ),
- );
- await rename(temporaryPath, MODEL_CACHE_PATH);
- }
- async function fetchPricing() {
- const response = await fetch(PRICING_URL, { signal: AbortSignal.timeout(PRICING_TIMEOUT_MS) });
- if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);
- return (await response.json()) as DuckCodingPricingResponse;
- }
- /**
- * The authenticated model list only contains models enabled for the API key's
- * billing group. The pricing endpoint lists every group, so it over-advertises
- * models that would fail with `model_not_found`.
- */
- async function fetchAvailableModelIds(apiKey: string, signal: AbortSignal) {
- try {
- const response = await fetch(MODELS_URL, {
- headers: { Authorization: `Bearer ${apiKey}`, Accept: "application/json" },
- signal: AbortSignal.any([signal, AbortSignal.timeout(AVAILABILITY_TIMEOUT_MS)]),
- });
- if (!response.ok) return undefined;
- const payload = (await response.json()) as DuckCodingModelsResponse;
- const ids = new Set<string>();
- for (const model of payload.data ?? []) {
- if (typeof model.id === "string") ids.add(model.id);
- }
- return ids.size > 0 ? ids : undefined;
- } catch {
- return undefined;
- }
- }
- function hashApiKey(apiKey: string) {
- return createHash("sha256").update(apiKey).digest("hex").slice(0, 16);
- }
- async function readCachedAvailability() {
- try {
- const cached = JSON.parse(await readFile(AVAILABILITY_CACHE_PATH, "utf8")) as CachedAvailability;
- if (
- cached.version === AVAILABILITY_CACHE_VERSION &&
- typeof cached.keyHash === "string" &&
- typeof cached.checkedAt === "number" &&
- Array.isArray(cached.ids)
- ) {
- return cached;
- }
- } catch {
- // A missing or invalid availability cache is treated as a cache miss.
- }
- return undefined;
- }
- async function writeCachedAvailability(keyHash: string, ids: Set<string>) {
- const temporaryPath = `${AVAILABILITY_CACHE_PATH}.tmp`;
- await mkdir(MODEL_CACHE_DIR, { recursive: true });
- await writeFile(
- temporaryPath,
- JSON.stringify({
- version: AVAILABILITY_CACHE_VERSION,
- keyHash,
- checkedAt: Date.now(),
- ids: [...ids],
- }),
- );
- await rename(temporaryPath, AVAILABILITY_CACHE_PATH);
- }
- async function getModels(): Promise<ModelSet> {
- const cached = await readCachedModels();
- const cacheTtl = Number(process.env.DUCKCODING_MODEL_CACHE_TTL_MS ?? DEFAULT_MODEL_CACHE_TTL_MS);
- const ttl = Number.isFinite(cacheTtl) && cacheTtl >= 0 ? cacheTtl : DEFAULT_MODEL_CACHE_TTL_MS;
- const effectiveTtl = cached?.degraded ? Math.min(ttl, DEGRADED_CACHE_TTL_MS) : ttl;
- if (cached && Date.now() - cached.fetchedAt < effectiveTtl) {
- return { models: cached.models, vendorProviders: new Map(Object.entries(cached.vendorProviders)) };
- }
- try {
- const pricing = await fetchPricing();
- const { catalogs, degraded } = await fetchCatalogs(pricing);
- const set = createModels(pricing, catalogs);
- if (set.models.length === 0) throw new Error("pricing response contained no compatible models");
- try {
- await writeCachedModels(set, degraded);
- } catch {
- // The freshly fetched list is still usable if the cache cannot be written.
- }
- return set;
- } catch (error) {
- if (cached) return { models: cached.models, vendorProviders: new Map(Object.entries(cached.vendorProviders)) };
- throw new Error(`Failed to fetch DuckCoding pricing: ${error instanceof Error ? error.message : String(error)}`);
- }
- }
- type AvailabilityState = {
- ids: Set<string> | undefined;
- keyHash: string | undefined;
- checkedAt: number | undefined;
- load: Promise<void> | undefined;
- inFlight: Promise<void> | undefined;
- };
- function registerDuckCoding(pi: ExtensionAPI, models: ChatModelConfig[], availability: AvailabilityState) {
- const availableModels = () => {
- if (!availability.ids) return models;
- const filtered = models.filter((model) => availability.ids?.has(model.id));
- // If the pricing catalog and the key's model list share nothing, keep the
- // full list rather than presenting an empty provider.
- return filtered.length > 0 ? filtered : models;
- };
- pi.registerProvider("duckcoding", {
- name: "DuckCoding AI",
- baseUrl: "https://api.duckcoding.ai/v1",
- apiKey: "$DUCKCODING_API_KEY",
- api: "openai-completions",
- models: availableModels(),
- headers: {},
- refreshModels: async (context) => {
- const apiKey = context.credential?.type === "api_key" ? context.credential.key : undefined;
- const keyHash = apiKey ? hashApiKey(apiKey) : undefined;
- if (!availability.load) {
- availability.load = (async () => {
- const cached = await readCachedAvailability();
- if (cached) {
- availability.ids = new Set(cached.ids);
- availability.keyHash = cached.keyHash;
- availability.checkedAt = cached.checkedAt;
- }
- })();
- }
- await availability.load;
- const cacheMatches = keyHash !== undefined && availability.keyHash === keyHash;
- if (!cacheMatches) {
- // Never apply a previous key's availability to a different credential.
- availability.ids = undefined;
- availability.checkedAt = undefined;
- }
- const stale = !availability.checkedAt || Date.now() - availability.checkedAt > AVAILABILITY_TTL_MS;
- // Pi passes allowNetwork=false during normal startup, so honoring that
- // flag here would leave dead models in the picker. This is a small,
- // credential-scoped check with its own TTL cache; explicit offline mode
- // still short-circuits it.
- const canRefresh = apiKey !== undefined && keyHash !== undefined && !context.signal.aborted && !process.env.PI_OFFLINE;
- if (stale && canRefresh) {
- if (!availability.inFlight) {
- availability.inFlight = (async () => {
- try {
- const ids = await fetchAvailableModelIds(apiKey!, context.signal);
- if (ids) {
- availability.ids = ids;
- availability.keyHash = keyHash!;
- availability.checkedAt = Date.now();
- try {
- await writeCachedAvailability(keyHash!, ids);
- } catch {
- // Availability still applies for this process.
- }
- }
- } finally {
- availability.inFlight = undefined;
- }
- })();
- }
- await availability.inFlight;
- }
- return availableModels();
- },
- });
- }
- export default async function (pi: ExtensionAPI) {
- let { models, vendorProviders } = await getModels();
- const availability: AvailabilityState = {
- ids: undefined,
- keyHash: undefined,
- checkedAt: undefined,
- load: undefined,
- inFlight: undefined,
- };
- registerDuckCoding(pi, models, availability);
- // Pi's local registry includes the bundled catalog for built-in providers.
- // Prefer it at session start: it is offline-safe and repairs any model that
- // used family defaults because the public catalog was unreachable.
- pi.on("session_start", (_event, ctx) => {
- const catalogs = localCatalogIndex(ctx.modelRegistry.getAll());
- if (catalogs.size === 0) return;
- const enriched = applyCatalogMetadata(models, vendorProviders, catalogs);
- if (enriched.some((model, index) => !sameModelMetadata(model, models[index]))) {
- models = enriched;
- registerDuckCoding(pi, models, availability);
- }
- });
- }
|