freesolo-flash-dev 0.2.25__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.
Files changed (111) hide show
  1. flash/__init__.py +29 -0
  2. flash/_channel.py +23 -0
  3. flash/_fileio.py +35 -0
  4. flash/_logging.py +49 -0
  5. flash/_update_check.py +266 -0
  6. flash/catalog.py +253 -0
  7. flash/cli/__init__.py +1 -0
  8. flash/cli/main/__init__.py +227 -0
  9. flash/cli/main/__main__.py +6 -0
  10. flash/cli/main/commands.py +636 -0
  11. flash/cli/main/envpush.py +317 -0
  12. flash/cli/main/render.py +599 -0
  13. flash/cli/main/training_doc.py +455 -0
  14. flash/client/__init__.py +14 -0
  15. flash/client/config.py +70 -0
  16. flash/client/http.py +372 -0
  17. flash/client/runtime_secrets.py +69 -0
  18. flash/client/specs.py +20 -0
  19. flash/cost/__init__.py +16 -0
  20. flash/cost/analytical.py +175 -0
  21. flash/cost/facts.py +114 -0
  22. flash/cost/spec.py +113 -0
  23. flash/cost/types.py +158 -0
  24. flash/engine/__init__.py +6 -0
  25. flash/engine/accounting.py +36 -0
  26. flash/engine/chalk_kernels.py +116 -0
  27. flash/engine/multiturn_rollout.py +780 -0
  28. flash/engine/recipe.py +86 -0
  29. flash/engine/vram.py +603 -0
  30. flash/engine/worker/__init__.py +2916 -0
  31. flash/engine/worker/__main__.py +4 -0
  32. flash/engine/worker/kernel_warmup.py +400 -0
  33. flash/engine/worker/lora.py +796 -0
  34. flash/engine/worker/packing.py +366 -0
  35. flash/engine/worker/perf.py +1048 -0
  36. flash/envs/__init__.py +10 -0
  37. flash/envs/adapter/__init__.py +883 -0
  38. flash/envs/adapter/rubric.py +222 -0
  39. flash/envs/base.py +52 -0
  40. flash/envs/registry.py +62 -0
  41. flash/mcp/__init__.py +1 -0
  42. flash/mcp/server.py +85 -0
  43. flash/providers/__init__.py +59 -0
  44. flash/providers/_auth.py +24 -0
  45. flash/providers/_http.py +230 -0
  46. flash/providers/_instance.py +416 -0
  47. flash/providers/_instance_bootstrap.py +517 -0
  48. flash/providers/_poll.py +311 -0
  49. flash/providers/allocator.py +193 -0
  50. flash/providers/base.py +431 -0
  51. flash/providers/hyperstack/__init__.py +127 -0
  52. flash/providers/hyperstack/api.py +522 -0
  53. flash/providers/hyperstack/auth.py +17 -0
  54. flash/providers/hyperstack/gpus.py +29 -0
  55. flash/providers/hyperstack/jobs/__init__.py +632 -0
  56. flash/providers/hyperstack/jobs/builders.py +122 -0
  57. flash/providers/hyperstack/preflight.py +23 -0
  58. flash/providers/hyperstack/pricing.py +26 -0
  59. flash/providers/hyperstack/train.py +25 -0
  60. flash/providers/lambdalabs/__init__.py +139 -0
  61. flash/providers/lambdalabs/api.py +261 -0
  62. flash/providers/lambdalabs/auth.py +18 -0
  63. flash/providers/lambdalabs/gpus.py +29 -0
  64. flash/providers/lambdalabs/jobs/__init__.py +724 -0
  65. flash/providers/lambdalabs/jobs/builders.py +118 -0
  66. flash/providers/lambdalabs/preflight.py +27 -0
  67. flash/providers/lambdalabs/pricing.py +51 -0
  68. flash/providers/lambdalabs/train.py +27 -0
  69. flash/providers/preflight.py +55 -0
  70. flash/providers/realized.py +80 -0
  71. flash/providers/runpod/__init__.py +130 -0
  72. flash/providers/runpod/api.py +186 -0
  73. flash/providers/runpod/auth.py +37 -0
  74. flash/providers/runpod/cost.py +57 -0
  75. flash/providers/runpod/gpus.py +46 -0
  76. flash/providers/runpod/jobs.py +956 -0
  77. flash/providers/runpod/keys.py +139 -0
  78. flash/providers/runpod/preflight.py +30 -0
  79. flash/providers/runpod/preload.py +915 -0
  80. flash/providers/runpod/pricing.py +18 -0
  81. flash/providers/runpod/slots.py +79 -0
  82. flash/providers/runpod/train/__init__.py +150 -0
  83. flash/providers/runpod/train/deps.py +395 -0
  84. flash/providers/runpod/train/endpoints.py +820 -0
  85. flash/py.typed +0 -0
  86. flash/runner/__init__.py +686 -0
  87. flash/runner/checkpoints.py +82 -0
  88. flash/runner/deploy.py +422 -0
  89. flash/runner/lifecycle.py +672 -0
  90. flash/schema/__init__.py +375 -0
  91. flash/schema/fields.py +331 -0
  92. flash/serve/__init__.py +1 -0
  93. flash/serve/deploy.py +326 -0
  94. flash/serve/pricing.py +60 -0
  95. flash/server/__init__.py +1 -0
  96. flash/server/__main__.py +20 -0
  97. flash/server/app.py +961 -0
  98. flash/server/auth.py +263 -0
  99. flash/server/billing.py +124 -0
  100. flash/server/checkpoints.py +110 -0
  101. flash/server/db.py +160 -0
  102. flash/server/environment_registry.py +102 -0
  103. flash/server/envs.py +360 -0
  104. flash/server/reconcile.py +163 -0
  105. flash/server/run_registry.py +150 -0
  106. flash/spec.py +333 -0
  107. freesolo_flash_dev-0.2.25.dist-info/METADATA +192 -0
  108. freesolo_flash_dev-0.2.25.dist-info/RECORD +111 -0
  109. freesolo_flash_dev-0.2.25.dist-info/WHEEL +4 -0
  110. freesolo_flash_dev-0.2.25.dist-info/entry_points.txt +3 -0
  111. freesolo_flash_dev-0.2.25.dist-info/licenses/LICENSE +201 -0
flash/serve/pricing.py ADDED
@@ -0,0 +1,60 @@
1
+ """Serving token prices for Flash deployments.
2
+
3
+ Prices are listed per 1M tokens. Flash bills the base model serverless list price
4
+ plus the fixed serving markup.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from dataclasses import dataclass
10
+
11
+ from flash.catalog import MODELS
12
+
13
+ SERVING_MARKUP = 1.20
14
+
15
+
16
+ @dataclass(frozen=True)
17
+ class ServingPrice:
18
+ model_id: str
19
+ base_input_usd_per_mtok: float
20
+ base_output_usd_per_mtok: float
21
+
22
+ @property
23
+ def billed_input_usd_per_mtok(self) -> float:
24
+ return self.base_input_usd_per_mtok * SERVING_MARKUP
25
+
26
+ @property
27
+ def billed_output_usd_per_mtok(self) -> float:
28
+ return self.base_output_usd_per_mtok * SERVING_MARKUP
29
+
30
+
31
+ SERVING_PRICES: dict[str, ServingPrice] = {
32
+ "openbmb/MiniCPM5-1B": ServingPrice("openbmb/MiniCPM5-1B", 0.05, 0.10),
33
+ "Qwen/Qwen3.5-0.8B": ServingPrice("Qwen/Qwen3.5-0.8B", 0.05, 0.10),
34
+ "Qwen/Qwen3.5-2B": ServingPrice("Qwen/Qwen3.5-2B", 0.10, 0.20),
35
+ "Qwen/Qwen3.5-4B": ServingPrice("Qwen/Qwen3.5-4B", 0.20, 0.40),
36
+ "Qwen/Qwen3.5-9B": ServingPrice("Qwen/Qwen3.5-9B", 0.50, 1.00),
37
+ }
38
+
39
+
40
+ def serving_price(model_id: str) -> ServingPrice:
41
+ try:
42
+ return SERVING_PRICES[model_id]
43
+ except KeyError as exc:
44
+ raise ValueError(f"unknown serving model {model_id!r}") from exc
45
+
46
+
47
+ def serving_price_rows() -> list[dict[str, float | str]]:
48
+ rows: list[dict[str, float | str]] = []
49
+ for model_id in sorted(MODELS):
50
+ price = serving_price(model_id)
51
+ rows.append(
52
+ {
53
+ "model_id": model_id,
54
+ "base_input_usd_per_mtok": price.base_input_usd_per_mtok,
55
+ "base_output_usd_per_mtok": price.base_output_usd_per_mtok,
56
+ "billed_input_usd_per_mtok": price.billed_input_usd_per_mtok,
57
+ "billed_output_usd_per_mtok": price.billed_output_usd_per_mtok,
58
+ }
59
+ )
60
+ return rows
@@ -0,0 +1 @@
1
+ """Control-plane API package."""
@@ -0,0 +1,20 @@
1
+ """`python -m flash.server` — run the managed control plane."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+
7
+ from .app import run_server
8
+
9
+
10
+ def main(argv: list[str] | None = None) -> int:
11
+ parser = argparse.ArgumentParser(prog="flash.server", description="Flash control plane")
12
+ parser.add_argument("--host", default="127.0.0.1")
13
+ parser.add_argument("--port", type=int, default=8080)
14
+ args = parser.parse_args(argv)
15
+ run_server(host=args.host, port=args.port)
16
+ return 0
17
+
18
+
19
+ if __name__ == "__main__":
20
+ raise SystemExit(main())