From 01aa6bf11e562ef9bb178638c02b327558808c96 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Wed, 22 Apr 2026 14:19:43 +0800 Subject: [PATCH] refactor(api): include model type in quota identity Add model-type-aware quota helpers at the shared billing boundary while keeping the LLM-specific helpers as thin adapters. Preserve model_type in the deprecated ModelInstance wrappers and extend the quota unit tests to cover the generic helper delegation path. --- api/core/app/llm/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/core/app/llm/__init__.py b/api/core/app/llm/__init__.py index d20a5b2344..85f342de5d 100644 --- a/api/core/app/llm/__init__.py +++ b/api/core/app/llm/__init__.py @@ -3,13 +3,17 @@ from .quota import ( deduct_llm_quota, deduct_llm_quota_for_model, + deduct_model_quota, ensure_llm_quota_available, ensure_llm_quota_available_for_model, + ensure_model_quota_available, ) __all__ = [ "deduct_llm_quota", "deduct_llm_quota_for_model", + "deduct_model_quota", "ensure_llm_quota_available", "ensure_llm_quota_available_for_model", + "ensure_model_quota_available", ]