Track live model instances in Ollama and Cohere providers, updating count on model retrieval

This commit is contained in:
hlohaus 2025-09-06 12:10:14 +02:00
parent 3df3595e63
commit 6607c82d3c
3 changed files with 14 additions and 1 deletions

View file

@ -15,9 +15,16 @@ class QwenCode(OpenaiTemplate):
needs_auth = True
active_by_default = True
default_model = "qwen3-coder-plus"
models = [default_model]
client = QwenContentGenerator(QwenOAuth2Client())
@classmethod
def get_models(cls, **kwargs):
if not cls.models:
cls.models = [cls.default_model]
if cls.live == 0 and cls.client.shared_manager.isTokenValid(cls.client.shared_manager.getCurrentCredentials()):
cls.live += 1
return cls.models
@classmethod
async def create_async_generator(
cls,