Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -91,7 +91,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 91 |
"Llama-3.2-90B-Vision (Groq)": LLMConfig(
|
| 92 |
provider=APIProvider.GROQ,
|
| 93 |
model_name="llama-3.2-90b-vision-preview",
|
| 94 |
-
api_key_env="
|
| 95 |
base_url="https://api.groq.com/openai/v1/chat/completions",
|
| 96 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 97 |
request_payload_template={
|
|
@@ -108,7 +108,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 108 |
"Gemini-2.0-Flash": LLMConfig(
|
| 109 |
provider=APIProvider.GOOGLE,
|
| 110 |
model_name="gemini-2.0-flash",
|
| 111 |
-
api_key_env="
|
| 112 |
base_url="https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
|
| 113 |
headers_template={"x-goog-api-key": "{api_key}", "Content-Type": "application/json"},
|
| 114 |
request_payload_template={
|
|
@@ -122,7 +122,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 122 |
"Gemini-2.0-Pro": LLMConfig(
|
| 123 |
provider=APIProvider.GOOGLE,
|
| 124 |
model_name="gemini-2.0-pro",
|
| 125 |
-
api_key_env="
|
| 126 |
base_url="https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-pro:generateContent",
|
| 127 |
headers_template={"x-goog-api-key": "{api_key}", "Content-Type": "application/json"},
|
| 128 |
request_payload_template={
|
|
@@ -198,7 +198,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 198 |
"GPT-4-Turbo": LLMConfig(
|
| 199 |
provider=APIProvider.OPENAI,
|
| 200 |
model_name="gpt-4-turbo",
|
| 201 |
-
api_key_env="
|
| 202 |
base_url="https://api.openai.com/v1/chat/completions",
|
| 203 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 204 |
request_payload_template={
|
|
@@ -214,7 +214,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 214 |
"GPT-4o": LLMConfig(
|
| 215 |
provider=APIProvider.OPENAI,
|
| 216 |
model_name="gpt-4o",
|
| 217 |
-
api_key_env="
|
| 218 |
base_url="https://api.openai.com/v1/chat/completions",
|
| 219 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 220 |
request_payload_template={
|
|
@@ -230,7 +230,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 230 |
"GPT-4o-mini": LLMConfig(
|
| 231 |
provider=APIProvider.OPENAI,
|
| 232 |
model_name="gpt-4o-mini",
|
| 233 |
-
api_key_env="
|
| 234 |
base_url="https://api.openai.com/v1/chat/completions",
|
| 235 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 236 |
request_payload_template={
|
|
@@ -247,7 +247,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 247 |
"Perplexity-Sonar-Large": LLMConfig(
|
| 248 |
provider=APIProvider.PERPLEXITY,
|
| 249 |
model_name="llama-3.1-sonar-large-128k-online",
|
| 250 |
-
api_key_env="
|
| 251 |
base_url="https://api.perplexity.ai/chat/completions",
|
| 252 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 253 |
request_payload_template={
|
|
@@ -264,7 +264,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 264 |
"Mistral-7B": LLMConfig(
|
| 265 |
provider=APIProvider.OPENROUTER,
|
| 266 |
model_name="mistralai/mistral-7b-instruct:free",
|
| 267 |
-
api_key_env="
|
| 268 |
base_url="https://openrouter.ai/api/v1/chat/completions",
|
| 269 |
headers_template={
|
| 270 |
"Authorization": "Bearer {api_key}",
|
|
@@ -284,7 +284,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 284 |
"Qwen-2.5-72B": LLMConfig(
|
| 285 |
provider=APIProvider.OPENROUTER,
|
| 286 |
model_name="qwen/qwen-2.5-72b-instruct:free",
|
| 287 |
-
api_key_env="
|
| 288 |
base_url="https://openrouter.ai/api/v1/chat/completions",
|
| 289 |
headers_template={
|
| 290 |
"Authorization": "Bearer {api_key}",
|
|
@@ -304,7 +304,7 @@ LLM_CONFIGS: Dict[str, LLMConfig] = {
|
|
| 304 |
"DeepSeek-R1": LLMConfig(
|
| 305 |
provider=APIProvider.OPENROUTER,
|
| 306 |
model_name="deepseek/deepseek-r1:free",
|
| 307 |
-
api_key_env="
|
| 308 |
base_url="https://openrouter.ai/api/v1/chat/completions",
|
| 309 |
headers_template={
|
| 310 |
"Authorization": "Bearer {api_key}",
|
|
|
|
| 91 |
"Llama-3.2-90B-Vision (Groq)": LLMConfig(
|
| 92 |
provider=APIProvider.GROQ,
|
| 93 |
model_name="llama-3.2-90b-vision-preview",
|
| 94 |
+
api_key_env=os.getenv("groq"),
|
| 95 |
base_url="https://api.groq.com/openai/v1/chat/completions",
|
| 96 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 97 |
request_payload_template={
|
|
|
|
| 108 |
"Gemini-2.0-Flash": LLMConfig(
|
| 109 |
provider=APIProvider.GOOGLE,
|
| 110 |
model_name="gemini-2.0-flash",
|
| 111 |
+
api_key_env=os.getenv("gemini"),
|
| 112 |
base_url="https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
|
| 113 |
headers_template={"x-goog-api-key": "{api_key}", "Content-Type": "application/json"},
|
| 114 |
request_payload_template={
|
|
|
|
| 122 |
"Gemini-2.0-Pro": LLMConfig(
|
| 123 |
provider=APIProvider.GOOGLE,
|
| 124 |
model_name="gemini-2.0-pro",
|
| 125 |
+
api_key_env=os.getenv("gemini"),
|
| 126 |
base_url="https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-pro:generateContent",
|
| 127 |
headers_template={"x-goog-api-key": "{api_key}", "Content-Type": "application/json"},
|
| 128 |
request_payload_template={
|
|
|
|
| 198 |
"GPT-4-Turbo": LLMConfig(
|
| 199 |
provider=APIProvider.OPENAI,
|
| 200 |
model_name="gpt-4-turbo",
|
| 201 |
+
api_key_env=os.getenv("openai"),
|
| 202 |
base_url="https://api.openai.com/v1/chat/completions",
|
| 203 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 204 |
request_payload_template={
|
|
|
|
| 214 |
"GPT-4o": LLMConfig(
|
| 215 |
provider=APIProvider.OPENAI,
|
| 216 |
model_name="gpt-4o",
|
| 217 |
+
api_key_env=os.getenv("openai"),
|
| 218 |
base_url="https://api.openai.com/v1/chat/completions",
|
| 219 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 220 |
request_payload_template={
|
|
|
|
| 230 |
"GPT-4o-mini": LLMConfig(
|
| 231 |
provider=APIProvider.OPENAI,
|
| 232 |
model_name="gpt-4o-mini",
|
| 233 |
+
api_key_env=os.getenv("openai"),
|
| 234 |
base_url="https://api.openai.com/v1/chat/completions",
|
| 235 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 236 |
request_payload_template={
|
|
|
|
| 247 |
"Perplexity-Sonar-Large": LLMConfig(
|
| 248 |
provider=APIProvider.PERPLEXITY,
|
| 249 |
model_name="llama-3.1-sonar-large-128k-online",
|
| 250 |
+
api_key_env=os.getenv("perplexity"),
|
| 251 |
base_url="https://api.perplexity.ai/chat/completions",
|
| 252 |
headers_template={"Authorization": "Bearer {api_key}", "Content-Type": "application/json"},
|
| 253 |
request_payload_template={
|
|
|
|
| 264 |
"Mistral-7B": LLMConfig(
|
| 265 |
provider=APIProvider.OPENROUTER,
|
| 266 |
model_name="mistralai/mistral-7b-instruct:free",
|
| 267 |
+
api_key_env=os.getenv("openrouter"),
|
| 268 |
base_url="https://openrouter.ai/api/v1/chat/completions",
|
| 269 |
headers_template={
|
| 270 |
"Authorization": "Bearer {api_key}",
|
|
|
|
| 284 |
"Qwen-2.5-72B": LLMConfig(
|
| 285 |
provider=APIProvider.OPENROUTER,
|
| 286 |
model_name="qwen/qwen-2.5-72b-instruct:free",
|
| 287 |
+
api_key_env=os.getenv("openrouter"),
|
| 288 |
base_url="https://openrouter.ai/api/v1/chat/completions",
|
| 289 |
headers_template={
|
| 290 |
"Authorization": "Bearer {api_key}",
|
|
|
|
| 304 |
"DeepSeek-R1": LLMConfig(
|
| 305 |
provider=APIProvider.OPENROUTER,
|
| 306 |
model_name="deepseek/deepseek-r1:free",
|
| 307 |
+
api_key_env=os.getenv("openrouter"),
|
| 308 |
base_url="https://openrouter.ai/api/v1/chat/completions",
|
| 309 |
headers_template={
|
| 310 |
"Authorization": "Bearer {api_key}",
|