

























@@ -30,7 +30,18 @@ const HIGH_SIGNAL_LIVE_MODEL_PRIORITY = [
3030"minimax-portal/minimax-m2.7",
3131] as const;
323233+const SMALL_LIVE_MODEL_PRIORITY = [
34+"lmstudio/qwen/qwen3.5-9b",
35+"vllm/qwen/qwen3-8b",
36+"sglang/qwen/qwen3-8b",
37+"openrouter/qwen/qwen3.5-9b",
38+"openrouter/z-ai/glm-5.1",
39+"openrouter/z-ai/glm-5",
40+"zai/glm-5.1",
41+] as const;
42+3343export const DEFAULT_HIGH_SIGNAL_LIVE_MODEL_LIMIT = HIGH_SIGNAL_LIVE_MODEL_PRIORITY.length;
44+export const DEFAULT_SMALL_LIVE_MODEL_LIMIT = SMALL_LIVE_MODEL_PRIORITY.length;
3445const DEFAULT_HIGH_SIGNAL_LIVE_EXCLUDED_PROVIDERS = new Set(["codex", "codex-cli", "openai-codex"]);
3546const CURATED_ONLY_HIGH_SIGNAL_LIVE_PROVIDERS = new Set([
3647"fireworks",
@@ -42,6 +53,9 @@ const CURATED_ONLY_HIGH_SIGNAL_LIVE_PROVIDERS = new Set([
4253const HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX = new Map<string, number>(
4354HIGH_SIGNAL_LIVE_MODEL_PRIORITY.map((key, index) => [key, index]),
4455);
56+const SMALL_LIVE_MODEL_PRIORITY_INDEX = new Map<string, number>(
57+SMALL_LIVE_MODEL_PRIORITY.map((key, index) => [key, index]),
58+);
4559const HIGH_SIGNAL_LIVE_MODEL_IDS_BY_PROVIDER = new Map<string, Set<string>>();
4660for (const key of HIGH_SIGNAL_LIVE_MODEL_PRIORITY) {
4761const separatorIndex = key.indexOf("/");
@@ -200,12 +214,29 @@ export function isHighSignalLiveModelRef(ref: ModelRef): boolean {
200214}
201215202216export function isPrioritizedHighSignalLiveModelRef(ref: ModelRef): boolean {
203-const key = toCanonicalHighSignalLiveModelKey(ref);
204-return key !== null && HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX.has(key);
217+return hasPrioritizedLiveModelRef(HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX, ref);
218+}
219+220+export function isSmallLiveModelRef(ref: ModelRef): boolean {
221+return hasPrioritizedLiveModelRef(SMALL_LIVE_MODEL_PRIORITY_INDEX, ref);
222+}
223+224+export function isPrioritizedSmallLiveModelRef(ref: ModelRef): boolean {
225+return isSmallLiveModelRef(ref);
205226}
206227207228export function listPrioritizedHighSignalLiveModelRefs(): Array<{ provider: string; id: string }> {
208-return HIGH_SIGNAL_LIVE_MODEL_PRIORITY.map((key) => {
229+return listPrioritizedLiveModelRefs(HIGH_SIGNAL_LIVE_MODEL_PRIORITY);
230+}
231+232+export function listPrioritizedSmallLiveModelRefs(): Array<{ provider: string; id: string }> {
233+return listPrioritizedLiveModelRefs(SMALL_LIVE_MODEL_PRIORITY);
234+}
235+236+function listPrioritizedLiveModelRefs(
237+priority: readonly string[],
238+): Array<{ provider: string; id: string }> {
239+return priority.map((key) => {
209240const separatorIndex = key.indexOf("/");
210241return {
211242provider: key.slice(0, separatorIndex),
@@ -258,7 +289,7 @@ export function shouldExcludeProviderFromDefaultHighSignalLiveSweep(params: {
258289return true;
259290}
260291261-function toCanonicalHighSignalLiveModelKey(ref: ModelRef): string | null {
292+function toCanonicalLiveModelKey(ref: ModelRef): string | null {
262293const provider = normalizeProviderId(ref.provider ?? "");
263294const rawId = normalizeLowercaseStringOrEmpty(ref.id);
264295if (!provider || !rawId) {
@@ -267,6 +298,11 @@ function toCanonicalHighSignalLiveModelKey(ref: ModelRef): string | null {
267298return `${provider}/${rawId}`;
268299}
269300301+function hasPrioritizedLiveModelRef(index: ReadonlyMap<string, number>, ref: ModelRef): boolean {
302+const key = toCanonicalLiveModelKey(ref);
303+return key !== null && index.has(key);
304+}
305+270306function capByProviderSpread<T>(
271307items: T[],
272308maxItems: number,
@@ -315,19 +351,44 @@ export function selectHighSignalLiveItems<T>(
315351maxItems: number,
316352refOf: (item: T) => ModelRef,
317353providerOf: (item: T) => string,
354+): T[] {
355+return selectPrioritizedLiveItems(
356+items,
357+maxItems,
358+refOf,
359+providerOf,
360+HIGH_SIGNAL_LIVE_MODEL_PRIORITY,
361+);
362+}
363+364+export function selectSmallLiveItems<T>(
365+items: T[],
366+maxItems: number,
367+refOf: (item: T) => ModelRef,
368+providerOf: (item: T) => string,
369+): T[] {
370+return selectPrioritizedLiveItems(items, maxItems, refOf, providerOf, SMALL_LIVE_MODEL_PRIORITY);
371+}
372+373+function selectPrioritizedLiveItems<T>(
374+items: T[],
375+maxItems: number,
376+refOf: (item: T) => ModelRef,
377+providerOf: (item: T) => string,
378+priority: readonly string[],
318379): T[] {
319380if (maxItems <= 0 || items.length <= maxItems) {
320381return items;
321382}
322383323384const remaining = [...items];
324385const selected: T[] = [];
325-for (const preferredKey of HIGH_SIGNAL_LIVE_MODEL_PRIORITY) {
386+for (const preferredKey of priority) {
326387if (selected.length >= maxItems) {
327388break;
328389}
329390const preferredIndex = remaining.findIndex(
330-(item) => toCanonicalHighSignalLiveModelKey(refOf(item)) === preferredKey,
391+(item) => toCanonicalLiveModelKey(refOf(item)) === preferredKey,
331392);
332393if (preferredIndex < 0) {
333394continue;
@@ -362,7 +423,7 @@ export function resolveHighSignalLiveModelLimit(params: {
362423}
363424364425export function getHighSignalLiveModelPriorityIndex(ref: ModelRef): number | null {
365-const key = toCanonicalHighSignalLiveModelKey(ref);
426+const key = toCanonicalLiveModelKey(ref);
366427if (!key) {
367428return null;
368429}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。