Coverage for src/local_deep_research/llm/providers/implementations/qwen.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-22 21:20 +0000

1"""QwenCloud LLM provider for Local Deep Research.""" 

2 

3from ..base import Exposure 

4from ..openai_base import OpenAICompatibleProvider 

5 

6 

7class QwenCloudProvider(OpenAICompatibleProvider): 

8 """QwenCloud provider using its OpenAI-compatible endpoint. 

9 

10 QwenCloud (Alibaba's Qwen cloud platform) exposes an OpenAI-compatible 

11 API through its pay-as-you-go compatible-mode endpoint. API keys 

12 are issued at home.qwencloud.com/api-keys. 

13 """ 

14 

15 provider_name = "QwenCloud" 

16 api_key_setting = "llm.qwen.api_key" 

17 default_base_url = "https://maas.qwencloudapi.com/compatible-mode/v1" 

18 # Informational only (create_llm requires an explicit llm.model): the 

19 # flagship model from QwenCloud's own first-API-call quickstart, kept 

20 # concrete like deepseek/atlascloud rather than the "" no-fallback 

21 # convention used by providers without an obvious default. 

22 default_model = "qwen3.8-max" 

23 

24 # Metadata for auto-discovery 

25 provider_key = "QWEN" 

26 company_name = "QwenCloud" 

27 is_cloud = True 

28 # Egress exposure (ADR-0007): cloud inference sink — data leaves the box. 

29 egress_exposure = Exposure.EXPOSING 

30 

31 @classmethod 

32 def requires_auth_for_models(cls): 

33 """QwenCloud requires authentication for listing models. 

34 

35 ``GET /compatible-mode/v1/models`` returns 401 without a valid 

36 Bearer key (verified live), so model discovery only runs once the 

37 API key is configured. 

38 """ 

39 return True