lollms-client 0.32.0__py3-none-any.whl → 0.33.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of lollms-client might be problematic. Click here for more details.

@@ -154,8 +154,409 @@ class LollmsLLMBinding(ABC):
154
154
  """
155
155
  pass
156
156
 
157
- def get_ctx_size(self, model_name:str|None=None):
158
- # if model_name is none use current model name
157
+ def get_ctx_size(self, model_name: Optional[str] = None) -> Optional[int]:
158
+ """
159
+ Retrieves context size for a model from a hardcoded list.
160
+
161
+ This method checks if the model name contains a known base model identifier
162
+ (e.g., 'llama3.1', 'gemma2') to determine its context length. It's intended
163
+ as a failsafe when the context size cannot be retrieved directly from the
164
+ Ollama API.
165
+ """
166
+ if model_name is None:
167
+ model_name = self.model_name
168
+
169
+ # Hardcoded context sizes for popular models. More specific names (e.g., 'llama3.1')
170
+ # should appear, as they will be checked first due to the sorting logic below.
171
+ known_contexts = {
172
+ 'agentica-org/deepcoder-14b-preview': 8192,
173
+ 'agentica-org/deepcoder-14b-preview:free': 8192,
174
+ 'ai21/jamba-large-1.7': 256000,
175
+ 'ai21/jamba-mini-1.7': 256000,
176
+ 'aion-labs/aion-1.0': 8192,
177
+ 'aion-labs/aion-1.0-mini': 8192,
178
+ 'aion-labs/aion-rp-llama-3.1-8b': 131072,
179
+ 'alfredpros/codellama-7b-instruct-solidity': 16384,
180
+ 'alpindale/goliath-120b': 4096,
181
+ 'amazon/nova-lite-v1': 32768,
182
+ 'amazon/nova-micro-v1': 32768,
183
+ 'amazon/nova-pro-v1': 32768,
184
+ 'anthracite-org/magnum-v2-72b': 131072,
185
+ 'anthracite-org/magnum-v4-72b': 131072,
186
+ 'anthropic/claude-3-haiku': 200000,
187
+ 'anthropic/claude-3-haiku:beta': 200000,
188
+ 'anthropic/claude-3-opus': 200000,
189
+ 'anthropic/claude-3-opus:beta': 200000,
190
+ 'anthropic/claude-3.5-haiku': 200000,
191
+ 'anthropic/claude-3.5-haiku-20241022': 200000,
192
+ 'anthropic/claude-3.5-haiku:beta': 200000,
193
+ 'anthropic/claude-3.5-sonnet': 200000,
194
+ 'anthropic/claude-3.5-sonnet-20240620': 200000,
195
+ 'anthropic/claude-3.5-sonnet-20240620:beta': 200000,
196
+ 'anthropic/claude-3.5-sonnet:beta': 200000,
197
+ 'anthropic/claude-3.7-sonnet': 200000,
198
+ 'anthropic/claude-3.7-sonnet:beta': 200000,
199
+ 'anthropic/claude-3.7-sonnet:thinking': 200000,
200
+ 'anthropic/claude-opus-4': 200000,
201
+ 'anthropic/claude-opus-4.1': 200000,
202
+ 'anthropic/claude-sonnet-4': 200000,
203
+ 'arcee-ai/coder-large': 32768,
204
+ 'arcee-ai/maestro-reasoning': 32768,
205
+ 'arcee-ai/spotlight': 32768,
206
+ 'arcee-ai/virtuoso-large': 32768,
207
+ 'arliai/qwq-32b-arliai-rpr-v1': 8192,
208
+ 'arliai/qwq-32b-arliai-rpr-v1:free': 8192,
209
+ 'baidu/ernie-4.5-300b-a47b': 128000,
210
+ 'bytedance/ui-tars-1.5-7b': 8192,
211
+ 'cognitivecomputations/dolphin-mistral-24b-venice-edition:free': 32768,
212
+ 'cognitivecomputations/dolphin-mixtral-8x22b': 65536,
213
+ 'cognitivecomputations/dolphin3.0-mistral-24b': 32768,
214
+ 'cognitivecomputations/dolphin3.0-mistral-24b:free': 32768,
215
+ 'cognitivecomputations/dolphin3.0-r1-mistral-24b': 32768,
216
+ 'cognitivecomputations/dolphin3.0-r1-mistral-24b:free': 32768,
217
+ 'cohere/command': 8192,
218
+ 'cohere/command-a': 8192,
219
+ 'cohere/command-r': 128000,
220
+ 'cohere/command-r-03-2024': 128000,
221
+ 'cohere/command-r-08-2024': 128000,
222
+ 'cohere/command-r-plus': 128000,
223
+ 'cohere/command-r-plus-04-2024': 128000,
224
+ 'cohere/command-r-plus-08-2024': 128000,
225
+ 'cohere/command-r7b-12-2024': 128000,
226
+ 'deepseek/deepseek-chat': 32768,
227
+ 'deepseek/deepseek-chat-v3-0324': 32768,
228
+ 'deepseek/deepseek-chat-v3-0324:free': 32768,
229
+ 'deepseek/deepseek-prover-v2': 131072,
230
+ 'deepseek/deepseek-r1': 32768,
231
+ 'deepseek/deepseek-r1-0528': 32768,
232
+ 'deepseek/deepseek-r1-0528-qwen3-8b': 32768,
233
+ 'deepseek/deepseek-r1-0528-qwen3-8b:free': 32768,
234
+ 'deepseek/deepseek-r1-0528:free': 32768,
235
+ 'deepseek/deepseek-r1-distill-llama-70b': 131072,
236
+ 'deepseek/deepseek-r1-distill-llama-70b:free': 131072,
237
+ 'deepseek/deepseek-r1-distill-llama-8b': 131072,
238
+ 'deepseek/deepseek-r1-distill-qwen-1.5b': 32768,
239
+ 'deepseek/deepseek-r1-distill-qwen-14b': 32768,
240
+ 'deepseek/deepseek-r1-distill-qwen-14b:free': 32768,
241
+ 'deepseek/deepseek-r1-distill-qwen-32b': 32768,
242
+ 'deepseek/deepseek-r1-distill-qwen-7b': 32768,
243
+ 'deepseek/deepseek-r1:free': 32768,
244
+ 'deepseek/deepseek-v3-base': 32768,
245
+ 'eleutherai/llemma_7b': 8192,
246
+ 'featherless/qwerky-72b:free': 8192,
247
+ 'google/gemini-2.0-flash-001': 1000000,
248
+ 'google/gemini-2.0-flash-exp:free': 1000000,
249
+ 'google/gemini-2.0-flash-lite-001': 1000000,
250
+ 'google/gemini-2.5-flash': 1000000,
251
+ 'google/gemini-2.5-flash-lite': 1000000,
252
+ 'google/gemini-2.5-flash-lite-preview-06-17': 1000000,
253
+ 'google/gemini-2.5-pro': 2000000,
254
+ 'google/gemini-2.5-pro-exp-03-25': 2000000,
255
+ 'google/gemini-2.5-pro-preview': 2000000,
256
+ 'google/gemini-2.5-pro-preview-05-06': 2000000,
257
+ 'google/gemini-flash-1.5': 1000000,
258
+ 'google/gemini-flash-1.5-8b': 1000000,
259
+ 'google/gemini-pro-1.5': 2000000,
260
+ 'google/gemma-2-27b-it': 8192,
261
+ 'google/gemma-2-9b-it': 8192,
262
+ 'google/gemma-2-9b-it:free': 8192,
263
+ 'google/gemma-3-12b-it': 131072,
264
+ 'google/gemma-3-12b-it:free': 131072,
265
+ 'google/gemma-3-27b-it': 131072,
266
+ 'google/gemma-3-27b-it:free': 131072,
267
+ 'google/gemma-3-4b-it': 131072,
268
+ 'google/gemma-3-4b-it:free': 131072,
269
+ 'google/gemma-3n-e2b-it:free': 131072,
270
+ 'google/gemma-3n-e4b-it': 131072,
271
+ 'google/gemma-3n-e4b-it:free': 131072,
272
+ 'gryphe/mythomax-l2-13b': 4096,
273
+ 'inception/mercury': 32768,
274
+ 'inception/mercury-coder': 32768,
275
+ 'infermatic/mn-inferor-12b': 8192,
276
+ 'inflection/inflection-3-pi': 128000,
277
+ 'inflection/inflection-3-productivity': 128000,
278
+ 'liquid/lfm-3b': 8192,
279
+ 'liquid/lfm-40b': 8192,
280
+ 'liquid/lfm-7b': 8192,
281
+ 'mancer/weaver': 8192,
282
+ 'meta-llama/llama-3-70b-instruct': 8192,
283
+ 'meta-llama/llama-3-8b-instruct': 8192,
284
+ 'meta-llama/llama-3.1-405b': 131072,
285
+ 'meta-llama/llama-3.1-405b-instruct': 131072,
286
+ 'meta-llama/llama-3.1-405b-instruct:free': 131072,
287
+ 'meta-llama/llama-3.1-70b-instruct': 131072,
288
+ 'meta-llama/llama-3.1-8b-instruct': 131072,
289
+ 'meta-llama/llama-3.2-11b-vision-instruct': 131072,
290
+ 'meta-llama/llama-3.2-11b-vision-instruct:free': 131072,
291
+ 'meta-llama/llama-3.2-1b-instruct': 131072,
292
+ 'meta-llama/llama-3.2-3b-instruct': 131072,
293
+ 'meta-llama/llama-3.2-3b-instruct:free': 131072,
294
+ 'meta-llama/llama-3.2-90b-vision-instruct': 131072,
295
+ 'meta-llama/llama-3.3-70b-instruct': 131072,
296
+ 'meta-llama/llama-3.3-70b-instruct:free': 131072,
297
+ 'meta-llama/llama-4-maverick': 131072,
298
+ 'meta-llama/llama-4-scout': 131072,
299
+ 'meta-llama/llama-guard-2-8b': 8192,
300
+ 'meta-llama/llama-guard-3-8b': 131072,
301
+ 'meta-llama/llama-guard-4-12b': 131072,
302
+ 'microsoft/mai-ds-r1': 32768,
303
+ 'microsoft/mai-ds-r1:free': 32768,
304
+ 'microsoft/phi-3-medium-128k-instruct': 131072,
305
+ 'microsoft/phi-3-mini-128k-instruct': 131072,
306
+ 'microsoft/phi-3.5-mini-128k-instruct': 131072,
307
+ 'microsoft/phi-4': 131072,
308
+ 'microsoft/phi-4-multimodal-instruct': 131072,
309
+ 'microsoft/phi-4-reasoning-plus': 131072,
310
+ 'microsoft/wizardlm-2-8x22b': 65536,
311
+ 'minimax/minimax-01': 200000,
312
+ 'minimax/minimax-m1': 200000,
313
+ 'mistralai/codestral-2501': 32768,
314
+ 'mistralai/codestral-2508': 32768,
315
+ 'mistralai/devstral-medium': 32768,
316
+ 'mistralai/devstral-small': 32768,
317
+ 'mistralai/devstral-small-2505': 32768,
318
+ 'mistralai/devstral-small-2505:free': 32768,
319
+ 'mistralai/magistral-medium-2506': 32768,
320
+ 'mistralai/magistral-medium-2506:thinking': 32768,
321
+ 'mistralai/magistral-small-2506': 32768,
322
+ 'mistralai/ministral-3b': 32768,
323
+ 'mistralai/ministral-8b': 32768,
324
+ 'mistralai/mistral-7b-instruct': 32768,
325
+ 'mistralai/mistral-7b-instruct-v0.1': 8192,
326
+ 'mistralai/mistral-7b-instruct-v0.2': 32768,
327
+ 'mistralai/mistral-7b-instruct-v0.3': 32768,
328
+ 'mistralai/mistral-7b-instruct:free': 32768,
329
+ 'mistralai/mistral-large': 32768,
330
+ 'mistralai/mistral-large-2407': 128000,
331
+ 'mistralai/mistral-large-2411': 128000,
332
+ 'mistralai/mistral-medium-3': 32768,
333
+ 'mistralai/mistral-nemo': 128000,
334
+ 'mistralai/mistral-nemo:free': 128000,
335
+ 'mistralai/mistral-saba': 32768,
336
+ 'mistralai/mistral-small': 32768,
337
+ 'mistralai/mistral-small-24b-instruct-2501': 32768,
338
+ 'mistralai/mistral-small-24b-instruct-2501:free': 32768,
339
+ 'mistralai/mistral-small-3.1-24b-instruct': 32768,
340
+ 'mistralai/mistral-small-3.1-24b-instruct:free': 32768,
341
+ 'mistralai/mistral-small-3.2-24b-instruct': 32768,
342
+ 'mistralai/mistral-small-3.2-24b-instruct:free': 32768,
343
+ 'mistralai/mistral-tiny': 32768,
344
+ 'mistralai/mixtral-8x22b-instruct': 65536,
345
+ 'mistralai/mixtral-8x7b-instruct': 32768,
346
+ 'mistralai/pixtral-12b': 128000,
347
+ 'mistralai/pixtral-large-2411': 128000,
348
+ 'moonshotai/kimi-dev-72b:free': 200000,
349
+ 'moonshotai/kimi-k2': 200000,
350
+ 'moonshotai/kimi-k2:free': 200000,
351
+ 'moonshotai/kimi-vl-a3b-thinking': 200000,
352
+ 'moonshotai/kimi-vl-a3b-thinking:free': 200000,
353
+ 'morph/morph-v3-fast': 8192,
354
+ 'morph/morph-v3-large': 8192,
355
+ 'neversleep/llama-3-lumimaid-70b': 8192,
356
+ 'neversleep/llama-3.1-lumimaid-8b': 131072,
357
+ 'neversleep/noromaid-20b': 32768,
358
+ 'nousresearch/deephermes-3-llama-3-8b-preview:free': 8192,
359
+ 'nousresearch/deephermes-3-mistral-24b-preview': 32768,
360
+ 'nousresearch/hermes-2-pro-llama-3-8b': 8192,
361
+ 'nousresearch/hermes-3-llama-3.1-405b': 131072,
362
+ 'nousresearch/hermes-3-llama-3.1-70b': 131072,
363
+ 'nousresearch/nous-hermes-2-mixtral-8x7b-dpo': 32768,
364
+ 'nvidia/llama-3.1-nemotron-70b-instruct': 131072,
365
+ 'nvidia/llama-3.1-nemotron-ultra-253b-v1': 131072,
366
+ 'nvidia/llama-3.1-nemotron-ultra-253b-v1:free': 131072,
367
+ 'nvidia/llama-3.3-nemotron-super-49b-v1': 131072,
368
+ 'openai/chatgpt-4o-latest': 128000,
369
+ 'openai/codex-mini': 2048,
370
+ 'openai/gpt-3.5-turbo': 4096,
371
+ 'openai/gpt-3.5-turbo-0613': 4096,
372
+ 'openai/gpt-3.5-turbo-16k': 16384,
373
+ 'openai/gpt-3.5-turbo-instruct': 4096,
374
+ 'openai/gpt-4': 8192,
375
+ 'openai/gpt-4-0314': 8192,
376
+ 'openai/gpt-4-1106-preview': 128000,
377
+ 'openai/gpt-4-turbo': 128000,
378
+ 'openai/gpt-4-turbo-preview': 128000,
379
+ 'openai/gpt-4.1': 128000,
380
+ 'openai/gpt-4.1-mini': 128000,
381
+ 'openai/gpt-4.1-nano': 128000,
382
+ 'openai/gpt-4o': 128000,
383
+ 'openai/gpt-4o-2024-05-13': 128000,
384
+ 'openai/gpt-4o-2024-08-06': 128000,
385
+ 'openai/gpt-4o-2024-11-20': 128000,
386
+ 'openai/gpt-4o-mini': 128000,
387
+ 'openai/gpt-4o-mini-2024-07-18': 128000,
388
+ 'openai/gpt-4o-mini-search-preview': 128000,
389
+ 'openai/gpt-4o-search-preview': 128000,
390
+ 'openai/gpt-4o:extended': 128000,
391
+ 'openai/gpt-5': 200000,
392
+ 'openai/gpt-5-chat': 200000,
393
+ 'openai/gpt-5-mini': 200000,
394
+ 'openai/gpt-5-nano': 200000,
395
+ 'openai/gpt-oss-120b': 128000,
396
+ 'openai/gpt-oss-20b': 128000,
397
+ 'openai/gpt-oss-20b:free': 128000,
398
+ 'openai/o1': 128000,
399
+ 'openai/o1-mini': 128000,
400
+ 'openai/o1-mini-2024-09-12': 128000,
401
+ 'openai/o1-pro': 128000,
402
+ 'openai/o3': 200000,
403
+ 'openai/o3-mini': 200000,
404
+ 'openai/o3-mini-high': 200000,
405
+ 'openai/o3-pro': 200000,
406
+ 'openai/o4-mini': 128000,
407
+ 'openai/o4-mini-high': 128000,
408
+ 'opengvlab/internvl3-14b': 8192,
409
+ 'openrouter/auto': 8192,
410
+ 'perplexity/r1-1776': 32768,
411
+ 'perplexity/sonar': 32768,
412
+ 'perplexity/sonar-deep-research': 32768,
413
+ 'perplexity/sonar-pro': 32768,
414
+ 'perplexity/sonar-reasoning': 32768,
415
+ 'perplexity/sonar-reasoning-pro': 32768,
416
+ 'pygmalionai/mythalion-13b': 4096,
417
+ 'qwen/qwen-2-72b-instruct': 32768,
418
+ 'qwen/qwen-2.5-72b-instruct': 131072,
419
+ 'qwen/qwen-2.5-72b-instruct:free': 131072,
420
+ 'qwen/qwen-2.5-7b-instruct': 131072,
421
+ 'qwen/qwen-2.5-coder-32b-instruct': 131072,
422
+ 'qwen/qwen-2.5-coder-32b-instruct:free': 131072,
423
+ 'qwen/qwen-2.5-vl-7b-instruct': 131072,
424
+ 'qwen/qwen-max': 32768,
425
+ 'qwen/qwen-plus': 32768,
426
+ 'qwen/qwen-turbo': 8192,
427
+ 'qwen/qwen-vl-max': 32768,
428
+ 'qwen/qwen-vl-plus': 32768,
429
+ 'qwen/qwen2.5-vl-32b-instruct': 131072,
430
+ 'qwen/qwen2.5-vl-32b-instruct:free': 131072,
431
+ 'qwen/qwen2.5-vl-72b-instruct': 131072,
432
+ 'qwen/qwen2.5-vl-72b-instruct:free': 131072,
433
+ 'qwen/qwen3-14b': 32768,
434
+ 'qwen/qwen3-14b:free': 32768,
435
+ 'qwen/qwen3-235b-a22b': 32768,
436
+ 'qwen/qwen3-235b-a22b-2507': 32768,
437
+ 'qwen/qwen3-235b-a22b-thinking-2507': 32768,
438
+ 'qwen/qwen3-235b-a22b:free': 32768,
439
+ 'qwen/qwen3-30b-a3b': 32768,
440
+ 'qwen/qwen3-30b-a3b-instruct-2507': 32768,
441
+ 'qwen/qwen3-30b-a3b:free': 32768,
442
+ 'qwen/qwen3-32b': 32768,
443
+ 'qwen/qwen3-4b:free': 32768,
444
+ 'qwen/qwen3-8b': 32768,
445
+ 'qwen/qwen3-8b:free': 32768,
446
+ 'qwen/qwen3-coder': 32768,
447
+ 'qwen/qwen3-coder:free': 32768,
448
+ 'qwen/qwq-32b': 32768,
449
+ 'qwen/qwq-32b-preview': 32768,
450
+ 'qwen/qwq-32b:free': 32768,
451
+ 'raifle/sorcererlm-8x22b': 65536,
452
+ 'rekaai/reka-flash-3:free': 128000,
453
+ 'sao10k/l3-euryale-70b': 8192,
454
+ 'sao10k/l3-lunaris-8b': 8192,
455
+ 'sao10k/l3.1-euryale-70b': 131072,
456
+ 'sao10k/l3.3-euryale-70b': 131072,
457
+ 'sarvamai/sarvam-m:free': 8192,
458
+ 'scb10x/llama3.1-typhoon2-70b-instruct': 131072,
459
+ 'shisa-ai/shisa-v2-llama3.3-70b': 131072,
460
+ 'shisa-ai/shisa-v2-llama3.3-70b:free': 131072,
461
+ 'sophosympatheia/midnight-rose-70b': 4096,
462
+ 'switchpoint/router': 8192,
463
+ 'tencent/hunyuan-a13b-instruct': 8192,
464
+ 'tencent/hunyuan-a13b-instruct:free': 8192,
465
+ 'thedrummer/anubis-70b-v1.1': 8192,
466
+ 'thedrummer/anubis-pro-105b-v1': 8192,
467
+ 'thedrummer/rocinante-12b': 8192,
468
+ 'thedrummer/skyfall-36b-v2': 8192,
469
+ 'thedrummer/unslopnemo-12b': 128000,
470
+ 'thedrummer/valkyrie-49b-v1': 8192,
471
+ 'thudm/glm-4-32b': 2000000,
472
+ 'thudm/glm-4.1v-9b-thinking': 2000000,
473
+ 'thudm/glm-z1-32b:free': 2000000,
474
+ 'tngtech/deepseek-r1t-chimera': 32768,
475
+ 'tngtech/deepseek-r1t-chimera:free': 32768,
476
+ 'tngtech/deepseek-r1t2-chimera:free': 32768,
477
+ 'undi95/remm-slerp-l2-13b': 4096,
478
+ 'x-ai/grok-2-1212': 128000,
479
+ 'x-ai/grok-2-vision-1212': 128000,
480
+ 'x-ai/grok-3': 128000,
481
+ 'x-ai/grok-3-beta': 128000,
482
+ 'x-ai/grok-3-mini': 128000,
483
+ 'x-ai/grok-3-mini-beta': 128000,
484
+ 'x-ai/grok-4': 128000,
485
+ 'x-ai/grok-vision-beta': 128000,
486
+ 'z-ai/glm-4-32b': 2000000,
487
+ 'z-ai/glm-4.5': 2000000,
488
+ 'z-ai/glm-4.5-air': 2000000,
489
+ 'z-ai/glm-4.5-air:free': 2000000,
490
+ 'llama3.1': 131072, # Llama 3.1 extended context
491
+ 'llama3.2': 131072, # Llama 3.2 extended context
492
+ 'llama3.3': 131072, # Assuming similar to 3.1/3.2
493
+ 'llama3': 8192, # Llama 3 default
494
+ 'llama2': 4096, # Llama 2 default
495
+ 'mixtral8x22b': 65536, # Mixtral 8x22B default
496
+ 'mixtral': 32768, # Mixtral 8x7B default
497
+ 'mistral': 32768, # Mistral 7B v0.2+ default
498
+ 'gemma3': 131072, # Gemma 3 with 128K context
499
+ 'gemma2': 8192, # Gemma 2 default
500
+ 'gemma': 8192, # Gemma default
501
+ 'phi3': 131072, # Phi-3 variants often use 128K (mini/medium extended)
502
+ 'phi2': 2048, # Phi-2 default
503
+ 'phi': 2048, # Phi default (older)
504
+ 'qwen2.5': 131072, # Qwen2.5 with 128K
505
+ 'qwen2': 32768, # Qwen2 default for 7B
506
+ 'qwen': 8192, # Qwen default
507
+ 'codellama': 16384, # CodeLlama extended
508
+ 'codegemma': 8192, # CodeGemma default
509
+ 'deepseek-coder-v2': 131072, # DeepSeek-Coder V2 with 128K
510
+ 'deepseek-coder': 16384, # DeepSeek-Coder V1 default
511
+ 'deepseek-v2': 131072, # DeepSeek-V2 with 128K
512
+ 'deepseek-llm': 4096, # DeepSeek-LLM default
513
+ 'yi1.5': 32768, # Yi-1.5 with 32K
514
+ 'yi': 4096, # Yi base default
515
+ 'command-r': 131072, # Command-R with 128K
516
+ 'wizardlm2': 32768, # WizardLM2 (Mistral-based)
517
+ 'wizardlm': 16384, # WizardLM default
518
+ 'zephyr': 65536, # Zephyr beta (Mistral-based extended)
519
+ 'vicuna': 2048, # Vicuna default (up to 16K in some variants)
520
+ 'falcon': 2048, # Falcon default
521
+ 'starcoder': 8192, # StarCoder default
522
+ 'stablelm': 4096, # StableLM default
523
+ 'orca2': 4096, # Orca 2 default
524
+ 'orca': 4096, # Orca default
525
+ 'dolphin': 32768, # Dolphin (often Mistral-based)
526
+ 'openhermes': 8192, # OpenHermes default
527
+ 'gpt-oss': 128000, # GPT-OSS with 128K context
528
+ 'gpt-3.5-turbo': 4096, # GPT-3.5 Turbo default
529
+ 'gpt-4': 8192, # GPT-4 default
530
+ 'grok-2': 128000,
531
+ 'grok-2-1212': 128000,
532
+ 'grok-2-vision-1212': 128000,
533
+ 'grok-3': 128000,
534
+ 'grok-3-fast': 128000,
535
+ 'grok-3-beta': 128000,
536
+ 'grok-3-mini': 128000,
537
+ 'grok-3-mini-beta': 128000,
538
+ 'grok-3-mini-fast': 128000,
539
+ 'grok-4-0709': 128000,
540
+ 'grok-4': 128000,
541
+ 'grok-vision-beta': 128000,
542
+ }
543
+
544
+ normalized_model_name = model_name.lower().strip()
545
+
546
+ # Sort keys by length in descending order. This ensures that a more specific
547
+ # name like 'llama3.1' is checked before a less specific name like 'llama3'.
548
+ sorted_base_models = sorted(known_contexts.keys(), key=len, reverse=True)
549
+
550
+ for base_name in sorted_base_models:
551
+ if base_name in normalized_model_name:
552
+ context_size = known_contexts[base_name]
553
+ ASCIIColors.warning(
554
+ f"Using hardcoded context size for model '{model_name}' "
555
+ f"based on base name '{base_name}': {context_size}"
556
+ )
557
+ return context_size
558
+
559
+ ASCIIColors.warning(f"Context size not found for model '{model_name}' in the hardcoded list.")
159
560
  return None
160
561
 
161
562
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lollms_client
3
- Version: 0.32.0
3
+ Version: 0.33.0
4
4
  Summary: A client library for LoLLMs generate endpoint
5
5
  Author-email: ParisNeo <parisneoai@gmail.com>
6
6
  License: Apache Software License
@@ -29,12 +29,12 @@ examples/mcp_examples/openai_mcp.py,sha256=7IEnPGPXZgYZyiES_VaUbQ6viQjenpcUxGiHE
29
29
  examples/mcp_examples/run_remote_mcp_example_v2.py,sha256=bbNn93NO_lKcFzfIsdvJJijGx2ePFTYfknofqZxMuRM,14626
30
30
  examples/mcp_examples/run_standard_mcp_example.py,sha256=GSZpaACPf3mDPsjA8esBQVUsIi7owI39ca5avsmvCxA,9419
31
31
  examples/test_local_models/local_chat.py,sha256=slakja2zaHOEAUsn2tn_VmI4kLx6luLBrPqAeaNsix8,456
32
- lollms_client/__init__.py,sha256=7Vw58C6Ala6ESJmnETjGFRBG1C1H-3SKmTnfbL46eVI,1147
32
+ lollms_client/__init__.py,sha256=47yhAwjjK7irs9nhUU68Bk1NDWYRMIP23TCDociofi8,1147
33
33
  lollms_client/lollms_config.py,sha256=goEseDwDxYJf3WkYJ4IrLXwg3Tfw73CXV2Avg45M_hE,21876
34
34
  lollms_client/lollms_core.py,sha256=gDhpB62AluEmbVFvPm7vdnZgP2hGBymDLun57K1jrOM,177352
35
- lollms_client/lollms_discussion.py,sha256=TT-AIKMdEuNNBjrWgMLcww8z6vIETO0J3cnoQgb9dhU,85448
35
+ lollms_client/lollms_discussion.py,sha256=RDX4V5R4sKCxuTjL2ILyGrDlHlyefFPf3x98_mnra3M,85608
36
36
  lollms_client/lollms_js_analyzer.py,sha256=01zUvuO2F_lnUe_0NLxe1MF5aHE1hO8RZi48mNPv-aw,8361
37
- lollms_client/lollms_llm_binding.py,sha256=3x5Y_RYZJmMDJkYZp1saLSOnwXszqSmedAEiijsjZlk,15535
37
+ lollms_client/lollms_llm_binding.py,sha256=8jJ8TPtkxh6TSKaYdrUrEI9ulY9gvN1RGHIrbPOWsDs,35963
38
38
  lollms_client/lollms_mcp_binding.py,sha256=0rK9HQCBEGryNc8ApBmtOlhKE1Yfn7X7xIQssXxS2Zc,8933
39
39
  lollms_client/lollms_mcp_security.py,sha256=FhVTDhSBjksGEZnopVnjFmEF5dv7D8bBTqoaj4BiF0E,3562
40
40
  lollms_client/lollms_personality.py,sha256=O-9nqZhazcITOkxjT24ENTxTmIoZLgqIsQ9WtWs0Id0,8719
@@ -51,15 +51,15 @@ lollms_client/llm_bindings/azure_openai/__init__.py,sha256=8C-gXoVa-OI9FmFM3PaMg
51
51
  lollms_client/llm_bindings/claude/__init__.py,sha256=CsWILXAFytXtxp1ZAoNwq8KycW0POQ2MCmpT6Bz0Hd0,24877
52
52
  lollms_client/llm_bindings/gemini/__init__.py,sha256=ZflZVwAkAa-GfctuehOWIav977oTCdXUisQy253PFsk,21611
53
53
  lollms_client/llm_bindings/grok/__init__.py,sha256=5tIf3348RgAEaSp6FdG-LM9N8R7aR0t7OFspHf3XATs,23141
54
- lollms_client/llm_bindings/groq/__init__.py,sha256=zyWKM78qHwSt5g0Bb8Njj7Jy8CYuLMyplx2maOKFFpg,12218
54
+ lollms_client/llm_bindings/groq/__init__.py,sha256=qDCZXIzldblNHyb3LfcZkM0a8m1hSWilb2m9l-xvkZ8,12180
55
55
  lollms_client/llm_bindings/hugging_face_inference_api/__init__.py,sha256=PxgeRqT8dpa9GZoXwtSncy9AUgAN2cDKrvp_nbaWq0E,14027
56
56
  lollms_client/llm_bindings/litellm/__init__.py,sha256=pNkwyRPeENvTM4CDh6Pj3kQfxHfhX2pvXhGJDjKjp30,12340
57
- lollms_client/llm_bindings/llamacpp/__init__.py,sha256=gER3lYd4Ez_Ng_yLO5zSZH52KgUosHXfdTr5W2wX_Jk,69000
57
+ lollms_client/llm_bindings/llamacpp/__init__.py,sha256=6LHrsSD_4Xdq57sJaGf8gSndmG4hHcOS9wlsfa62TPQ,58650
58
58
  lollms_client/llm_bindings/lollms/__init__.py,sha256=scGHEKzlGX5fw2XwefVicsf28GrwgN3wU5nl4EPJ_Sk,24424
59
59
  lollms_client/llm_bindings/lollms_webui/__init__.py,sha256=Thoq3PJR2e03Y2Kd_FBb-DULJK0zT5-2ID1YIJLcPlw,17864
60
- lollms_client/llm_bindings/mistral/__init__.py,sha256=624Gr462yBh52ttHFOapKgJOn8zZ1vZcTEcC3i4FYt8,12750
61
- lollms_client/llm_bindings/ollama/__init__.py,sha256=_plx8cO3Bl9igmIEvTkJ6tkZ2imHS_L76hCHdJAGIhQ,36851
62
- lollms_client/llm_bindings/open_router/__init__.py,sha256=v91BpNcuQCbbA6r82gbgMP8UYhSrJUMOf4UtOzEo18Q,13235
60
+ lollms_client/llm_bindings/mistral/__init__.py,sha256=DFQAcrUR69oF1FhtKi1glMXqCF4jhqN2ctRN19tmrcM,14193
61
+ lollms_client/llm_bindings/ollama/__init__.py,sha256=dXKHIeQCS9pz5AS07GF1eWj3ieWiz3aFOtxOX7yojbs,41314
62
+ lollms_client/llm_bindings/open_router/__init__.py,sha256=tcG8yWd4ULIhqrfMURqqJbnAEDw8H3zU500FSHkoXMM,14977
63
63
  lollms_client/llm_bindings/openai/__init__.py,sha256=Z0zNTfBgBGwkwArN375kBt4otrUTI_84pHgVuyuDy0c,26253
64
64
  lollms_client/llm_bindings/openllm/__init__.py,sha256=xv2XDhJNCYe6NPnWBboDs24AQ1VJBOzsTuMcmuQ6xYY,29864
65
65
  lollms_client/llm_bindings/pythonllamacpp/__init__.py,sha256=VNa6NXe7bY44Oev8r6q5XlQbxqWU2nBV62SFlsPPH78,31810
@@ -93,9 +93,9 @@ lollms_client/tts_bindings/piper_tts/__init__.py,sha256=0IEWG4zH3_sOkSb9WbZzkeV5
93
93
  lollms_client/tts_bindings/xtts/__init__.py,sha256=FgcdUH06X6ZR806WQe5ixaYx0QoxtAcOgYo87a2qxYc,18266
94
94
  lollms_client/ttv_bindings/__init__.py,sha256=UZ8o2izQOJLQgtZ1D1cXoNST7rzqW22rL2Vufc7ddRc,3141
95
95
  lollms_client/ttv_bindings/lollms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- lollms_client-0.32.0.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
96
+ lollms_client-0.33.0.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
97
97
  test/test_lollms_discussion.py,sha256=KxTsV1bPdNz8QqZd7tIof9kTWkeXLUtAMU08BQmoY6U,16829
98
- lollms_client-0.32.0.dist-info/METADATA,sha256=uuOa7NYNuAQ8ibP6D24yqMQqg6Asl1Cep1UIIH1b6Dw,38717
99
- lollms_client-0.32.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- lollms_client-0.32.0.dist-info/top_level.txt,sha256=1jIpjTnOSGEGtIW2rGAFM6tVRzgsDdMOiox_SmDH_zw,28
101
- lollms_client-0.32.0.dist-info/RECORD,,
98
+ lollms_client-0.33.0.dist-info/METADATA,sha256=kPveiEdFJW9h1_mj_DYJJ9Gq1-upw6YaFd2a70lLhWo,38717
99
+ lollms_client-0.33.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ lollms_client-0.33.0.dist-info/top_level.txt,sha256=1jIpjTnOSGEGtIW2rGAFM6tVRzgsDdMOiox_SmDH_zw,28
101
+ lollms_client-0.33.0.dist-info/RECORD,,