bladekit 4.44.0__tar.gz → 4.46.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.44.0 → bladekit-4.46.0}/PKG-INFO +1 -1
  2. {bladekit-4.44.0 → bladekit-4.46.0}/pyproject.toml +1 -1
  3. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_app.py +28 -1
  4. {bladekit-4.44.0 → bladekit-4.46.0}/.gitignore +0 -0
  5. {bladekit-4.44.0 → bladekit-4.46.0}/README.md +0 -0
  6. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/__init__.py +0 -0
  7. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_banner.py +0 -0
  8. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_batch.py +0 -0
  9. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_bucket.py +0 -0
  10. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_build.py +0 -0
  11. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_bundle.py +0 -0
  12. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_client.py +0 -0
  13. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_cls.py +0 -0
  14. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_constants.py +0 -0
  15. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_cron.py +0 -0
  16. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_dict.py +0 -0
  17. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_env.py +0 -0
  18. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_exported_metrics.py +0 -0
  19. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_image.py +0 -0
  20. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_loader.py +0 -0
  21. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_map.py +0 -0
  22. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_metrics_cli.py +0 -0
  23. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_preempt.py +0 -0
  24. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_queue.py +0 -0
  25. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_render.py +0 -0
  26. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_runner_api.py +0 -0
  27. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_sandbox.py +0 -0
  28. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_secret.py +0 -0
  29. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_serialize.py +0 -0
  30. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_serve.py +0 -0
  31. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_volume.py +0 -0
  32. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/_webhook.py +0 -0
  33. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/cli.py +0 -0
  34. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/config.py +0 -0
  35. {bladekit-4.44.0 → bladekit-4.46.0}/src/bladekit/exceptions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bladekit
3
- Version: 4.44.0
3
+ Version: 4.46.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.44.0"
19
+ version = "4.46.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"
@@ -262,6 +262,7 @@ class EndpointDeclaration:
262
262
  # §13.5 — local HTTP server endpoints (web_server / asgi_app).
263
263
  port: Optional[int] = None # server_port: user-provided for web_server, None for asgi_app
264
264
  startup_timeout_seconds: Optional[int] = None # loopback readiness budget
265
+ serve_max_request_seconds: Optional[int] = None # opt-in first-byte + total request budget
265
266
  # Autoscaling v2 — policy declared on the endpoint decorator (autoscale=).
266
267
  autoscale: Optional[Autoscale] = None
267
268
  # GPU snapshot opt-in (coldstart-snapshot.md §5). Valid ONLY on web_server
@@ -545,6 +546,7 @@ class Function:
545
546
  public=decl.public,
546
547
  port=decl.port,
547
548
  startup_timeout_seconds=decl.startup_timeout_seconds,
549
+ serve_max_request_seconds=decl.serve_max_request_seconds,
548
550
  autoscale=decl.autoscale,
549
551
  snapshot=decl.snapshot,
550
552
  export_metrics=decl.export_metrics,
@@ -569,6 +571,7 @@ class Function:
569
571
  public=decl.public,
570
572
  port=decl.port,
571
573
  startup_timeout_seconds=decl.startup_timeout_seconds,
574
+ serve_max_request_seconds=decl.serve_max_request_seconds,
572
575
  autoscale=decl.autoscale,
573
576
  snapshot=decl.snapshot,
574
577
  export_metrics=decl.export_metrics,
@@ -1050,6 +1053,8 @@ class Function:
1050
1053
  spec["server_port"] = decl.port
1051
1054
  if decl.startup_timeout_seconds is not None:
1052
1055
  spec["startup_timeout_seconds"] = decl.startup_timeout_seconds
1056
+ if decl.serve_max_request_seconds is not None:
1057
+ spec["serve_max_request_seconds"] = decl.serve_max_request_seconds
1053
1058
  # GPU snapshot opt-in (coldstart-snapshot.md §5). Emitted only when
1054
1059
  # True (mirrors `public`). Local mirror of the server rule: valid
1055
1060
  # ONLY on web_server with gpu_count==1 — fail here, before any
@@ -2196,6 +2201,17 @@ def _validate_startup_timeout(value: int) -> None:
2196
2201
  )
2197
2202
 
2198
2203
 
2204
+ def _validate_serve_max_request(value: Optional[int]) -> None:
2205
+ # openapi EndpointSpec.serve_max_request_seconds: 30..840, a contract constant.
2206
+ if value is None:
2207
+ return
2208
+ if not isinstance(value, int) or isinstance(value, bool) or not 30 <= value <= 840:
2209
+ raise exc.InvalidArgumentError(
2210
+ "INVALID_ARGUMENT",
2211
+ "serve_max_request must be an integer between 30 and 840 seconds",
2212
+ )
2213
+
2214
+
2199
2215
  def _validate_concurrency(value: int) -> None:
2200
2216
  if not isinstance(value, int) or value < 1 or value > 100:
2201
2217
  raise exc.InvalidArgumentError(
@@ -2646,6 +2662,7 @@ class App:
2646
2662
  *,
2647
2663
  port: Optional[int] = None,
2648
2664
  startup_timeout: int = 300,
2665
+ serve_max_request: Optional[int] = None,
2649
2666
  path: str = "/",
2650
2667
  name: Optional[str] = None,
2651
2668
  min_replicas: Optional[int] = None,
@@ -2687,6 +2704,10 @@ class App:
2687
2704
  error). Valid ONLY on a single-GPU ``web_server`` (``gpu_count == 1``);
2688
2705
  otherwise it raises ``bladekit.InvalidArgumentError`` at deploy build time.
2689
2706
 
2707
+ **Request budget.** ``serve_max_request`` (30..840 seconds) opts in to
2708
+ one budget for the first byte and the whole response, streams included.
2709
+ Unset keeps the node default; the deploy is refused while no node supports it.
2710
+
2690
2711
  **Queue bound.** ``max_queue_depth`` (0..10000) caps how many requests
2691
2712
  may wait for a replica slot at the platform ingress — mostly the
2692
2713
  cold-start window; at the bound new requests get an immediate
@@ -2710,6 +2731,7 @@ class App:
2710
2731
  """
2711
2732
  _reject_pinned_server_port(port)
2712
2733
  _validate_startup_timeout(startup_timeout)
2734
+ _validate_serve_max_request(serve_max_request)
2713
2735
  endpoint_path = _validate_path(path)
2714
2736
  _validate_autoscaling(
2715
2737
  min_replicas=min_replicas,
@@ -2738,6 +2760,7 @@ class App:
2738
2760
  public=public,
2739
2761
  port=port,
2740
2762
  startup_timeout_seconds=startup_timeout,
2763
+ serve_max_request_seconds=serve_max_request,
2741
2764
  autoscale=autoscale,
2742
2765
  snapshot=snapshot,
2743
2766
  export_metrics=exported,
@@ -2757,6 +2780,7 @@ class App:
2757
2780
  *,
2758
2781
  path: str = "/",
2759
2782
  startup_timeout: int = 300,
2783
+ serve_max_request: Optional[int] = None,
2760
2784
  name: Optional[str] = None,
2761
2785
  min_replicas: Optional[int] = None,
2762
2786
  max_replicas: Optional[int] = None,
@@ -2774,7 +2798,8 @@ class App:
2774
2798
  and forwards each web request to it (runner-protocol.md §13.5). ``uvicorn``
2775
2799
  must be present in the image. ``startup_timeout`` (seconds) bounds how long
2776
2800
  the runner probes the loopback before the replica is marked ready; the
2777
- replica fails if the server never answers.
2801
+ replica fails if the server never answers. ``serve_max_request`` (30..840
2802
+ seconds) opts in to one budget for the first byte and the whole response.
2778
2803
 
2779
2804
  Stackable with ``@app.function`` / ``@app.concurrent`` like ``web_endpoint``.
2780
2805
  Only non-streaming responses are supported for now — SSE/WebSocket are
@@ -2782,6 +2807,7 @@ class App:
2782
2807
  """
2783
2808
  endpoint_path = _validate_path(path)
2784
2809
  _validate_startup_timeout(startup_timeout)
2810
+ _validate_serve_max_request(serve_max_request)
2785
2811
  _validate_autoscaling(
2786
2812
  min_replicas=min_replicas,
2787
2813
  max_replicas=max_replicas,
@@ -2811,6 +2837,7 @@ class App:
2811
2837
  # Runner allocates the loopback port for uvicorn; server_port stays None.
2812
2838
  port=None,
2813
2839
  startup_timeout_seconds=startup_timeout,
2840
+ serve_max_request_seconds=serve_max_request,
2814
2841
  )
2815
2842
  if isinstance(fn, Function):
2816
2843
  return _apply_endpoint_marker(fn, decl)
File without changes
File without changes
File without changes