-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
1811 lines (1669 loc) · 60.9 KB
/
config.py
File metadata and controls
1811 lines (1669 loc) · 60.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Central configuration for the Akademie KI Suite
/var/www/transkript_app/config.py:
"""
import os
import subprocess # nosec B404
# Globale Variable für den Storage-Status
STORAGE_AVAILABLE = False
def check_storage_health(path, timeout=3):
"""
Prüft die Erreichbarkeit des Pfads auf Systemebene.
Verhindert Python-Hänger bei 'Host is down' Fehlern.
"""
try:
# 'ls -d' ist minimalinvasiv und prüft nur den Ordner selbst.
# Use full path to avoid PATH-injection (S607).
ls_bin = "/bin/ls" if os.path.exists("/bin/ls") else "/usr/bin/ls"
subprocess.run( # nosec B603
[ls_bin, "-d", path],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
timeout=timeout,
check=True,
)
return True
except (subprocess.TimeoutExpired, subprocess.CalledProcessError, Exception):
return False
# ==========================================
# PATHS
# ==========================================
VPS_PATH = "/var/www/transkript_app"
if os.path.exists(VPS_PATH):
APP_DIR = VPS_PATH
else:
# Uses the directory where config.py actually lives
APP_DIR = os.path.dirname(os.path.abspath(__file__))
LOG_FILE = os.path.join(APP_DIR, "app.log")
STATIC_DIR = os.path.join(APP_DIR, "static")
IMAGES_DIR = os.path.join(APP_DIR, "generated_images")
STORAGE_MOUNT_POINT = (
"/mnt/akademie_storage"
if os.path.exists("/mnt/akademie_storage")
else os.path.join(APP_DIR, "storage")
)
os.makedirs(
STORAGE_MOUNT_POINT, exist_ok=True
) # ensure local fallback dir exists for gr.FileExplorer
JOB_STATE_DIR = os.path.join(APP_DIR, "jobs")
# Ensure directories exist locally
os.makedirs(JOB_STATE_DIR, exist_ok=True)
os.makedirs(IMAGES_DIR, exist_ok=True)
# ==========================================
# DATABASE
# ==========================================
DATABASE_URL = "sqlite:///akademie_suite.db"
# Sandbox VFS database — separate from main DB, persistent storage for Pyodide
# execution state, /home files, and micropip wheel cache.
# Stored alongside the main DB so it survives reboots and is easy to back up.
SANDBOX_DB_PATH = os.path.join(APP_DIR, "sandbox_vfs.db")
# ==========================================
# API KEYS
# ==========================================
API_KEYS = {
"GLADIA": os.environ.get("GLADIA_API_KEY", "your_key"),
"SCALEWAY": os.environ.get("SCALEWAY_API_KEY", "your_key"),
"NEBIUS": os.environ.get("NEBIUS_API_KEY", "your_key"),
"MISTRAL": os.environ.get("MISTRAL_API_KEY", "your_key"),
"OPENROUTER": os.environ.get("OPENROUTER_API_KEY", "your_key"),
"GROQ": os.environ.get("GROQ_API_KEY", "your_key"),
"POE": os.environ.get("POE_API_KEY", "your_poe_key_here"),
"DEEPGRAM": os.environ.get("DEEPGRAM_API_KEY", "your_key"),
"ASSEMBLYAI": os.environ.get("ASSEMBLYAI_API_KEY", "your_key"),
"OPENAI": os.environ.get("OPENAI_API_KEY", "your_key"),
"COHERE": os.environ.get("COHERE_API_KEY", "your_key"),
"TOGETHER": os.environ.get("TOGETHER_API_KEY", "your_key"),
"OVH": os.environ.get("OVH_API_KEY", "your_key"),
"CEREBRAS": os.environ.get("CEREBRAS_API_KEY", "your_key"),
"GOOGLEAI": os.environ.get("GOOGLEAI_API_KEY", "your_key"),
"ANTHROPIC": os.environ.get("ANTHROPIC_API_KEY", "your_key"),
"BFL": os.environ.get("BFL_API_KEY", ""),
"REQUESTY": os.environ.get("REQUESTY_API_KEY", ""),
"LANGDOCK": os.environ.get("LANGDOCK_API_KEY", ""),
# Tool executor / web search
"TAVILY": os.environ.get("TAVILY_API_KEY", ""), # free 1 000 req/month
"BRAVE_SEARCH": os.environ.get(
"BRAVE_SEARCH_API_KEY", ""
), # web, LLM context, images — ~1 000 free/month via $5 credit
"BRAVE_ANSWERS": os.environ.get(
"BRAVE_ANSWERS_API_KEY", ""
), # AI answers endpoint — separate subscription
"SEARXNG_URL": os.environ.get("SEARXNG_URL", ""), # self-hosted, e.g. http://localhost:8888
# CrispASR remote HTTP wrapper key — mirrors the constant below so
# that lookups like API_KEYS["CRISPASR_REMOTE_HTTP_KEY"] work
# consistently with every other transcription provider.
"CRISPASR_REMOTE_HTTP_KEY": os.environ.get("CRISPASR_REMOTE_HTTP_KEY", ""),
}
# ==========================================
# 🎙️ CRISPASR REMOTE TRANSCRIPTION SERVER
# ==========================================
# AIToolkit talks to CrispASR via two paths:
# 1. Local binary (always available — see crispasr_tool.py)
# 2. Remote HTTP server at CRISPASR_REMOTE_HTTP_URL — anything speaking the
# OpenAI-compatible REST surface (POST /v1/audio/transcriptions, POST
# /load, GET /health). Works against CrispASR's own C++ cpp-httplib
# server, a FastAPI wrapper, the Gradio HF space, etc.
CRISPASR_REMOTE_HTTP_URL = os.environ.get("CRISPASR_REMOTE_HTTP_URL", "")
CRISPASR_REMOTE_HTTP_KEY = os.environ.get("CRISPASR_REMOTE_HTTP_KEY", "")
# ==========================================
# SECURITY
# ==========================================
EU_ONLY_MODE = True
RESTRICTED_PROVIDERS = {
"OpenAI": "🇺🇸 US-Server",
"Anthropic": "🇺🇸 US-Server",
"OpenRouter": "🇺🇸 US-Server",
"Groq": "🇺🇸 US-Server",
"Poe": "🇺🇸 US-Server",
"Cohere": "🇺🇸 US-Server",
"Together": "🇺🇸 US-Server",
"Cerebras": "🇺🇸 US-Server",
"Requesty": "🔒 Admin-only Router", # testing still
"Langdock": "🔒 Admin-only Router", # testing still
# Note: Deepgram/AssemblyAI are NOT here because we use their EU endpoints (or they are whitelisted)
# Note: Requesty is NOT here — it uses the EU router endpoint and models are filtered per-model
}
# ==========================================
# 🇪🇺 REQUESTY EU FILTER
# ==========================================
# Requesty routes to many backend providers. We use the EU router endpoint
# (router.eu.requesty.ai) and then filter models by their ID prefix + region suffix.
#
# Model ID format in Requesty API: "provider/model-name@region"
# Examples: "nebius/deepseek-ai/DeepSeek-V3.2", "azure/gpt-5.1@swedencentral"
#
# EU-native: infrastructure always in EU (no region check needed)
REQUESTY_EU_NATIVE_PREFIXES = frozenset(
{
"nebius", # Amsterdam, Netherlands – EU company & infrastructure
"mistral", # Paris, France – EU company & infrastructure
}
)
# EU-regional: GDPR-compliant only when model ID contains an explicit EU region
REQUESTY_EU_REGIONAL_PREFIXES = frozenset(
{
"azure", # Microsoft Azure EU datacenters
"bedrock", # AWS Bedrock EU regions
"vertex", # Google Cloud Vertex AI EU regions
"google", # Google AI EU regions
"coding", # Requesty's own routing wrapper (has EU-region variants)
}
)
# Substrings (lowercase) that appear in the @region part of EU model IDs.
# Verified from live /models response at router.eu.requesty.ai/v1/models.
REQUESTY_EU_REGION_PATTERNS = (
# Azure EU regions
"francecentral", # France Central
"swedencentral", # Sweden Central
"uksouth", # UK South (GDPR-equivalent post-Brexit)
"germanywestcentral", # Germany West Central
"norwayeast", # Norway East
"switzerlandnorth", # Switzerland North
"westeurope", # West Europe (Netherlands)
# AWS Bedrock EU regions
"eu-central-", # eu-central-1 (Frankfurt)
"eu-west-", # eu-west-1/2/3 (Ireland, London, Paris)
"eu-north-", # eu-north-1 (Stockholm)
"eu-south-", # eu-south-1/2 (Milan, Spain)
# Google Cloud / Vertex EU regions
"europe-west", # europe-west1/4/8 etc.
"europe-central", # europe-central2 (Warsaw)
"europe-north", # europe-north1 (Finland)
"europe-south", # europe-south1 (Milan)
)
# Non-EU backend providers (always blocked for EU-only mode).
# Models from these providers route through non-EU infrastructure.
REQUESTY_NON_EU_PREFIXES = frozenset(
{
"openai", # US
"openai-responses", # US
"anthropic", # US
"novita", # US
"groq", # US
"deepinfra", # US
"together", # US
"parasail", # US
"perplexity", # US
"xai", # US
"moonshot", # China
"minimaxi", # China
"zai", # China
"alibaba", # China
"deepseek", # China
}
)
# ==========================================
# 📋 PROVIDER LISTS (Master Lists)
# ==========================================
# 1. TRANSCRIPTION
TRANSCRIPTION_PROVIDERS_ALL = [
"Gladia",
"Deepgram",
"AssemblyAI",
"Mistral",
"Scaleway",
"Groq",
"CrispASR",
"CrispASR-HTTP",
]
# 2. VISION
VISION_PROVIDERS_ALL = ["Scaleway", "Mistral", "Nebius", "OpenRouter", "Poe", "Groq"]
# 3. IMAGE GENERATION
IMAGE_PROVIDERS_ALL = ["BFL", "Mistral", "Nebius", "Scaleway", "OpenRouter", "Poe"]
OCR_ENGINES = [
"Standard (lokal)",
"GLM-OCR (lokal)",
"Mistral OCR",
"Vision LLM",
"Groq",
"OpenRouter",
]
# Mapping for Vision LLMs to use as OCR
# We reuse the VISION_PROVIDERS list but prompt them specifically for OCR
OCR_VISION_PROVIDERS = ["Nebius", "Scaleway", "OpenRouter", "Poe", "Mistral", "Groq"]
GROQ_OCR_MODELS = [
"meta-llama/llama-4-scout-17b-16e-instruct",
"meta-llama/llama-4-maverick-17b-128e-instruct",
]
# OpenRouter Models known to work well with their PDF parser
OPENROUTER_OCR_MODELS = [
"google/gemma-3-27b-it",
"anthropic/claude-3.5-sonnet",
"meta-llama/llama-3.3-70b-instruct",
"openai/gpt-4o",
]
# ==========================================
# 🛡️ DYNAMIC SAFE LISTS (Derived)
# ==========================================
# Automatically remove any provider appearing in RESTRICTED_PROVIDERS
TRANSCRIPTION_PROVIDERS_SAFE = [
p for p in TRANSCRIPTION_PROVIDERS_ALL if p not in RESTRICTED_PROVIDERS
]
VISION_PROVIDERS_SAFE = [p for p in VISION_PROVIDERS_ALL if p not in RESTRICTED_PROVIDERS]
IMAGE_PROVIDERS_SAFE = [p for p in IMAGE_PROVIDERS_ALL if p not in RESTRICTED_PROVIDERS]
# ==========================================
# PROVIDERS CONFIG
# ==========================================
PROVIDERS = {
"Scaleway": {
"base_url": "https://api.scaleway.ai/v1",
"key_name": "SCALEWAY",
"badge": "🇫🇷 <b>DSGVO-Konform</b>",
"chat_models": [
"gpt-oss-120b",
"mistral-small-3.2-24b-instruct-2506",
"gemma-3-27b-it",
"qwen3-235b-a22b-instruct-2507",
"llama-3.3-70b-instruct",
"deepseek-r1-distill-llama-70b",
],
"vision_models": ["pixtral-12b-2409", "mistral-small-3.1-24b-instruct-2503"],
"audio_models": ["whisper-large-v3"],
"image_models": ["pixtral-12b-2409"],
"context_limits": {
"gpt-oss-120b": 32768,
"mistral-small-3.2-24b-instruct-2506": 32768,
"gemma-3-27b-it": 96000,
"qwen3-235b-a22b-instruct-2507": 131072,
"llama-3.3-70b-instruct": 131072,
"deepseek-r1-distill-llama-70b": 8192,
"pixtral-12b-2409": 32768,
"mistral-small-3.1-24b-instruct-2503": 96000,
"whisper-large-v3": 16384,
},
},
"Gladia": {
"base_url": "https://api.gladia.io/v2",
"key_name": "GLADIA",
"badge": "🇫🇷 <b>DSGVO-Konform</b>",
"audio_models": ["gladia-v2"],
"context_limits": {"gladia-v2": 1000000},
},
"Nebius": {
"base_url": "https://api.tokenfactory.nebius.com/v1",
"key_name": "NEBIUS",
"badge": "🇪🇺 <b>DSGVO-Konform</b>",
"chat_models": [
"deepseek-ai/DeepSeek-R1-0528",
"nvidia/Llama-3_1-Nemotron-Ultra-253B-v1",
"openai/gpt-oss-120b",
"moonshotai/Kimi-K2-Instruct",
"moonshotai/Kimi-K2-Thinking",
"zai-org/GLM-4.5",
"meta-llama/Llama-3.3-70B-Instruct",
],
"image_models": [
"black-forest-labs/flux-schnell",
"black-forest-labs/flux-dev",
],
"vision_models": [
"google/gemma-3-27b-it",
"Qwen/Qwen2.5-VL-72B-Instruct",
"nvidia/Nemotron-Nano-V2-12b",
],
"context_limits": {
"deepseek-ai/DeepSeek-R1-0528": 163840,
"nvidia/Llama-3_1-Nemotron-Ultra-253B-v1": 131072,
"openai/gpt-oss-120b": 32768,
"moonshotai/Kimi-K2-Instruct": 128000,
"moonshotai/Kimi-K2-Thinking": 128000,
"zai-org/GLM-4.5": 128000,
"meta-llama/Llama-3.3-70B-Instruct": 131072,
"black-forest-labs/flux-schnell": 4096,
"black-forest-labs/flux-dev": 4096,
},
},
"Mistral": {
"base_url": "https://api.mistral.ai/v1",
"key_name": "MISTRAL",
"badge": "🇫🇷 <b>DSGVO-Konform</b>",
"chat_models": [
"mistral-large-latest",
"mistral-medium-2508",
"magistral-medium-2509",
"open-mistral-nemo-2407",
],
"vision_models": [
"pixtral-large-latest",
# "pixtral-large-2411",
"pixtral-12b-2409",
"mistral-ocr-latest",
"mistral-large-latest", # Mistral Large 3
"mistral-medium-latest", # Mistral Medium 3
"mistral-small-latest", # Mistral Small 3
"ministral-14b-2512",
"ministral-8b-2512",
],
"audio_models": [
"voxtral-mini-latest",
"voxtral-mini-transcribe-realtime-2602",
],
"image_models": ["mistral-medium-2505"],
"context_limits": {
"mistral-large-latest": 128000,
"mistral-medium-2508": 128000,
"magistral-medium-2509": 128000,
"open-mistral-nemo-2407": 128000,
"pixtral-large-2411": 128000,
"pixtral-12b-2409": 32768,
"mistral-ocr-latest": 32768,
"voxtral-mini-latest": 16384,
},
},
"BFL": {
"base_url": "https://api.bfl.ai/v1",
"key_name": "BFL",
"badge": "🇩🇪 <b>EU-Server & Firma</b>",
"image_models": [
"flux-pro-1.1",
"flux-pro-1.1-ultra",
"flux-2-max",
"flux-2-pro",
"flux-2-klein-4b",
"flux-2-klein-9b",
],
"context_limits": {
# Dummy limits for consistency
"flux-pro-1.1": 4096,
"flux-pro-1.1-ultra": 4096,
"flux-2-max": 4096,
"flux-2-pro": 4096,
"flux-2-klein-4b": 4096,
"flux-2-klein-9b": 4096,
},
},
"Deepgram": {
"base_url": "https://api.eu.deepgram.com/v1",
"key_name": "DEEPGRAM",
"badge": "🇪🇺 <b>EU-Server, US-Firma</b>",
"audio_models": ["nova-3-general", "nova-2-general", "nova-2"],
"context_limits": {
"nova-3-general": 16384,
"nova-2-general": 16384,
"nova-2": 16384,
},
},
"AssemblyAI": {
"base_url": "https://api.eu.assemblyai.com/v2",
"key_name": "ASSEMBLYAI",
"badge": "🇪🇺 <b>EU-Server, US-Firma</b>",
"audio_models": ["universal", "slam-1"],
"context_limits": {
"universal": 16384,
"slam-1": 16384,
},
},
"OpenRouter": {
"base_url": "https://openrouter.ai/api/v1",
"key_name": "OPENROUTER",
"badge": "🇺🇸 <b>US-Server</b>!",
"chat_models": [
# 1M+ Context
"google/gemini-2.0-pro-exp-02-05:free",
"google/gemini-2.0-flash-thinking-exp:free",
"google/gemini-2.0-flash-exp:free",
"google/gemini-2.5-pro-exp-03-25:free",
"google/gemini-flash-1.5-8b-exp",
# 100K+ Context
"deepseek/deepseek-r1-zero:free",
"deepseek/deepseek-r1:free",
"deepseek/deepseek-v3-base:free",
"deepseek/deepseek-chat-v3-0324:free",
"deepseek/deepseek-chat:free",
"google/gemma-3-4b-it:free",
"google/gemma-3-12b-it:free",
"qwen/qwen2.5-vl-72b-instruct:free",
"nvidia/llama-3.1-nemotron-70b-instruct:free",
"meta-llama/llama-3.2-1b-instruct:free",
"meta-llama/llama-3.2-11b-vision-instruct:free",
"meta-llama/llama-3.1-8b-instruct:free",
"mistralai/mistral-nemo:free",
# 64K-100K Context
"mistralai/mistral-small-3.1-24b-instruct:free",
"google/gemma-3-27b-it:free",
"qwen/qwen2.5-vl-3b-instruct:free",
"qwen/qwen-2.5-vl-7b-instruct:free",
# 32K-64K Context
"google/learnlm-1.5-pro-experimental:free",
"qwen/qwq-32b:free",
"google/gemini-2.0-flash-thinking-exp-1219:free",
"bytedance-research/ui-tars-72b:free",
"google/gemma-3-1b-it:free",
"mistralai/mistral-small-24b-instruct-2501:free",
"qwen/qwen-2.5-coder-32b-instruct:free",
"qwen/qwen-2.5-72b-instruct:free",
# 8K-32K Context
"meta-llama/llama-3.2-3b-instruct:free",
"qwen/qwq-32b-preview:free",
"deepseek/deepseek-r1-distill-qwen-32b:free",
"qwen/qwen2.5-vl-32b-instruct:free",
"deepseek/deepseek-r1-distill-llama-70b:free",
"qwen/qwen-2-7b-instruct:free",
"google/gemma-2-9b-it:free",
"mistralai/mistral-7b-instruct:free",
"microsoft/phi-3-mini-128k-instruct:free",
"meta-llama/llama-3-8b-instruct:free",
"meta-llama/llama-3.3-70b-instruct:free",
# 4K Context
"huggingfaceh4/zephyr-7b-beta:free",
],
"vision_models": [
"google/gemini-2.0-pro-exp-02-05:free",
"google/gemini-2.0-flash-thinking-exp:free",
"google/gemini-2.0-flash-exp:free",
"google/gemini-2.5-pro-exp-03-25:free",
"google/gemini-flash-1.5-8b-exp",
"qwen/qwen2.5-vl-72b-instruct:free",
"meta-llama/llama-3.2-11b-vision-instruct:free",
"mistralai/mistral-small-3.1-24b-instruct:free",
"google/gemma-3-27b-it:free",
"qwen/qwen2.5-vl-3b-instruct:free",
"qwen/qwen-2.5-vl-7b-instruct:free",
"bytedance-research/ui-tars-72b:free",
"qwen/qwen2.5-vl-32b-instruct:free",
],
"audio_models": [
"google/gemini-2.0-flash-lite-001",
"mistralai/voxtral-small-24b-2507",
"google/gemini-2.5-flash-lite",
],
"image_models": [
"google/gemini-2.5-flash-image",
"openai/gpt-5-image-mini",
"google/gemini-3-pro-image-preview",
"black-forest-labs/flux.2-pro",
"black-forest-labs/flux.2-flex",
],
"context_limits": {
# 1M+ Context
"google/gemini-2.0-pro-exp-02-05:free": 2000000,
"google/gemini-2.0-flash-thinking-exp:free": 1048576,
"google/gemini-2.0-flash-exp:free": 1048576,
"google/gemini-2.5-pro-exp-03-25:free": 1000000,
"google/gemini-flash-1.5-8b-exp": 1000000,
# 100K+ Context
"deepseek/deepseek-r1-zero:free": 163840,
"deepseek/deepseek-r1:free": 163840,
"deepseek/deepseek-v3-base:free": 131072,
"deepseek/deepseek-chat-v3-0324:free": 131072,
"deepseek/deepseek-chat:free": 131072,
"google/gemma-3-4b-it:free": 131072,
"google/gemma-3-12b-it:free": 131072,
"qwen/qwen2.5-vl-72b-instruct:free": 131072,
"nvidia/llama-3.1-nemotron-70b-instruct:free": 131072,
"meta-llama/llama-3.2-1b-instruct:free": 131072,
"meta-llama/llama-3.2-11b-vision-instruct:free": 131072,
"meta-llama/llama-3.1-8b-instruct:free": 131072,
"mistralai/mistral-nemo:free": 128000,
# 64K-100K Context
"mistralai/mistral-small-3.1-24b-instruct:free": 96000,
"google/gemma-3-27b-it:free": 96000,
"qwen/qwen2.5-vl-3b-instruct:free": 64000,
"qwen/qwen-2.5-vl-7b-instruct:free": 64000,
# 32K-64K Context
"google/learnlm-1.5-pro-experimental:free": 40960,
"qwen/qwq-32b:free": 40000,
"google/gemini-2.0-flash-thinking-exp-1219:free": 40000,
"bytedance-research/ui-tars-72b:free": 32768,
"google/gemma-3-1b-it:free": 32768,
"mistralai/mistral-small-24b-instruct-2501:free": 32768,
"qwen/qwen-2.5-coder-32b-instruct:free": 32768,
"qwen/qwen-2.5-72b-instruct:free": 32768,
# 8K-32K Context
"meta-llama/llama-3.2-3b-instruct:free": 20000,
"qwen/qwq-32b-preview:free": 16384,
"deepseek/deepseek-r1-distill-qwen-32b:free": 16000,
"qwen/qwen2.5-vl-32b-instruct:free": 8192,
"deepseek/deepseek-r1-distill-llama-70b:free": 8192,
"qwen/qwen-2-7b-instruct:free": 8192,
"google/gemma-2-9b-it:free": 8192,
"mistralai/mistral-7b-instruct:free": 8192,
"microsoft/phi-3-mini-128k-instruct:free": 8192,
"meta-llama/llama-3-8b-instruct:free": 8192,
"meta-llama/llama-3.3-70b-instruct:free": 8000,
# 4K Context
"huggingfaceh4/zephyr-7b-beta:free": 4096,
# Audio/Image
"google/gemini-2.0-flash-lite-001": 1000000,
"mistralai/voxtral-small-24b-2507": 32768,
"google/gemini-2.5-flash-lite": 1000000,
"google/gemini-2.5-flash-image": 1000000,
"openai/gpt-5-image-mini": 128000,
"google/gemini-3-pro-image-preview": 1000000,
"black-forest-labs/flux.2-pro": 4096,
"black-forest-labs/flux.2-flex": 4096,
},
},
"Groq": {
"base_url": "https://api.groq.com/openai/v1",
"key_name": "GROQ",
"badge": "🇺🇸 <b>US-Server</b>",
"chat_models": [
# Production models (no prefix)
"llama-3.3-70b-versatile",
"llama-3.1-8b-instant",
# Preview models (with prefixes)
"openai/gpt-oss-120b",
"openai/gpt-oss-20b",
"openai/gpt-oss-safeguard-20b",
"moonshotai/kimi-k2-instruct-0905",
"moonshotai/kimi-k2-instruct",
"meta-llama/llama-4-maverick-17b-128e-instruct",
"meta-llama/llama-4-scout-17b-16e-instruct",
"meta-llama/llama-guard-4-12b",
"meta-llama/llama-prompt-guard-2-22m",
"meta-llama/llama-prompt-guard-2-86m",
"qwen/qwen3-32b",
"allam-2-7b",
# Systems
"groq/compound",
"groq/compound-mini",
],
"vision_models": [
# Vision models - REQUIRE meta-llama/ prefix
"meta-llama/llama-4-scout-17b-16e-instruct",
"meta-llama/llama-4-maverick-17b-128e-instruct",
],
"audio_models": ["whisper-large-v3", "whisper-large-v3-turbo"],
"tts_models": [
"canopylabs/orpheus-v1-english",
"canopylabs/orpheus-arabic-saudi",
],
"context_limits": {
# Production
"llama-3.1-8b-instant": 131072,
"llama-3.3-70b-versatile": 131072,
# Preview LLMs
"openai/gpt-oss-120b": 131072,
"openai/gpt-oss-20b": 131072,
"openai/gpt-oss-safeguard-20b": 131072,
"moonshotai/kimi-k2-instruct-0905": 262144,
"moonshotai/kimi-k2-instruct": 131072,
"meta-llama/llama-4-maverick-17b-128e-instruct": 131072,
"meta-llama/llama-4-scout-17b-16e-instruct": 131072,
"meta-llama/llama-guard-4-12b": 131072,
"meta-llama/llama-prompt-guard-2-22m": 512,
"meta-llama/llama-prompt-guard-2-86m": 512,
"qwen/qwen3-32b": 131072,
"allam-2-7b": 4096,
# Systems
"groq/compound": 131072,
"groq/compound-mini": 131072,
# Audio
"whisper-large-v3": 448,
"whisper-large-v3-turbo": 448,
# TTS
"canopylabs/orpheus-v1-english": 4000,
"canopylabs/orpheus-arabic-saudi": 4000,
},
},
"Poe": {
"base_url": "https://api.poe.com/v1",
"key_name": "POE",
"badge": "🌐 <b>US-Server</b>!",
"chat_models": [
"gpt-5.1-instant",
"claude-sonnet-4.5",
"gemini-3-pro",
"gpt-5.1",
"gpt-4o",
"claude-3.5-sonnet",
"deepseek-r1",
"grok-4",
],
"vision_models": [
"claude-sonnet-4.5",
"gpt-5.1",
"gemini-3-pro",
"gpt-4o",
"claude-3.5-sonnet",
],
"image_models": [
"gpt-image-1",
"flux-pro-1.1-ultra",
"ideogram-v3",
"dall-e-3",
"playground-v3",
],
"audio_models": ["elevenlabs-v3", "sonic-3.0"],
"video_models": ["kling-2.5-turbo-pro", "runway-gen-4-turbo", "veo-3.1"],
"supports_system": True,
"supports_streaming": True,
"context_limits": {
"gpt-5.1-instant": 128000,
"claude-sonnet-4.5": 200000,
"gemini-3-pro": 2000000,
"gpt-5.1": 128000,
"gpt-4o": 128000,
"claude-3.5-sonnet": 200000,
"deepseek-r1": 163840,
"grok-4": 131072,
"gpt-image-1": 4096,
"flux-pro-1.1-ultra": 4096,
"ideogram-v3": 4096,
"dall-e-3": 4096,
"playground-v3": 4096,
"elevenlabs-v3": 4096,
"sonic-3.0": 4096,
"kling-2.5-turbo-pro": 4096,
"runway-gen-4-turbo": 4096,
"veo-3.1": 4096,
},
},
"OpenAI": {
"base_url": "https://api.openai.com/v1",
"key_name": "OPENAI",
"badge": "🇺🇸 <b>US-Server</b>!",
"chat_models": [
"gpt-3.5-turbo",
"gpt-3.5-turbo-0125",
"gpt-4",
"gpt-4-turbo",
"gpt-4o",
"gpt-4o-mini",
"o1-preview",
"o1-mini",
],
"vision_models": [
"gpt-4-turbo",
"gpt-4o",
"gpt-4o-mini",
"o1-preview",
"o1-mini",
],
"context_limits": {
"gpt-3.5-turbo": 16385,
"gpt-3.5-turbo-0125": 16385,
"gpt-3.5-turbo-instruct": 4096,
"gpt-4": 8192,
"gpt-4-turbo": 128000,
"gpt-4o": 128000,
"gpt-4o-mini": 128000,
"o1-preview": 128000,
"o1-mini": 128000,
},
},
"Cohere": {
"base_url": "https://api.cohere.ai/v1",
"key_name": "COHERE",
"badge": "🇺🇸 <b>US-Server</b>!",
"chat_models": [
"command-r-plus-08-2024",
"command-r-plus",
"command-r-08-2024",
"command-r",
"command",
"c4ai-aya-expanse-8b",
"c4ai-aya-expanse-32b",
],
"context_limits": {
"command-r-plus-08-2024": 131072,
"command-r-plus-04-2024": 131072,
"command-r-plus": 131072,
"command-r-08-2024": 131072,
"command-r-03-2024": 131072,
"command-r": 131072,
"command": 4096,
"command-nightly": 131072,
"command-light": 4096,
"command-light-nightly": 4096,
"c4ai-aya-expanse-8b": 8192,
"c4ai-aya-expanse-32b": 131072,
},
},
"Together": {
"base_url": "https://api.together.xyz/v1",
"key_name": "TOGETHER",
"badge": "🇺🇸 <b>US-Server</b>!",
"chat_models": [
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
"deepseek-ai/DeepSeek-R1-Distill-Llama-70B-free",
"meta-llama/Llama-3.3-70B-Instruct-Turbo-Free",
],
"vision_models": ["meta-llama/Llama-Vision-Free"],
"context_limits": {
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 131072,
"deepseek-ai/DeepSeek-R1-Distill-Llama-70B-free": 8192,
"meta-llama/Llama-Vision-Free": 8192,
"meta-llama/Llama-3.3-70B-Instruct-Turbo-Free": 8192,
},
},
"OVH": {
"base_url": "https://llama-3-1-70b-instruct.endpoints.kepler.ai.cloud.ovh.net/api/openai_compat/v1",
"key_name": "OVH",
"badge": "🇫🇷 <b>DSGVO-Konform</b>",
"chat_models": [
"ovh/codestral-mamba-7b-v0.1",
"ovh/deepseek-r1-distill-llama-70b",
"ovh/llama-3.1-70b-instruct",
"ovh/llama-3.1-8b-instruct",
"ovh/llama-3.3-70b-instruct",
"ovh/mistral-7b-instruct-v0.3",
"ovh/mistral-nemo-2407",
"ovh/mixtral-8x7b-instruct",
"ovh/qwen2.5-coder-32b-instruct",
],
"vision_models": ["ovh/llava-next-mistral-7b", "ovh/qwen2.5-vl-72b-instruct"],
"context_limits": {
"ovh/codestral-mamba-7b-v0.1": 131072,
"ovh/deepseek-r1-distill-llama-70b": 8192,
"ovh/llama-3.1-70b-instruct": 131072,
"ovh/llama-3.1-8b-instruct": 131072,
"ovh/llama-3.3-70b-instruct": 131072,
"ovh/llava-next-mistral-7b": 8192,
"ovh/mistral-7b-instruct-v0.3": 32768,
"ovh/mistral-nemo-2407": 131072,
"ovh/mixtral-8x7b-instruct": 32768,
"ovh/qwen2.5-coder-32b-instruct": 32768,
"ovh/qwen2.5-vl-72b-instruct": 131072,
},
},
"Cerebras": {
"base_url": "https://api.cerebras.ai/v1",
"key_name": "CEREBRAS",
"badge": "🇺🇸 <b>US-Server</b>!",
"chat_models": ["llama3.1-8b", "llama-3.3-70b"],
"context_limits": {
"llama3.1-8b": 8192,
"llama-3.3-70b": 8192,
},
},
"GoogleAI": {
"base_url": "https://generativelanguage.googleapis.com/v1beta",
"key_name": "GOOGLEAI",
"badge": "🇺🇸 <b>US-Server</b>?",
"chat_models": [
"gemini-1.0-pro",
"gemini-1.5-flash",
"gemini-1.5-pro",
"gemini-2.0-pro",
"gemini-2.5-pro",
],
"vision_models": [
"gemini-1.5-pro",
"gemini-1.0-pro",
"gemini-1.5-flash",
"gemini-2.0-pro",
"gemini-2.5-pro",
],
"context_limits": {
"gemini-1.0-pro": 32768,
"gemini-1.5-flash": 1000000,
"gemini-1.5-pro": 1000000,
"gemini-2.0-pro": 2000000,
"gemini-2.5-pro": 2000000,
},
},
"Anthropic": {
"base_url": "https://api.anthropic.com/v1",
"key_name": "ANTHROPIC",
"badge": "🇺🇸 <b>US-Server</b>!",
"chat_models": [
"claude-3-7-sonnet-20250219",
"claude-3-5-sonnet-20241022",
"claude-3-5-haiku-20240307",
"claude-3-opus-20240229",
],
"vision_models": [
"claude-3-7-sonnet-20250219",
"claude-3-5-sonnet-20241022",
"claude-3-5-haiku-20240307",
"claude-3-opus-20240229",
],
"context_limits": {
"claude-3-7-sonnet-20250219": 128000,
"claude-3-5-sonnet-20241022": 200000,
"claude-3-5-haiku-20240307": 200000,
"claude-3-5-sonnet-20240620": 200000,
"claude-3-opus-20240229": 200000,
"claude-3-haiku-20240307": 200000,
"claude-3-sonnet-20240229": 200000,
},
},
"HuggingFace": {
"base_url": "https://api-inference.huggingface.co/models",
"key_name": "HUGGINGFACE",
"badge": "🌐 <b>US-Server</b>?",
"chat_models": [
"microsoft/phi-3-mini-4k-instruct",
"microsoft/Phi-3-mini-128k-instruct",
"HuggingFaceH4/zephyr-7b-beta",
"deepseek-ai/DeepSeek-Coder-V2-Instruct",
"mistralai/Mistral-7B-Instruct-v0.3",
"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
"microsoft/Phi-3.5-mini-instruct",
"google/gemma-2-2b-it",
"Qwen/Qwen2.5-7B-Instruct",
"tiiuae/falcon-7b-instruct",
"Qwen/QwQ-32B-preview",
],
"vision_models": [
"Qwen/Qwen2.5-VL-7B-Instruct",
"Qwen/qwen2.5-vl-3b-instruct",
"Qwen/qwen2.5-vl-32b-instruct",
"Qwen/qwen2.5-vl-72b-instruct",
],
"context_limits": {
"microsoft/phi-3-mini-4k-instruct": 4096,
"microsoft/Phi-3-mini-128k-instruct": 131072,
"HuggingFaceH4/zephyr-7b-beta": 8192,
"deepseek-ai/DeepSeek-Coder-V2-Instruct": 8192,
"mistralai/Mistral-7B-Instruct-v0.3": 32768,
"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO": 32768,
"microsoft/Phi-3.5-mini-instruct": 4096,
"google/gemma-2-2b-it": 2048,
"openai-community/gpt2": 1024,
"microsoft/phi-2": 2048,
"TinyLlama/TinyLlama-1.1B-Chat-v1.0": 2048,
"Qwen/Qwen2.5-7B-Instruct": 131072,
"tiiuae/falcon-7b-instruct": 8192,
"Qwen/QwQ-32B-preview": 32768,
"Qwen/Qwen2.5-VL-7B-Instruct": 64000,
"Qwen/qwen2.5-vl-3b-instruct": 64000,
"Qwen/qwen2.5-vl-32b-instruct": 8192,
"Qwen/qwen2.5-vl-72b-instruct": 131072,
},
},
"Requesty": {
# EU router endpoint – always use this, never the US endpoint
"base_url": "https://router.eu.requesty.ai/v1",
"key_name": "REQUESTY",
"badge": "🇪🇺 <b>EU-Router (gefiltert)</b>",
# Curated EU-routed chat models (provider/model@region format).
# All of these route through EU infrastructure verified via the /models API.
"chat_models": [
# Nebius (Netherlands) – EU-native
"nebius/deepseek-ai/DeepSeek-V3.2",
"nebius/deepseek-ai/DeepSeek-R1-0528",
"nebius/moonshotai/kimi-k2.5",
"nebius/Qwen/Qwen3-Coder-480B-A35B-Instruct",
"nebius/meta-llama/Llama-3.3-70B-Instruct",
# Mistral (France) – EU-native
"mistral/mistral-large-latest",
"mistral/mistral-medium-latest",
"mistral/devstral-latest",
# AWS Bedrock – EU regions only
"bedrock/claude-sonnet-4-6@eu-west-1",
"bedrock/claude-sonnet-4-6@eu-central-1",
"bedrock/claude-opus-4-5@eu-west-1",
"bedrock/claude-opus-4-5@eu-central-1",
"bedrock/claude-haiku-4-5@eu-west-1",
# Google Vertex – EU regions only
"vertex/gemini-2.5-pro@europe-west4",
"vertex/gemini-2.5-pro@europe-west1",
"vertex/gemini-2.5-flash@europe-west4",
"vertex/gemini-2.5-flash@europe-west1",
# Azure – EU regions only
"azure/gpt-5.1@swedencentral",
"azure/gpt-5.1@francecentral",
"azure/gpt-4.1@swedencentral",
"azure/gpt-4.1@francecentral",
"azure/gpt-4.1-mini@swedencentral",
],
"context_limits": {
"nebius/deepseek-ai/DeepSeek-V3.2": 163840,
"nebius/deepseek-ai/DeepSeek-R1-0528": 163840,
"nebius/moonshotai/kimi-k2.5": 262144,
"nebius/Qwen/Qwen3-Coder-480B-A35B-Instruct": 262144,
"nebius/meta-llama/Llama-3.3-70B-Instruct": 131072,
"mistral/mistral-large-latest": 131072,
"mistral/mistral-medium-latest": 131072,
"mistral/devstral-latest": 262144,
"bedrock/claude-sonnet-4-6@eu-west-1": 1000000,
"bedrock/claude-sonnet-4-6@eu-central-1": 1000000,
"bedrock/claude-opus-4-5@eu-west-1": 200000,
"bedrock/claude-opus-4-5@eu-central-1": 200000,
"bedrock/claude-haiku-4-5@eu-west-1": 200000,
"vertex/gemini-2.5-pro@europe-west4": 1000000,
"vertex/gemini-2.5-pro@europe-west1": 1000000,
"vertex/gemini-2.5-flash@europe-west4": 1000000,
"vertex/gemini-2.5-flash@europe-west1": 1000000,
"azure/gpt-5.1@swedencentral": 200000,
"azure/gpt-5.1@francecentral": 200000,
"azure/gpt-4.1@swedencentral": 1000000,
"azure/gpt-4.1@francecentral": 1000000,
"azure/gpt-4.1-mini@swedencentral": 1000000,
},
},
"Langdock": {
# German company (Hamburg), GDPR-compliant, EU Azure infrastructure.
# OpenAI-compatible endpoint — drop-in for openai.OpenAI(base_url=...).
"base_url": "https://api.langdock.com/openai/eu/v1",
"key_name": "LANGDOCK",
"badge": "🇩🇪 <b>DSGVO-Konform (EU-Azure)</b>",
"chat_models": [
# Flagship / latest
"gpt-5",
"gpt-5.1",
"gpt-5.2",
"gpt-5-mini",
"gpt-5-nano",
# Stable GPT-4 series
"gpt-4o",
"gpt-4.1",
"gpt-4.1-mini",
"gpt-4.1-nano",
"gpt-4o-mini",
# Reasoning models
"o3",
"o4-mini",
"o1",
"o3-mini",
# Additional OpenAI models from live API
"gpt-5.2-pro",
"gpt-5.1-chat-latest",
"gpt-5-chat-latest",
# Anthropic models (via /anthropic/eu/v1/messages — native Anthropic format)
"claude-sonnet-4-6-default",
"claude-opus-4-6-default",
"claude-sonnet-4-5-20250929",
"claude-opus-4-5-20251101",
"claude-haiku-4-5-20251001",
"claude-sonnet-4-20250514",
"claude-3-7-sonnet-20250219",
"claude-3-5-sonnet-20240620",
# Google Gemini models (via /google/eu/v1beta — native Vertex format)
"gemini-2.5-pro",
"gemini-2.5-flash",
],
"context_limits": {
# OpenAI
"gpt-5": 400000,