python-fastllm 0.0.24__tar.gz → 0.0.26__tar.gz
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.
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/PKG-INFO +1 -1
- python_fastllm-0.0.26/fastllm/__init__.py +1 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/_modidx.py +1 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/types.py +25 -8
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/PKG-INFO +1 -1
- python_fastllm-0.0.24/fastllm/__init__.py +0 -1
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/README.md +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/acomplete.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/anthropic.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/chat.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/codex.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/gemini.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/openai_chat.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/openai_responses.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/specs/anthropic.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/specs/anthropic.yml +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/specs/gemini.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/specs/openai.with-code-samples.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/specs/openai.with-code-samples.yml +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/specs/spec_manifest.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/fastllm/streaming.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/pyproject.toml +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/SOURCES.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/dependency_links.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/entry_points.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/requires.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/top_level.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.26}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.26"
|
|
@@ -287,6 +287,7 @@ d = { 'settings': { 'branch': 'main',
|
|
|
287
287
|
'fastllm.types.get_model_meta': ('types.html#get_model_meta', 'fastllm/types.py'),
|
|
288
288
|
'fastllm.types.get_model_pricing': ('types.html#get_model_pricing', 'fastllm/types.py'),
|
|
289
289
|
'fastllm.types.infer_api_name': ('types.html#infer_api_name', 'fastllm/types.py'),
|
|
290
|
+
'fastllm.types.is_deepseek_peak_hour': ('types.html#is_deepseek_peak_hour', 'fastllm/types.py'),
|
|
290
291
|
'fastllm.types.mk_completion': ('types.html#mk_completion', 'fastllm/types.py'),
|
|
291
292
|
'fastllm.types.mk_tool_res_msg': ('types.html#mk_tool_res_msg', 'fastllm/types.py'),
|
|
292
293
|
'fastllm.types.model_prices_meta': ('types.html#model_prices_meta', 'fastllm/types.py'),
|
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_types.ipynb.
|
|
4
4
|
|
|
5
5
|
# %% auto #0
|
|
6
|
-
__all__ = ['PartType', 'FinishReason', 'api_registry', 'model_prices_url', 'haik45', 'sonn45', 'sonn', 'sonn46', '
|
|
7
|
-
'gpt54', 'gpt54m', 'gpt55', 'codex54', 'codex54m', 'codex55', 'codex53spark',
|
|
8
|
-
'modern_llm', 'deepseek_v4_common', 'mimo_v25_common', 'codex_pricing', 'Part', 'Msg',
|
|
9
|
-
'display_list', 'Usage', 'Completion', 'APIRegistry', 'mk_completion', 'mk_tool_res_msg',
|
|
10
|
-
'sys_text', 'part_txt', 'data_url', 'url_mime', 'payload_kwargs', 'get_api_key', 'resize_b64',
|
|
6
|
+
__all__ = ['PartType', 'FinishReason', 'api_registry', 'model_prices_url', 'haik45', 'sonn45', 'sonn', 'sonn46', 'sonn5',
|
|
7
|
+
'opus46', 'opus', 'gpt54', 'gpt54m', 'gpt55', 'codex54', 'codex54m', 'codex55', 'codex53spark',
|
|
8
|
+
'model_info_registry', 'modern_llm', 'deepseek_v4_common', 'mimo_v25_common', 'codex_pricing', 'Part', 'Msg',
|
|
9
|
+
'ToolCall', 'display_list', 'Usage', 'Completion', 'APIRegistry', 'mk_completion', 'mk_tool_res_msg',
|
|
10
|
+
'fn_schema', 'sys_text', 'part_txt', 'data_url', 'url_mime', 'payload_kwargs', 'get_api_key', 'resize_b64',
|
|
11
11
|
'model_prices_meta', 'infer_api_name', 'get_model_meta', 'register_model_info', 'get_model_info',
|
|
12
|
-
'get_model_pricing', 'approx_pricing']
|
|
12
|
+
'get_model_pricing', 'approx_pricing', 'is_deepseek_peak_hour']
|
|
13
13
|
|
|
14
14
|
# %% ../nbs/00_types.ipynb #b4d047fd
|
|
15
15
|
import httpx, base64, io
|
|
16
16
|
from dataclasses import dataclass, field
|
|
17
|
+
from datetime import datetime, timezone
|
|
17
18
|
from fastcore.net import urljson
|
|
18
19
|
from fastcore.utils import *
|
|
19
20
|
from PIL import Image as PImg
|
|
@@ -286,6 +287,7 @@ def get_model_meta(model, vendor_name=None, tfm=noop):
|
|
|
286
287
|
haik45 = "claude-haiku-4-5"
|
|
287
288
|
sonn45 = "claude-sonnet-4-5"
|
|
288
289
|
sonn = sonn46 = "claude-sonnet-4-6"
|
|
290
|
+
sonn5 = "claude-sonnet-5"
|
|
289
291
|
opus46 = "claude-opus-4-6"
|
|
290
292
|
opus = "claude-opus-4-8"
|
|
291
293
|
gpt54 = "gpt-5.4"
|
|
@@ -331,7 +333,11 @@ register_model_info('accounts/fireworks/models/qwen3p6-plus', vendor_name='firew
|
|
|
331
333
|
|
|
332
334
|
register_model_info('accounts/fireworks/models/glm-5p2', vendor_name='fireworks_ai', **modern_llm, supports_vision=False,
|
|
333
335
|
max_tokens=1000000, max_input_tokens=1000000, max_output_tokens=65536,
|
|
334
|
-
input_cost_per_token=1.4e-6, cache_read_input_token_cost=0.
|
|
336
|
+
input_cost_per_token=1.4e-6, cache_read_input_token_cost=0.14e-6, output_cost_per_token=4.4e-6)
|
|
337
|
+
|
|
338
|
+
register_model_info('accounts/fireworks/routers/glm-5p2-fast', vendor_name='fireworks_ai', **modern_llm, supports_vision=False,
|
|
339
|
+
max_tokens=1000000, max_input_tokens=1000000, max_output_tokens=65536,
|
|
340
|
+
input_cost_per_token=2.8e-6, cache_read_input_token_cost=0.28e-6, output_cost_per_token=8.8e-6)
|
|
335
341
|
|
|
336
342
|
register_model_info('gemini-3.5-flash', vendor_name='gemini', base='gemini-3-flash-preview',
|
|
337
343
|
input_cost_per_token=1.5e-6, output_cost_per_token=9e-6,
|
|
@@ -401,6 +407,9 @@ register_model_info(codex53spark, 'codex', **codex_pricing,
|
|
|
401
407
|
for model in (haik45, sonn45, sonn46, opus46, opus):
|
|
402
408
|
register_model_info(model, 'claude_code', base=model, base_vendor_name='anthropic', **codex_pricing)
|
|
403
409
|
|
|
410
|
+
# %% ../nbs/00_types.ipynb #60630540
|
|
411
|
+
register_model_info(sonn5, base=sonn5, max_input_tokens=760_000)
|
|
412
|
+
|
|
404
413
|
# %% ../nbs/00_types.ipynb #24cc47ec
|
|
405
414
|
def get_model_pricing(mn, vendor_name, million=True):
|
|
406
415
|
return {k:round(v * (1e6 if million else 1), 6)
|
|
@@ -416,10 +425,18 @@ def approx_pricing(nm, vendor_name, out=10, cache=80, inp=10, markup=0):
|
|
|
416
425
|
if nm in ('claude-opus-4-7','claude-opus-4-8','claude-fable-5'): res *= 1.5
|
|
417
426
|
return res*(1+markup)
|
|
418
427
|
|
|
428
|
+
# %% ../nbs/00_types.ipynb #d2a310fb
|
|
429
|
+
def is_deepseek_peak_hour(dt=None):
|
|
430
|
+
"Check whether current UTC time is in DeepSeek peak pricing hours."
|
|
431
|
+
dt = dt or datetime.now(timezone.utc)
|
|
432
|
+
h = dt.hour + dt.minute/60
|
|
433
|
+
return 1 <= h < 4 or 6 <= h < 10
|
|
434
|
+
|
|
419
435
|
# %% ../nbs/00_types.ipynb #8bfca02d
|
|
420
436
|
@patch(as_prop=True)
|
|
421
437
|
def cost(self:Completion):
|
|
422
438
|
meta = dict2obj(get_model_info(self.model, self.vendor_name))
|
|
423
439
|
api = api_registry.apis[self.api_name]
|
|
424
440
|
if not hasattr(api, 'cost'): raise NotImplementedError(f"API: {self.api_name} doesn't have a registered `cost` function in ns")
|
|
425
|
-
|
|
441
|
+
res = api.cost(self.usage, meta)
|
|
442
|
+
return res*2 if self.vendor_name=='deepseek' and self.model.startswith('deepseek-v4') and is_deepseek_peak_hour() else res
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.24"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fastllm-0.0.24 → python_fastllm-0.0.26}/python_fastllm.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|