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

12 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-03 23:15 +0000

1"""xAI Grok LLM provider for Local Deep Research.""" 

2 

3from ..openai_base import OpenAICompatibleProvider 

4 

5 

6class XAIProvider(OpenAICompatibleProvider): 

7 """xAI Grok provider using OpenAI-compatible endpoint. 

8 

9 This uses xAI's OpenAI-compatible API endpoint to access Grok models. 

10 """ 

11 

12 provider_name = "xAI Grok" 

13 api_key_setting = "llm.xai.api_key" 

14 default_base_url = "https://api.x.ai/v1" 

15 default_model = "" # User must explicitly pick a model — no silent fallback 

16 

17 # Metadata for auto-discovery 

18 provider_key = "XAI" 

19 company_name = "xAI" 

20 is_cloud = True 

21 

22 @classmethod 

23 def requires_auth_for_models(cls): 

24 """xAI requires authentication for listing models.""" 

25 return True