Thomas G. Lopes commited on
Commit
58eb9d1
·
1 Parent(s): f9fa0a5

padding & auto switch to valid snippet

Browse files
src/lib/components/inference-playground/code-snippets.svelte CHANGED
@@ -114,6 +114,18 @@
114
  http: getSnippet({ lang: "sh", tokenStr, conversation }),
115
  } as Record<Language, GetInferenceSnippetReturn>);
116
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  const selectedSnippet = $derived(snippetsByLang[lang][selectedSnippetIdxByLang[lang]]);
118
 
119
  const installInstructions = $derived.by(function getInstallInstructions(): InstallInstructions | undefined {
 
114
  http: getSnippet({ lang: "sh", tokenStr, conversation }),
115
  } as Record<Language, GetInferenceSnippetReturn>);
116
 
117
+ // Auto-switch to available language if current one has no snippets
118
+ $effect(() => {
119
+ const currentSnippets = snippetsByLang[lang];
120
+ if (currentSnippets.length) return;
121
+
122
+ // Find first language with available snippets
123
+ const availableLanguage = keys(labelsByLanguage).find(l => snippetsByLang[l] && snippetsByLang[l].length > 0);
124
+ if (availableLanguage) {
125
+ lang = availableLanguage;
126
+ }
127
+ });
128
+
129
  const selectedSnippet = $derived(snippetsByLang[lang][selectedSnippetIdxByLang[lang]]);
130
 
131
  const installInstructions = $derived.by(function getInstallInstructions(): InstallInstructions | undefined {
src/lib/components/inference-playground/message-textarea.svelte CHANGED
@@ -30,7 +30,7 @@
30
 
31
  <svelte:window onkeydown={onKeydown} />
32
 
33
- <div class="mt-auto px-2">
34
  <label
35
  class="flex w-full items-end rounded-[32px] bg-gray-200 p-2 pl-6 outline-gray-400 focus-within:outline-2 dark:bg-gray-800"
36
  >
 
30
 
31
  <svelte:window onkeydown={onKeydown} />
32
 
33
+ <div class="mt-auto px-2 pt-1">
34
  <label
35
  class="flex w-full items-end rounded-[32px] bg-gray-200 p-2 pl-6 outline-gray-400 focus-within:outline-2 dark:bg-gray-800"
36
  >
src/lib/data/context_length.json CHANGED
@@ -5,6 +5,7 @@
5
  "DeepSeek-R1-Distill-Llama-70B": 131072,
6
  "DeepSeek-V3-0324": 32768,
7
  "E5-Mistral-7B-Instruct": 4096,
 
8
  "Llama-4-Maverick-17B-128E-Instruct": 131072,
9
  "Meta-Llama-3.1-8B-Instruct": 16384,
10
  "Meta-Llama-3.3-70B-Instruct": 131072,
@@ -66,17 +67,19 @@
66
  "stability-ai/sdxl": 0
67
  },
68
  "novita": {
69
- "deepseek/deepseek-r1-0528": 163840,
70
  "deepseek/deepseek-v3-0324": 163840,
 
 
71
  "baidu/ernie-4.5-vl-424b-a47b": 123000,
72
  "baidu/ernie-4.5-300b-a47b-paddle": 123000,
73
  "qwen/qwen3-30b-a3b-fp8": 40960,
74
- "minimaxai/minimax-m1-80k": 128000,
75
  "deepseek/deepseek-r1-0528-qwen3-8b": 128000,
76
  "qwen/qwen3-32b-fp8": 40960,
77
  "qwen/qwen2.5-vl-72b-instruct": 32768,
78
  "qwen/qwen3-235b-a22b-fp8": 40960,
79
  "deepseek/deepseek-v3-turbo": 64000,
 
80
  "meta-llama/llama-4-maverick-17b-128e-instruct-fp8": 1048576,
81
  "google/gemma-3-27b-it": 32000,
82
  "deepseek/deepseek-r1-turbo": 64000,
@@ -111,7 +114,6 @@
111
  "qwen/qwen2.5-7b-instruct": 32000,
112
  "meta-llama/llama-3.2-1b-instruct": 131000,
113
  "meta-llama/llama-3.2-3b-instruct": 32768,
114
- "meta-llama/llama-3.1-8b-instruct-bf16": 8192,
115
  "sao10k/l31-70b-euryale-v2.2": 8192
116
  },
117
  "fal": {
@@ -158,113 +160,114 @@
158
  "c4ai-aya-vision-32b": 16384,
159
  "command-r": 132096,
160
  "command-r7b-12-2024": 132000,
 
161
  "command-r7b-arabic-02-2025": 128000,
162
  "command-light-nightly": 4096,
163
  "embed-english-v3.0": 512,
164
  "embed-multilingual-light-v3.0-image": 0,
165
  "embed-multilingual-v3.0-image": 0,
166
- "c4ai-aya-expanse-32b": 128000,
167
- "command": 4096
168
  },
169
  "together": {
170
- "meta-llama/Llama-Vision-Free": 131072,
171
- "togethercomputer/m2-bert-80M-32k-retrieval": 32768,
172
  "cartesia/sonic": 0,
173
- "meta-llama/Meta-Llama-3-8B-Instruct-Lite": 8192,
174
- "intfloat/multilingual-e5-large-instruct": 514,
175
  "Alibaba-NLP/gte-modernbert-base": 8192,
 
 
176
  "Qwen/Qwen3-235B-A22B-fp8-tput": 40960,
177
- "meta-llama/LlamaGuard-2-8b": 8192,
178
- "Qwen/Qwen2.5-Coder-32B-Instruct": 16384,
 
179
  "cartesia/sonic-2": 0,
180
  "togethercomputer/MoA-1": 32768,
181
- "meta-llama/Meta-Llama-3-70B-Instruct-Turbo": 8192,
182
- "eddie/Qwen3-32B": 32768,
183
- "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 131072,
184
- "Qwen/QwQ-32B": 131072,
185
- "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo": 131072,
186
  "meta-llama/Meta-Llama-Guard-3-8B": 8192,
187
- "arcee_ai/arcee-spotlight": 131072,
188
- "google/gemma-3-27b-it": 65536,
189
- "arcee-ai/AFM-4.5B-Preview": 65536,
190
- "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo": 130815,
 
 
 
191
  "deepseek-ai/DeepSeek-V3": 131072,
192
- "lgai/exaone-3-5-32b-instruct": 32768,
 
 
 
193
  "deepseek-ai/DeepSeek-R1-0528-tput": 163840,
194
- "mistralai/Mixtral-8x7B-Instruct-v0.1": 32768,
195
- "meta-llama/Llama-3-8b-chat-hf": 8192,
196
  "mistralai/Mistral-7B-Instruct-v0.1": 32768,
197
- "meta-llama/Llama-2-70b-hf": 4096,
198
- "togethercomputer/MoA-1-Turbo": 32768,
199
- "black-forest-labs/FLUX.1-kontext-max": 0,
 
 
 
 
 
 
 
 
 
 
 
 
200
  "perplexity-ai/r1-1776": 163840,
201
- "mistralai/Mistral-7B-Instruct-v0.2": 32768,
202
- "deepseek-ai/DeepSeek-V3-p-dp": 131072,
203
- "Qwen/Qwen2-72B-Instruct": 32768,
204
- "mistralai/Mistral-7B-Instruct-v0.3": 32768,
205
- "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO": 32768,
206
- "meta-llama/Llama-Guard-3-11B-Vision-Turbo": 131072,
207
- "Qwen/Qwen2-VL-72B-Instruct": 32768,
208
  "scb10x/scb10x-llama3-1-typhoon2-70b-instruct": 8192,
 
 
 
 
209
  "arcee-ai/maestro-reasoning": 131072,
 
 
 
 
 
 
 
 
 
 
210
  "meta-llama/Llama-3.2-3B-Instruct-Turbo": 131072,
211
  "arcee-ai/virtuoso-medium-v2": 131072,
 
 
212
  "arcee-ai/coder-large": 32768,
213
- "meta-llama/Llama-Guard-4-12B": 1048576,
214
- "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": 131072,
215
- "arcee-ai/virtuoso-large": 131072,
216
- "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": 131072,
217
- "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": 131072,
218
- "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": 32768,
219
- "deepseek-ai/DeepSeek-R1-Distill-Llama-70B-free": 8192,
220
  "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": 1048576,
221
- "togethercomputer/Refuel-Llm-V2-Small": 8192,
222
- "togethercomputer/Refuel-Llm-V2": 16384,
223
- "Qwen/Qwen2.5-VL-72B-Instruct": 32768,
224
  "scb10x/scb10x-typhoon-2-1-gemma3-12b": 131072,
225
- "arcee-ai/caller": 32768,
226
- "lgai/exaone-deep-32b": 32768,
227
- "black-forest-labs/FLUX.1-kontext-pro": 0,
228
- "google/gemma-3n-E4B-it": 32768,
229
  "meta-llama/Llama-4-Scout-17B-16E-Instruct": 1048576,
230
- "deepseek-ai/DeepSeek-R1": 163840,
231
- "Qwen/Qwen2.5-72B-Instruct-Turbo": 131072,
232
- "meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo": 131072,
233
- "arcee-ai/arcee-blitz": 32768,
234
- "meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo": 131072,
235
- "meta-llama/Llama-3-70b-chat-hf": 8192,
236
- "google/gemma-2-27b-it": 8192,
237
- "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free": 131072,
238
- "Qwen/Qwen2.5-7B-Instruct-Turbo": 32768,
239
- "mistralai/Mistral-Small-24B-Instruct-2501": 32768,
240
- "Salesforce/Llama-Rank-V1": 8192,
241
- "meta-llama/Llama-3.3-70B-Instruct-Turbo": 131072,
242
- "marin-community/marin-8b-instruct": 4096,
243
- "Qwen/Qwen3-32B-FP8": 0
244
  },
245
  "fireworks-ai": {
246
- "accounts/perplexity/models/r1-1776": 163840,
247
  "accounts/fireworks/models/deepseek-r1-0528": 163840,
248
- "accounts/fireworks/models/qwen3-30b-a3b": 40000,
249
- "accounts/fireworks/models/llama-guard-3-8b": 131072,
250
  "accounts/fireworks/models/llama4-scout-instruct-basic": 10485760,
251
  "accounts/fireworks/models/llama4-maverick-instruct-basic": 1048576,
252
  "accounts/fireworks/models/llama-v3p1-8b-instruct": 131072,
253
  "accounts/fireworks/models/firesearch-ocr-v6": 8192,
254
  "accounts/fireworks/models/llama-v3p1-405b-instruct": 131072,
255
- "accounts/fireworks/models/qwen2-vl-72b-instruct": 32768,
256
  "accounts/fireworks/models/mixtral-8x22b-instruct": 65536,
257
- "accounts/fireworks/models/qwen2p5-72b-instruct": 32768,
258
  "accounts/fireworks/models/deepseek-r1-basic": 163840,
259
  "accounts/fireworks/models/llama-v3p1-70b-instruct": 131072,
260
- "accounts/fireworks/models/qwen3-235b-a22b": 128000,
261
  "accounts/fireworks/models/llama-v3p3-70b-instruct": 131072,
262
  "accounts/fireworks/models/deepseek-r1": 163840,
263
  "accounts/sentientfoundation/models/dobby-unhinged-llama-3-3-70b-new": 131072,
264
  "accounts/sentientfoundation-serverless/models/dobby-mini-unhinged-plus-llama-3-1-8b": 131072,
265
  "accounts/fireworks/models/deepseek-v3": 131072,
266
  "accounts/fireworks/models/deepseek-v3-0324": 163840,
267
- "accounts/fireworks/models/qwq-32b": 131072,
268
  "accounts/fireworks/models/qwen2p5-vl-32b-instruct": 128000
269
  }
270
  }
 
5
  "DeepSeek-R1-Distill-Llama-70B": 131072,
6
  "DeepSeek-V3-0324": 32768,
7
  "E5-Mistral-7B-Instruct": 4096,
8
+ "Llama-3.3-Swallow-70B-Instruct-v0.4": 131072,
9
  "Llama-4-Maverick-17B-128E-Instruct": 131072,
10
  "Meta-Llama-3.1-8B-Instruct": 16384,
11
  "Meta-Llama-3.3-70B-Instruct": 131072,
 
67
  "stability-ai/sdxl": 0
68
  },
69
  "novita": {
 
70
  "deepseek/deepseek-v3-0324": 163840,
71
+ "moonshotai/kimi-k2-instruct": 131072,
72
+ "deepseek/deepseek-r1-0528": 163840,
73
  "baidu/ernie-4.5-vl-424b-a47b": 123000,
74
  "baidu/ernie-4.5-300b-a47b-paddle": 123000,
75
  "qwen/qwen3-30b-a3b-fp8": 40960,
76
+ "minimaxai/minimax-m1-80k": 1000000,
77
  "deepseek/deepseek-r1-0528-qwen3-8b": 128000,
78
  "qwen/qwen3-32b-fp8": 40960,
79
  "qwen/qwen2.5-vl-72b-instruct": 32768,
80
  "qwen/qwen3-235b-a22b-fp8": 40960,
81
  "deepseek/deepseek-v3-turbo": 64000,
82
+ "thudm/glm-4.1v-9b-thinking": 65536,
83
  "meta-llama/llama-4-maverick-17b-128e-instruct-fp8": 1048576,
84
  "google/gemma-3-27b-it": 32000,
85
  "deepseek/deepseek-r1-turbo": 64000,
 
114
  "qwen/qwen2.5-7b-instruct": 32000,
115
  "meta-llama/llama-3.2-1b-instruct": 131000,
116
  "meta-llama/llama-3.2-3b-instruct": 32768,
 
117
  "sao10k/l31-70b-euryale-v2.2": 8192
118
  },
119
  "fal": {
 
160
  "c4ai-aya-vision-32b": 16384,
161
  "command-r": 132096,
162
  "command-r7b-12-2024": 132000,
163
+ "command-a-vision": 128000,
164
  "command-r7b-arabic-02-2025": 128000,
165
  "command-light-nightly": 4096,
166
  "embed-english-v3.0": 512,
167
  "embed-multilingual-light-v3.0-image": 0,
168
  "embed-multilingual-v3.0-image": 0,
169
+ "c4ai-aya-expanse-32b": 128000
 
170
  },
171
  "together": {
 
 
172
  "cartesia/sonic": 0,
173
+ "black-forest-labs/FLUX.1-kontext-pro": 0,
 
174
  "Alibaba-NLP/gte-modernbert-base": 8192,
175
+ "Qwen/Qwen2.5-VL-72B-Instruct": 32768,
176
+ "google/gemma-3-27b-it": 65536,
177
  "Qwen/Qwen3-235B-A22B-fp8-tput": 40960,
178
+ "Salesforce/Llama-Rank-V1": 8192,
179
+ "mistralai/Mistral-7B-Instruct-v0.3": 32768,
180
+ "marin-community/marin-8b-instruct": 4096,
181
  "cartesia/sonic-2": 0,
182
  "togethercomputer/MoA-1": 32768,
 
 
 
 
 
183
  "meta-llama/Meta-Llama-Guard-3-8B": 8192,
184
+ "mistralai/Mistral-Small-24B-Instruct-2501": 32768,
185
+ "Qwen/Qwen2-VL-72B-Instruct": 32768,
186
+ "deepseek-ai/DeepSeek-R1-Distill-Llama-70B-free": 8192,
187
+ "togethercomputer/m2-bert-80M-32k-retrieval": 32768,
188
+ "deepseek-ai/DeepSeek-R1": 163840,
189
+ "mixedbread-ai/Mxbai-Rerank-Large-V2": 32768,
190
+ "meta-llama/Meta-Llama-3-8B-Instruct-Lite": 8192,
191
  "deepseek-ai/DeepSeek-V3": 131072,
192
+ "togethercomputer/Refuel-Llm-V2": 16384,
193
+ "moonshotai/Kimi-K2-Instruct": 131072,
194
+ "togethercomputer/MoA-1-Turbo": 32768,
195
+ "eddiehou/meta-llama/Llama-3.1-405B": 12000,
196
  "deepseek-ai/DeepSeek-R1-0528-tput": 163840,
197
+ "mistralai/Mistral-7B-Instruct-v0.2": 32768,
 
198
  "mistralai/Mistral-7B-Instruct-v0.1": 32768,
199
+ "serverless-qwen-qwen3-32b-fp8": 40960,
200
+ "moz-llama-3-3-70b-instruct-turbo": 131072,
201
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": 131072,
202
+ "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": 32768,
203
+ "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free": 131072,
204
+ "meta-llama/Llama-Vision-Free": 131072,
205
+ "meta-llama/Meta-Llama-3-70B-Instruct-Turbo": 8192,
206
+ "google/gemma-3n-E4B-it": 32768,
207
+ "arcee-ai/AFM-4.5B-Preview": 65536,
208
+ "meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo": 131072,
209
+ "meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo": 131072,
210
+ "lgai/exaone-3-5-32b-instruct": 32768,
211
+ "lgai/exaone-deep-32b": 32768,
212
+ "meta-llama/Llama-3-70b-chat-hf": 8192,
213
+ "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 131072,
214
  "perplexity-ai/r1-1776": 163840,
215
+ "mistralai/Mixtral-8x7B-Instruct-v0.1": 32768,
 
 
 
 
 
 
216
  "scb10x/scb10x-llama3-1-typhoon2-70b-instruct": 8192,
217
+ "meta-llama/Llama-Guard-3-11B-Vision-Turbo": 131072,
218
+ "google/gemma-2-27b-it": 8192,
219
+ "arcee-ai/arcee-blitz": 32768,
220
+ "Qwen/QwQ-32B": 131072,
221
  "arcee-ai/maestro-reasoning": 131072,
222
+ "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": 131072,
223
+ "Qwen/Qwen2-72B-Instruct": 32768,
224
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo": 130815,
225
+ "arcee-ai/virtuoso-large": 131072,
226
+ "arcee_ai/arcee-spotlight": 131072,
227
+ "arcee-ai/caller": 32768,
228
+ "meta-llama/Llama-3.3-70B-Instruct-Turbo": 131072,
229
+ "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo": 131072,
230
+ "togethercomputer/Refuel-Llm-V2-Small": 8192,
231
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": 131072,
232
  "meta-llama/Llama-3.2-3B-Instruct-Turbo": 131072,
233
  "arcee-ai/virtuoso-medium-v2": 131072,
234
+ "meta-llama/Llama-3-8b-chat-hf": 8192,
235
+ "Qwen/Qwen2.5-Coder-32B-Instruct": 16384,
236
  "arcee-ai/coder-large": 32768,
237
+ "meta-llama/Llama-2-70b-hf": 4096,
238
+ "Qwen/Qwen2.5-72B-Instruct-Turbo": 131072,
239
+ "Qwen/Qwen2.5-7B-Instruct-Turbo": 32768,
240
+ "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO": 32768,
 
 
 
241
  "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": 1048576,
 
 
 
242
  "scb10x/scb10x-typhoon-2-1-gemma3-12b": 131072,
243
+ "meta-llama/Llama-Guard-4-12B": 1048576,
244
+ "qwen-qwen3-32b-fp8-serverless": 40960,
245
+ "meta-llama/LlamaGuard-2-8b": 8192,
246
+ "intfloat/multilingual-e5-large-instruct": 514,
247
  "meta-llama/Llama-4-Scout-17B-16E-Instruct": 1048576,
248
+ "yan/deepseek-ai-deepseek-v3": 163839,
249
+ "black-forest-labs/FLUX.1-kontext-max": 0,
250
+ "moz/Llama-3.3-70B-Instruct-Turbo": 131072
 
 
 
 
 
 
 
 
 
 
 
251
  },
252
  "fireworks-ai": {
 
253
  "accounts/fireworks/models/deepseek-r1-0528": 163840,
254
+ "accounts/perplexity/models/r1-1776": 163840,
255
+ "accounts/fireworks/models/qwen3-30b-a3b": 131072,
256
  "accounts/fireworks/models/llama4-scout-instruct-basic": 10485760,
257
  "accounts/fireworks/models/llama4-maverick-instruct-basic": 1048576,
258
  "accounts/fireworks/models/llama-v3p1-8b-instruct": 131072,
259
  "accounts/fireworks/models/firesearch-ocr-v6": 8192,
260
  "accounts/fireworks/models/llama-v3p1-405b-instruct": 131072,
 
261
  "accounts/fireworks/models/mixtral-8x22b-instruct": 65536,
 
262
  "accounts/fireworks/models/deepseek-r1-basic": 163840,
263
  "accounts/fireworks/models/llama-v3p1-70b-instruct": 131072,
264
+ "accounts/fireworks/models/qwen3-235b-a22b": 131072,
265
  "accounts/fireworks/models/llama-v3p3-70b-instruct": 131072,
266
  "accounts/fireworks/models/deepseek-r1": 163840,
267
  "accounts/sentientfoundation/models/dobby-unhinged-llama-3-3-70b-new": 131072,
268
  "accounts/sentientfoundation-serverless/models/dobby-mini-unhinged-plus-llama-3-1-8b": 131072,
269
  "accounts/fireworks/models/deepseek-v3": 131072,
270
  "accounts/fireworks/models/deepseek-v3-0324": 163840,
 
271
  "accounts/fireworks/models/qwen2p5-vl-32b-instruct": 128000
272
  }
273
  }