Mohammed AL Sarraj commited on
Commit
009e621
·
1 Parent(s): 7e6a5ea

fix: remove paid providers (DeepSeek/Together), fix Cohere model name

Browse files
Files changed (1) hide show
  1. app/core/ai.py +4 -18
app/core/ai.py CHANGED
@@ -18,8 +18,6 @@ _PROVIDER_URLS = {
18
  "openrouter": "https://openrouter.ai/api/v1/chat/completions",
19
  "mistral": "https://api.mistral.ai/v1/chat/completions",
20
  "openai": "https://api.openai.com/v1/chat/completions",
21
- "deepseek": "https://api.deepseek.com/chat/completions",
22
- "together": "https://api.together.xyz/v1/chat/completions",
23
  "cohere": "https://api.cohere.com/v2/chat",
24
  }
25
 
@@ -29,8 +27,6 @@ _FREE_MODELS = {
29
  "cerebras": "llama3.1-8b",
30
  "openrouter": "google/gemma-3-12b-it:free",
31
  "mistral": "mistral-small-latest",
32
- "deepseek": "deepseek-chat",
33
- "together": "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free",
34
  "cohere": "command-r-08-2024",
35
  }
36
  _PREMIUM_MODELS = {
@@ -39,8 +35,6 @@ _PREMIUM_MODELS = {
39
  "openrouter": "google/gemma-3-27b-it:free",
40
  "mistral": "mistral-medium-latest",
41
  "openai": "gpt-4o-mini",
42
- "deepseek": "deepseek-chat",
43
- "together": "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free",
44
  "cohere": "command-r-08-2024",
45
  }
46
 
@@ -55,8 +49,6 @@ _TASK_MODELS = {
55
  "cerebras": "qwen-3-235b-a22b-instruct-2507",
56
  "openrouter": "google/gemma-3-27b-it:free",
57
  "mistral": "mistral-medium-latest",
58
- "deepseek": "deepseek-chat",
59
- "together": "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free",
60
  "cohere": "command-r7b-arabic-02-2025",
61
  },
62
  "code": {
@@ -64,8 +56,6 @@ _TASK_MODELS = {
64
  "cerebras": "qwen-3-235b-a22b-instruct-2507",
65
  "openrouter": "google/gemma-3-27b-it:free",
66
  "mistral": "mistral-medium-latest",
67
- "deepseek": "deepseek-chat",
68
- "together": "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free",
69
  "cohere": "command-r-08-2024",
70
  },
71
  "fast": {
@@ -73,18 +63,16 @@ _TASK_MODELS = {
73
  "cerebras": "llama3.1-8b",
74
  "openrouter": "google/gemma-3-12b-it:free",
75
  "mistral": "mistral-small-latest",
76
- "deepseek": "deepseek-chat",
77
- "together": "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free",
78
  "cohere": "command-r-08-2024",
79
  },
80
  }
81
 
82
  # ── Task-specific provider priority ──
83
  _TASK_PRIORITY = {
84
- "arabic": ["cerebras", "deepseek", "groq", "together", "openrouter", "cohere", "mistral"],
85
- "code": ["deepseek", "groq", "cerebras", "together", "openrouter", "cohere", "mistral"],
86
- "fast": ["cerebras", "groq", "together", "deepseek", "openrouter", "cohere", "mistral"],
87
- "default": ["groq", "cerebras", "deepseek", "together", "openrouter", "cohere", "mistral"],
88
  }
89
 
90
  _CHAIN_CFG = {
@@ -93,8 +81,6 @@ _CHAIN_CFG = {
93
  "openrouter": {"key_env": "OPENROUTER_API_KEY", "timeout": 45,
94
  "extra": {"HTTP-Referer": "https://github.com/Moealsarraj", "X-Title": "AI Tools"}},
95
  "mistral": {"key_env": "MISTRAL_API_KEY", "timeout": 40, "extra": {}},
96
- "deepseek": {"key_env": "DEEPSEEK_API_KEY", "timeout": 60, "extra": {}},
97
- "together": {"key_env": "TOGETHER_API_KEY", "timeout": 45, "extra": {}},
98
  "cohere": {"key_env": "COHERE_API_KEY", "timeout": 45, "extra": {}},
99
  }
100
 
 
18
  "openrouter": "https://openrouter.ai/api/v1/chat/completions",
19
  "mistral": "https://api.mistral.ai/v1/chat/completions",
20
  "openai": "https://api.openai.com/v1/chat/completions",
 
 
21
  "cohere": "https://api.cohere.com/v2/chat",
22
  }
23
 
 
27
  "cerebras": "llama3.1-8b",
28
  "openrouter": "google/gemma-3-12b-it:free",
29
  "mistral": "mistral-small-latest",
 
 
30
  "cohere": "command-r-08-2024",
31
  }
32
  _PREMIUM_MODELS = {
 
35
  "openrouter": "google/gemma-3-27b-it:free",
36
  "mistral": "mistral-medium-latest",
37
  "openai": "gpt-4o-mini",
 
 
38
  "cohere": "command-r-08-2024",
39
  }
40
 
 
49
  "cerebras": "qwen-3-235b-a22b-instruct-2507",
50
  "openrouter": "google/gemma-3-27b-it:free",
51
  "mistral": "mistral-medium-latest",
 
 
52
  "cohere": "command-r7b-arabic-02-2025",
53
  },
54
  "code": {
 
56
  "cerebras": "qwen-3-235b-a22b-instruct-2507",
57
  "openrouter": "google/gemma-3-27b-it:free",
58
  "mistral": "mistral-medium-latest",
 
 
59
  "cohere": "command-r-08-2024",
60
  },
61
  "fast": {
 
63
  "cerebras": "llama3.1-8b",
64
  "openrouter": "google/gemma-3-12b-it:free",
65
  "mistral": "mistral-small-latest",
 
 
66
  "cohere": "command-r-08-2024",
67
  },
68
  }
69
 
70
  # ── Task-specific provider priority ──
71
  _TASK_PRIORITY = {
72
+ "arabic": ["cerebras", "groq", "openrouter", "cohere", "mistral"],
73
+ "code": ["groq", "cerebras", "openrouter", "cohere", "mistral"],
74
+ "fast": ["cerebras", "groq", "openrouter", "cohere", "mistral"],
75
+ "default": ["groq", "cerebras", "openrouter", "cohere", "mistral"],
76
  }
77
 
78
  _CHAIN_CFG = {
 
81
  "openrouter": {"key_env": "OPENROUTER_API_KEY", "timeout": 45,
82
  "extra": {"HTTP-Referer": "https://github.com/Moealsarraj", "X-Title": "AI Tools"}},
83
  "mistral": {"key_env": "MISTRAL_API_KEY", "timeout": 40, "extra": {}},
 
 
84
  "cohere": {"key_env": "COHERE_API_KEY", "timeout": 45, "extra": {}},
85
  }
86