bladekit 4.66.1__tar.gz → 4.68.0__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.
Files changed (35) hide show
  1. {bladekit-4.66.1 → bladekit-4.68.0}/PKG-INFO +1 -1
  2. {bladekit-4.66.1 → bladekit-4.68.0}/pyproject.toml +1 -1
  3. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_app.py +32 -11
  4. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_cls.py +5 -0
  5. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_constants.py +4 -6
  6. {bladekit-4.66.1 → bladekit-4.68.0}/.gitignore +0 -0
  7. {bladekit-4.66.1 → bladekit-4.68.0}/README.md +0 -0
  8. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/__init__.py +0 -0
  9. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_banner.py +0 -0
  10. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_batch.py +0 -0
  11. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_bucket.py +0 -0
  12. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_build.py +0 -0
  13. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_bundle.py +0 -0
  14. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_client.py +0 -0
  15. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_cron.py +0 -0
  16. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_dict.py +0 -0
  17. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_env.py +0 -0
  18. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_exported_metrics.py +0 -0
  19. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_image.py +0 -0
  20. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_loader.py +0 -0
  21. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_map.py +0 -0
  22. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_metrics_cli.py +0 -0
  23. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_preempt.py +0 -0
  24. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_queue.py +0 -0
  25. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_render.py +0 -0
  26. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_runner_api.py +0 -0
  27. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_sandbox.py +0 -0
  28. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_secret.py +0 -0
  29. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_serialize.py +0 -0
  30. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_serve.py +0 -0
  31. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_volume.py +0 -0
  32. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/_webhook.py +0 -0
  33. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/cli.py +0 -0
  34. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/config.py +0 -0
  35. {bladekit-4.66.1 → bladekit-4.68.0}/src/bladekit/exceptions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bladekit
3
- Version: 4.66.1
3
+ Version: 4.68.0
4
4
  Summary: Blade AI Fabric SDK + CLI — run Python functions on Blade's GPU fleet.
5
5
  Project-URL: Homepage, https://blade.sh
6
6
  Project-URL: Documentation, https://console.blade.sh
@@ -16,7 +16,7 @@
16
16
  # uninstalled during an upgrade, and `forge` is a different project's name on
17
17
  # public PyPI.
18
18
  name = "bladekit"
19
- version = "4.66.1"
19
+ version = "4.68.0"
20
20
  description = "Blade AI Fabric SDK + CLI — run Python functions on Blade's GPU fleet."
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.10"
@@ -28,9 +28,7 @@ from . import exceptions as exc
28
28
  from ._exported_metrics import ExportMetric, validate_export_metrics
29
29
  from ._constants import (
30
30
  CALL_TERMINAL_STATES,
31
- DEFAULT_CPU_MILLICORES,
32
31
  DEFAULT_IDLE_TIMEOUT_SECONDS,
33
- DEFAULT_MEMORY_MB,
34
32
  DEFAULT_TIMEOUT_SECONDS,
35
33
  GPU_COUNT_MAX,
36
34
  GPU_COUNT_MIN,
@@ -558,7 +556,13 @@ def _reject_coroutine_function(fn: Callable[..., Any], what: str = "an AI Fabric
558
556
 
559
557
 
560
558
  class Function:
561
- """A decorated function, callable remotely."""
559
+ """A decorated function, callable remotely.
560
+
561
+ ``cpu`` (vCPUs) and ``memory`` (MiB) are sent only when set; default: the
562
+ GPU's included base × GPU count; without a GPU, 4 GB per vCPU requested
563
+ (1 vCPU and 4 GB by default), capped at 16 vCPU and 64 GB; without an
564
+ included base on the rate card, 1 vCPU and 16 GB.
565
+ """
562
566
 
563
567
  def __init__(
564
568
  self,
@@ -789,9 +793,12 @@ class Function:
789
793
  f"(100 millicores); raise cpu= on @app.function.",
790
794
  )
791
795
  spec["cpu_millicores"] = millicores
792
- else:
793
- spec["cpu_millicores"] = DEFAULT_CPU_MILLICORES
794
- spec["memory_mb"] = self.memory if self.memory is not None else DEFAULT_MEMORY_MB
796
+ # Unset cpu/memory are omitted: the server applies the GPU's included
797
+ # base × GPU count (without a GPU, 4 GB per vCPU requested, 1 vCPU and
798
+ # 4 GB by default; 1 vCPU and 16 GB when the rate card has no included
799
+ # base for the type).
800
+ if self.memory is not None:
801
+ spec["memory_mb"] = self.memory
795
802
  spec["timeout_seconds"] = (
796
803
  self.timeout if self.timeout is not None else DEFAULT_TIMEOUT_SECONDS
797
804
  )
@@ -1118,12 +1125,17 @@ class Function:
1118
1125
  "cron_expr": self.schedule.expression,
1119
1126
  "overlap_policy": self.schedule.overlap_policy,
1120
1127
  "function": self._function_ref(),
1128
+ # cpu_millicores / memory_mb are absent when unset (server default).
1121
1129
  "resources": {
1122
- "gpu_type": res["gpu_type"],
1123
- "gpu_count": res["gpu_count"],
1124
- "cpu_millicores": res["cpu_millicores"],
1125
- "memory_mb": res["memory_mb"],
1126
- "timeout_seconds": res["timeout_seconds"],
1130
+ k: res[k]
1131
+ for k in (
1132
+ "gpu_type",
1133
+ "gpu_count",
1134
+ "cpu_millicores",
1135
+ "memory_mb",
1136
+ "timeout_seconds",
1137
+ )
1138
+ if k in res
1127
1139
  },
1128
1140
  }
1129
1141
  if self.priority is not None:
@@ -2703,6 +2715,10 @@ class App:
2703
2715
  (only takes effect in a deployed app, not in ``blade run``).
2704
2716
  - ``gpu="RTX-A4500:4"``: multi-GPU per container (``":N"`` suffix
2705
2717
  sets ``gpu_count``; N must be 1–8).
2718
+ - ``cpu`` (vCPUs, min 0.1) / ``memory`` (MiB): default: the GPU's
2719
+ included base × GPU count; without a GPU, 4 GB per vCPU requested
2720
+ (1 vCPU and 4 GB by default), capped at 16 vCPU and 64 GB; without
2721
+ an included base on the rate card, 1 vCPU and 16 GB.
2706
2722
  """
2707
2723
  # Validate priority/retries params at decoration time (not at call time).
2708
2724
  # retries accepts an int shorthand (retries=3) or a RetryPolicy dict.
@@ -3117,6 +3133,11 @@ class App:
3117
3133
  ``timeout`` has the same semantics as ``@app.function``: max seconds
3118
3134
  for one call (or one request on a deployed endpoint) — never the
3119
3135
  lifetime of a deployed service, which lives under the autoscaler.
3136
+
3137
+ ``cpu`` (vCPUs) / ``memory`` (MiB) default: the GPU's included base ×
3138
+ GPU count; without a GPU, 4 GB per vCPU requested (1 vCPU and 4 GB by
3139
+ default), capped at 16 vCPU and 64 GB; without an included base on the
3140
+ rate card, 1 vCPU and 16 GB.
3120
3141
  """
3121
3142
  from ._cls import Cls
3122
3143
 
@@ -324,6 +324,11 @@ class Cls:
324
324
 
325
325
  Calling it (``Embedder()``) returns a normal instance for local use; remote
326
326
  calls go through ``instance.method.remote(...)``.
327
+
328
+ ``cpu`` (vCPUs) / ``memory`` (MiB) default: the GPU's included base × GPU
329
+ count; without a GPU, 4 GB per vCPU requested (1 vCPU and 4 GB by
330
+ default), capped at 16 vCPU and 64 GB; without an included base on the
331
+ rate card, 1 vCPU and 16 GB.
327
332
  """
328
333
 
329
334
  def __init__(
@@ -22,13 +22,11 @@ DEFAULT_PAGE_LIMIT = 50
22
22
  MAX_PAGE_LIMIT = 200
23
23
 
24
24
  # --- Defaults for ResourceSpec (openapi.yaml ResourceSpec) ------------------
25
+ # cpu_millicores / memory_mb have no client default: the server applies the
26
+ # GPU's included base × GPU count (without a GPU, 4 GB per vCPU requested,
27
+ # 1 vCPU and 4 GB by default; 1 vCPU and 16 GB when the rate card has no
28
+ # included base for the type).
25
29
 
26
- DEFAULT_CPU_MILLICORES = 1000
27
- # 16 GiB: a sane floor for ML workloads. Raised from 4096 (4 GiB) after a
28
- # real-GPU validation where loading a 7B model was OOM-killed by the memory
29
- # cgroup under the old default. Kept in lockstep with the control-plane
30
- # default (state.DefaultMemoryMB). Set memory= explicitly to override.
31
- DEFAULT_MEMORY_MB = 16384
32
30
  DEFAULT_TIMEOUT_SECONDS = 3600
33
31
  DEFAULT_IDLE_TIMEOUT_SECONDS = 60
34
32
 
File without changes
File without changes
File without changes