python-fastllm 0.0.24__tar.gz → 0.0.25__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.25}/PKG-INFO +1 -1
- python_fastllm-0.0.25/fastllm/__init__.py +1 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/_modidx.py +1 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/types.py +16 -3
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/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.25}/README.md +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/acomplete.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/anthropic.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/chat.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/codex.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/gemini.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/openai_chat.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/openai_responses.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/specs/anthropic.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/specs/anthropic.yml +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/specs/gemini.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/specs/openai.with-code-samples.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/specs/openai.with-code-samples.yml +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/specs/spec_manifest.json +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/fastllm/streaming.py +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/pyproject.toml +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/python_fastllm.egg-info/SOURCES.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/python_fastllm.egg-info/dependency_links.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/python_fastllm.egg-info/entry_points.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/python_fastllm.egg-info/requires.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/python_fastllm.egg-info/top_level.txt +0 -0
- {python_fastllm-0.0.24 → python_fastllm-0.0.25}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.25"
|
|
@@ -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'),
|
|
@@ -9,11 +9,12 @@ __all__ = ['PartType', 'FinishReason', 'api_registry', 'model_prices_url', 'haik
|
|
|
9
9
|
'display_list', 'Usage', 'Completion', 'APIRegistry', 'mk_completion', 'mk_tool_res_msg', 'fn_schema',
|
|
10
10
|
'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
|
|
@@ -331,7 +332,11 @@ register_model_info('accounts/fireworks/models/qwen3p6-plus', vendor_name='firew
|
|
|
331
332
|
|
|
332
333
|
register_model_info('accounts/fireworks/models/glm-5p2', vendor_name='fireworks_ai', **modern_llm, supports_vision=False,
|
|
333
334
|
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.
|
|
335
|
+
input_cost_per_token=1.4e-6, cache_read_input_token_cost=0.14e-6, output_cost_per_token=4.4e-6)
|
|
336
|
+
|
|
337
|
+
register_model_info('accounts/fireworks/routers/glm-5p2-fast', vendor_name='fireworks_ai', **modern_llm, supports_vision=False,
|
|
338
|
+
max_tokens=1000000, max_input_tokens=1000000, max_output_tokens=65536,
|
|
339
|
+
input_cost_per_token=2.8e-6, cache_read_input_token_cost=0.28e-6, output_cost_per_token=8.8e-6)
|
|
335
340
|
|
|
336
341
|
register_model_info('gemini-3.5-flash', vendor_name='gemini', base='gemini-3-flash-preview',
|
|
337
342
|
input_cost_per_token=1.5e-6, output_cost_per_token=9e-6,
|
|
@@ -416,10 +421,18 @@ def approx_pricing(nm, vendor_name, out=10, cache=80, inp=10, markup=0):
|
|
|
416
421
|
if nm in ('claude-opus-4-7','claude-opus-4-8','claude-fable-5'): res *= 1.5
|
|
417
422
|
return res*(1+markup)
|
|
418
423
|
|
|
424
|
+
# %% ../nbs/00_types.ipynb #d2a310fb
|
|
425
|
+
def is_deepseek_peak_hour(dt=None):
|
|
426
|
+
"Check whether current UTC time is in DeepSeek peak pricing hours."
|
|
427
|
+
dt = dt or datetime.now(timezone.utc)
|
|
428
|
+
h = dt.hour + dt.minute/60
|
|
429
|
+
return 1 <= h < 4 or 6 <= h < 10
|
|
430
|
+
|
|
419
431
|
# %% ../nbs/00_types.ipynb #8bfca02d
|
|
420
432
|
@patch(as_prop=True)
|
|
421
433
|
def cost(self:Completion):
|
|
422
434
|
meta = dict2obj(get_model_info(self.model, self.vendor_name))
|
|
423
435
|
api = api_registry.apis[self.api_name]
|
|
424
436
|
if not hasattr(api, 'cost'): raise NotImplementedError(f"API: {self.api_name} doesn't have a registered `cost` function in ns")
|
|
425
|
-
|
|
437
|
+
res = api.cost(self.usage, meta)
|
|
438
|
+
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.25}/python_fastllm.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|