@wengine-ai/llms 2.3.2441 → 2.3.2443

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,18 @@ export interface ProviderQuotaResult {
15
15
  usedMonthlyBalance?: number;
16
16
  /** ISO timestamp at which the monthly window resets. */
17
17
  resetTimeMonthly?: string;
18
+ /** Precise key-level budget when the quota backend exposes one (LiteLLM
19
+ * GET /key/info). `limit` is the enforced cap; `used`/`duration`/`resetAt`/
20
+ * `currency` refine the window when the backend reports them. This is the
21
+ * authoritative budget source — the same window is also mirrored into the
22
+ * compatible balance/monthly fields for existing projections. */
23
+ keyBudget?: {
24
+ limit: number;
25
+ used?: number;
26
+ duration?: string;
27
+ resetAt?: string;
28
+ currency?: string;
29
+ };
18
30
  }
19
31
  export interface QuotaAdapter {
20
32
  readonly usesVolcengineCredentials?: boolean;
@@ -60,5 +72,6 @@ export declare function volcengineSigV4Sign(options: {
60
72
  xDate: string;
61
73
  }): Record<string, string>;
62
74
  export declare function parseLitellmUserBudgetUsage(payload: any): ProviderQuotaResult | null;
75
+ export declare function parseLitellmKeyBudgetUsage(payload: any, currency?: string): ProviderQuotaResult | null;
63
76
  export declare function parseOneApiBillingUsage(subscription: any, usage: any): ProviderQuotaResult | null;
64
77
  export declare function getQuotaAdapter(baseUrl: string, provider?: LLMProvider): QuotaAdapter | null;
@@ -201,8 +201,15 @@ export interface LLMProvider {
201
201
  /** Optional quota backend framework for private relays without a fixed
202
202
  * public hostname: 'litellm' | 'newapi' | 'oneapi' (hyphenated aliases
203
203
  * accepted). Selects the matching quota adapter ahead of hostname
204
- * detection; unknown values are ignored. */
204
+ * detection; unknown values are ignored. When set to 'litellm', the
205
+ * key-info budget path (GET /key/info with the inference apiKey) is used
206
+ * and takes precedence over quotaLitellmToken's /user/info path. */
205
207
  quotaFramework?: string;
208
+ /** Optional explicit currency code (e.g. 'CNY') for the provider's
209
+ * quota/budget windows, set from config `quota_currency`. When unset,
210
+ * adapters report no currency rather than presuming one — the UI decides
211
+ * how to label an unknown currency. */
212
+ quotaCurrency?: string;
206
213
  transformer?: {
207
214
  [key: string]: {
208
215
  use?: Transformer[];
@@ -250,6 +257,8 @@ export interface ConfigProvider {
250
257
  quota_litellm_token?: string;
251
258
  /** Optional quota backend framework selector (litellm | newapi | oneapi) */
252
259
  quota_framework?: string;
260
+ /** Optional explicit currency code (e.g. CNY) for the provider's quota/budget windows */
261
+ quota_currency?: string;
253
262
  /** Control-plane credentials for Volcengine Coding Plan quota probes. */
254
263
  quotaAccessKey?: string;
255
264
  quotaSecretKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wengine-ai/llms",
3
- "version": "2.3.2441",
3
+ "version": "2.3.2443",
4
4
  "description": "A universal LLM API transformation server",
5
5
  "main": "dist/cjs/server.cjs",
6
6
  "module": "dist/esm/server.mjs",
@@ -53,7 +53,7 @@
53
53
  "@fastify/static": "^8.2.0",
54
54
  "@google/genai": "^1.7.0",
55
55
  "@huggingface/tokenizers": "^0.0.6",
56
- "@wengine-ai/claude-code-router-shared": "^2.3.2441",
56
+ "@wengine-ai/claude-code-router-shared": "^2.3.2443",
57
57
  "adm-zip": "^0.5.16",
58
58
  "better-sqlite3": "^12.10.0",
59
59
  "dotenv": "^16.5.0",