distributed-llm 0.4.1__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 (853) hide show
  1. distributed_llm-0.4.1/LICENSE +97 -0
  2. distributed_llm-0.4.1/PKG-INFO +315 -0
  3. distributed_llm-0.4.1/README.md +181 -0
  4. distributed_llm-0.4.1/pyproject.toml +292 -0
  5. distributed_llm-0.4.1/setup.cfg +4 -0
  6. distributed_llm-0.4.1/src/distllm/__init__.py +47 -0
  7. distributed_llm-0.4.1/src/distllm/api/__init__.py +11 -0
  8. distributed_llm-0.4.1/src/distllm/api/api_settings.py +126 -0
  9. distributed_llm-0.4.1/src/distllm/api/api_state.py +85 -0
  10. distributed_llm-0.4.1/src/distllm/api/api_versioning.py +984 -0
  11. distributed_llm-0.4.1/src/distllm/api/app_state.py +29 -0
  12. distributed_llm-0.4.1/src/distllm/api/auth/__init__.py +181 -0
  13. distributed_llm-0.4.1/src/distllm/api/auth/models.py +37 -0
  14. distributed_llm-0.4.1/src/distllm/api/auth/oauth2.py +123 -0
  15. distributed_llm-0.4.1/src/distllm/api/auth/oidc.py +317 -0
  16. distributed_llm-0.4.1/src/distllm/api/auth/saml.py +107 -0
  17. distributed_llm-0.4.1/src/distllm/api/auth/store.py +39 -0
  18. distributed_llm-0.4.1/src/distllm/api/auth_deps.py +68 -0
  19. distributed_llm-0.4.1/src/distllm/api/authz/__init__.py +30 -0
  20. distributed_llm-0.4.1/src/distllm/api/authz/opa.py +297 -0
  21. distributed_llm-0.4.1/src/distllm/api/background_tasks.py +295 -0
  22. distributed_llm-0.4.1/src/distllm/api/body_cache_middleware.py +117 -0
  23. distributed_llm-0.4.1/src/distllm/api/circuit_breaker_middleware.py +175 -0
  24. distributed_llm-0.4.1/src/distllm/api/cost_middleware.py +186 -0
  25. distributed_llm-0.4.1/src/distllm/api/csrf_middleware.py +196 -0
  26. distributed_llm-0.4.1/src/distllm/api/dedup.py +180 -0
  27. distributed_llm-0.4.1/src/distllm/api/errors.py +256 -0
  28. distributed_llm-0.4.1/src/distllm/api/grpc_bridge.py +296 -0
  29. distributed_llm-0.4.1/src/distllm/api/ip_utils.py +58 -0
  30. distributed_llm-0.4.1/src/distllm/api/middleware.py +706 -0
  31. distributed_llm-0.4.1/src/distllm/api/observability_middleware.py +169 -0
  32. distributed_llm-0.4.1/src/distllm/api/persistent_store.py +295 -0
  33. distributed_llm-0.4.1/src/distllm/api/prompt_injection.py +418 -0
  34. distributed_llm-0.4.1/src/distllm/api/quota_middleware.py +186 -0
  35. distributed_llm-0.4.1/src/distllm/api/rate_limit_middleware.py +13 -0
  36. distributed_llm-0.4.1/src/distllm/api/rate_limiter.py +250 -0
  37. distributed_llm-0.4.1/src/distllm/api/rate_limiter_unified.py +975 -0
  38. distributed_llm-0.4.1/src/distllm/api/redis_rate_limiter.py +164 -0
  39. distributed_llm-0.4.1/src/distllm/api/routes/__init__.py +42 -0
  40. distributed_llm-0.4.1/src/distllm/api/routes/admin.py +599 -0
  41. distributed_llm-0.4.1/src/distllm/api/routes/api_keys.py +115 -0
  42. distributed_llm-0.4.1/src/distllm/api/routes/assistants.py +443 -0
  43. distributed_llm-0.4.1/src/distllm/api/routes/batch.py +1094 -0
  44. distributed_llm-0.4.1/src/distllm/api/routes/chat.py +875 -0
  45. distributed_llm-0.4.1/src/distllm/api/routes/completion.py +141 -0
  46. distributed_llm-0.4.1/src/distllm/api/routes/debug.py +185 -0
  47. distributed_llm-0.4.1/src/distllm/api/routes/defrag.py +66 -0
  48. distributed_llm-0.4.1/src/distllm/api/routes/embeddings.py +399 -0
  49. distributed_llm-0.4.1/src/distllm/api/routes/eval.py +254 -0
  50. distributed_llm-0.4.1/src/distllm/api/routes/exchange.py +367 -0
  51. distributed_llm-0.4.1/src/distllm/api/routes/experiments.py +293 -0
  52. distributed_llm-0.4.1/src/distllm/api/routes/federated.py +155 -0
  53. distributed_llm-0.4.1/src/distllm/api/routes/files.py +243 -0
  54. distributed_llm-0.4.1/src/distllm/api/routes/fine_tuning.py +381 -0
  55. distributed_llm-0.4.1/src/distllm/api/routes/gossip.py +72 -0
  56. distributed_llm-0.4.1/src/distllm/api/routes/health.py +395 -0
  57. distributed_llm-0.4.1/src/distllm/api/routes/leaderboard.py +377 -0
  58. distributed_llm-0.4.1/src/distllm/api/routes/marketplace.py +320 -0
  59. distributed_llm-0.4.1/src/distllm/api/routes/metrics_history.py +415 -0
  60. distributed_llm-0.4.1/src/distllm/api/routes/model_registry.py +255 -0
  61. distributed_llm-0.4.1/src/distllm/api/routes/moderation.py +420 -0
  62. distributed_llm-0.4.1/src/distllm/api/routes/plugins.py +184 -0
  63. distributed_llm-0.4.1/src/distllm/api/routes/prompts.py +347 -0
  64. distributed_llm-0.4.1/src/distllm/api/routes/router_admin.py +187 -0
  65. distributed_llm-0.4.1/src/distllm/api/routes/scheduler.py +168 -0
  66. distributed_llm-0.4.1/src/distllm/api/routes/tokenize.py +77 -0
  67. distributed_llm-0.4.1/src/distllm/api/routes/tools.py +89 -0
  68. distributed_llm-0.4.1/src/distllm/api/routes/webhooks.py +336 -0
  69. distributed_llm-0.4.1/src/distllm/api/routes/webrtc.py +194 -0
  70. distributed_llm-0.4.1/src/distllm/api/semantic_cache.py +337 -0
  71. distributed_llm-0.4.1/src/distllm/api/server.py +2038 -0
  72. distributed_llm-0.4.1/src/distllm/api/server_config.py +140 -0
  73. distributed_llm-0.4.1/src/distllm/api/server_coordinator.py +125 -0
  74. distributed_llm-0.4.1/src/distllm/api/server_errors.py +79 -0
  75. distributed_llm-0.4.1/src/distllm/api/server_lifespan.py +184 -0
  76. distributed_llm-0.4.1/src/distllm/api/server_routes_api.py +456 -0
  77. distributed_llm-0.4.1/src/distllm/api/server_routes_dashboard.py +246 -0
  78. distributed_llm-0.4.1/src/distllm/api/server_state.py +29 -0
  79. distributed_llm-0.4.1/src/distllm/api/services/__init__.py +2 -0
  80. distributed_llm-0.4.1/src/distllm/api/services/chat_service.py +677 -0
  81. distributed_llm-0.4.1/src/distllm/api/services/completion_service.py +227 -0
  82. distributed_llm-0.4.1/src/distllm/api/services/embedding_service.py +451 -0
  83. distributed_llm-0.4.1/src/distllm/api/services/eval_service.py +198 -0
  84. distributed_llm-0.4.1/src/distllm/api/sso_auth.py +644 -0
  85. distributed_llm-0.4.1/src/distllm/api/sso_middleware.py +808 -0
  86. distributed_llm-0.4.1/src/distllm/api/streaming.py +479 -0
  87. distributed_llm-0.4.1/src/distllm/api/token_estimator.py +86 -0
  88. distributed_llm-0.4.1/src/distllm/api/tool_calling.py +240 -0
  89. distributed_llm-0.4.1/src/distllm/api/tracing_middleware.py +579 -0
  90. distributed_llm-0.4.1/src/distllm/api/validation.py +58 -0
  91. distributed_llm-0.4.1/src/distllm/api/waf.py +344 -0
  92. distributed_llm-0.4.1/src/distllm/api/webhooks/__init__.py +17 -0
  93. distributed_llm-0.4.1/src/distllm/api/webhooks/delivery.py +452 -0
  94. distributed_llm-0.4.1/src/distllm/api/ws_chat.py +495 -0
  95. distributed_llm-0.4.1/src/distllm/backends/__init__.py +121 -0
  96. distributed_llm-0.4.1/src/distllm/backends/config.py +85 -0
  97. distributed_llm-0.4.1/src/distllm/backends/exllama_backend.py +229 -0
  98. distributed_llm-0.4.1/src/distllm/backends/llamacpp_backend.py +266 -0
  99. distributed_llm-0.4.1/src/distllm/backends/mlx_backend.py +199 -0
  100. distributed_llm-0.4.1/src/distllm/backends/nim_backend.py +838 -0
  101. distributed_llm-0.4.1/src/distllm/backends/ollama_backend.py +48 -0
  102. distributed_llm-0.4.1/src/distllm/backends/onnx_backend.py +239 -0
  103. distributed_llm-0.4.1/src/distllm/backends/paged_attention.py +547 -0
  104. distributed_llm-0.4.1/src/distllm/backends/paged_attention_quantized.py +319 -0
  105. distributed_llm-0.4.1/src/distllm/backends/protocol.py +203 -0
  106. distributed_llm-0.4.1/src/distllm/backends/pytorch_backend.py +157 -0
  107. distributed_llm-0.4.1/src/distllm/backends/registry.py +428 -0
  108. distributed_llm-0.4.1/src/distllm/backends/tensorrt_backend.py +333 -0
  109. distributed_llm-0.4.1/src/distllm/backends/tgi_backend.py +120 -0
  110. distributed_llm-0.4.1/src/distllm/backends/triton_backend.py +875 -0
  111. distributed_llm-0.4.1/src/distllm/backends/vllm_backend.py +489 -0
  112. distributed_llm-0.4.1/src/distllm/backends/webgpu_backend.py +255 -0
  113. distributed_llm-0.4.1/src/distllm/benchmarks/__init__.py +10 -0
  114. distributed_llm-0.4.1/src/distllm/benchmarks/evaluation_harness.py +69 -0
  115. distributed_llm-0.4.1/src/distllm/benchmarks/scaling.py +298 -0
  116. distributed_llm-0.4.1/src/distllm/cache/__init__.py +19 -0
  117. distributed_llm-0.4.1/src/distllm/cache/crdt.py +507 -0
  118. distributed_llm-0.4.1/src/distllm/cache/cross_cluster_prefix_index.py +709 -0
  119. distributed_llm-0.4.1/src/distllm/cli/__init__.py +17 -0
  120. distributed_llm-0.4.1/src/distllm/cli/adapters.py +93 -0
  121. distributed_llm-0.4.1/src/distllm/cli/autopsy.py +287 -0
  122. distributed_llm-0.4.1/src/distllm/cli/backup.py +118 -0
  123. distributed_llm-0.4.1/src/distllm/cli/benchmark.py +241 -0
  124. distributed_llm-0.4.1/src/distllm/cli/cert.py +86 -0
  125. distributed_llm-0.4.1/src/distllm/cli/chat.py +79 -0
  126. distributed_llm-0.4.1/src/distllm/cli/chat_stream.py +494 -0
  127. distributed_llm-0.4.1/src/distllm/cli/client.py +233 -0
  128. distributed_llm-0.4.1/src/distllm/cli/cluster.py +405 -0
  129. distributed_llm-0.4.1/src/distllm/cli/completion.py +79 -0
  130. distributed_llm-0.4.1/src/distllm/cli/compress.py +98 -0
  131. distributed_llm-0.4.1/src/distllm/cli/config_commands.py +71 -0
  132. distributed_llm-0.4.1/src/distllm/cli/cost_avoid.py +168 -0
  133. distributed_llm-0.4.1/src/distllm/cli/daas_commands.py +123 -0
  134. distributed_llm-0.4.1/src/distllm/cli/defrag_commands.py +128 -0
  135. distributed_llm-0.4.1/src/distllm/cli/deploy.py +252 -0
  136. distributed_llm-0.4.1/src/distllm/cli/doctor.py +688 -0
  137. distributed_llm-0.4.1/src/distllm/cli/draft_commands.py +82 -0
  138. distributed_llm-0.4.1/src/distllm/cli/error_handler.py +192 -0
  139. distributed_llm-0.4.1/src/distllm/cli/eval.py +168 -0
  140. distributed_llm-0.4.1/src/distllm/cli/federate_commands.py +125 -0
  141. distributed_llm-0.4.1/src/distllm/cli/install.py +198 -0
  142. distributed_llm-0.4.1/src/distllm/cli/logs.py +85 -0
  143. distributed_llm-0.4.1/src/distllm/cli/main.py +1795 -0
  144. distributed_llm-0.4.1/src/distllm/cli/models.py +74 -0
  145. distributed_llm-0.4.1/src/distllm/cli/notify.py +91 -0
  146. distributed_llm-0.4.1/src/distllm/cli/observe.py +314 -0
  147. distributed_llm-0.4.1/src/distllm/cli/onboard.py +671 -0
  148. distributed_llm-0.4.1/src/distllm/cli/output.py +437 -0
  149. distributed_llm-0.4.1/src/distllm/cli/profile.py +152 -0
  150. distributed_llm-0.4.1/src/distllm/cli/profile_presets.py +129 -0
  151. distributed_llm-0.4.1/src/distllm/cli/prompts.py +139 -0
  152. distributed_llm-0.4.1/src/distllm/cli/quota.py +227 -0
  153. distributed_llm-0.4.1/src/distllm/cli/router.py +131 -0
  154. distributed_llm-0.4.1/src/distllm/cli/run.py +59 -0
  155. distributed_llm-0.4.1/src/distllm/cli/setup.py +104 -0
  156. distributed_llm-0.4.1/src/distllm/cli/setup_wizard.py +191 -0
  157. distributed_llm-0.4.1/src/distllm/cli/status.py +65 -0
  158. distributed_llm-0.4.1/src/distllm/cli/system_commands.py +255 -0
  159. distributed_llm-0.4.1/src/distllm/cli/tune.py +488 -0
  160. distributed_llm-0.4.1/src/distllm/cli/tutorial.py +128 -0
  161. distributed_llm-0.4.1/src/distllm/cli/verify.py +37 -0
  162. distributed_llm-0.4.1/src/distllm/cli/webhook.py +85 -0
  163. distributed_llm-0.4.1/src/distllm/client/__init__.py +38 -0
  164. distributed_llm-0.4.1/src/distllm/client/client.py +503 -0
  165. distributed_llm-0.4.1/src/distllm/cloud/__init__.py +53 -0
  166. distributed_llm-0.4.1/src/distllm/cloud/aws.py +199 -0
  167. distributed_llm-0.4.1/src/distllm/cloud/azure.py +179 -0
  168. distributed_llm-0.4.1/src/distllm/cloud/common.py +217 -0
  169. distributed_llm-0.4.1/src/distllm/cloud/gcp.py +238 -0
  170. distributed_llm-0.4.1/src/distllm/cloud/spot_orchestrator.py +1642 -0
  171. distributed_llm-0.4.1/src/distllm/cloud/worker_agent.py +344 -0
  172. distributed_llm-0.4.1/src/distllm/compliance/__init__.py +10 -0
  173. distributed_llm-0.4.1/src/distllm/compliance/evidence_pack.py +699 -0
  174. distributed_llm-0.4.1/src/distllm/config/__init__.py +81 -0
  175. distributed_llm-0.4.1/src/distllm/config/_application.py +41 -0
  176. distributed_llm-0.4.1/src/distllm/config/_backends.py +80 -0
  177. distributed_llm-0.4.1/src/distllm/config/_cache.py +121 -0
  178. distributed_llm-0.4.1/src/distllm/config/_deployment.py +95 -0
  179. distributed_llm-0.4.1/src/distllm/config/_generation.py +36 -0
  180. distributed_llm-0.4.1/src/distllm/config/_hardware.py +42 -0
  181. distributed_llm-0.4.1/src/distllm/config/_model.py +270 -0
  182. distributed_llm-0.4.1/src/distllm/config/_network.py +235 -0
  183. distributed_llm-0.4.1/src/distllm/config/_observability.py +42 -0
  184. distributed_llm-0.4.1/src/distllm/config/_parallelism.py +172 -0
  185. distributed_llm-0.4.1/src/distllm/config/_performance.py +47 -0
  186. distributed_llm-0.4.1/src/distllm/config/loader.py +168 -0
  187. distributed_llm-0.4.1/src/distllm/config/model_heuristics.py +169 -0
  188. distributed_llm-0.4.1/src/distllm/config/profiles.py +168 -0
  189. distributed_llm-0.4.1/src/distllm/config/reference.py +104 -0
  190. distributed_llm-0.4.1/src/distllm/config/resolver.py +240 -0
  191. distributed_llm-0.4.1/src/distllm/config/settings.py +463 -0
  192. distributed_llm-0.4.1/src/distllm/constants.py +117 -0
  193. distributed_llm-0.4.1/src/distllm/core/__init__.py +111 -0
  194. distributed_llm-0.4.1/src/distllm/core/ab_test_coordinator.py +178 -0
  195. distributed_llm-0.4.1/src/distllm/core/activation_profiler.py +172 -0
  196. distributed_llm-0.4.1/src/distllm/core/adaptive_batching.py +234 -0
  197. distributed_llm-0.4.1/src/distllm/core/adaptive_cache_compressor.py +168 -0
  198. distributed_llm-0.4.1/src/distllm/core/adaptive_compression.py +427 -0
  199. distributed_llm-0.4.1/src/distllm/core/adaptive_compression_hierarchy.py +402 -0
  200. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/__init__.py +39 -0
  201. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/cost_aware.py +55 -0
  202. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/disaggregated.py +352 -0
  203. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/energy.py +58 -0
  204. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/federated.py +59 -0
  205. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/heterogeneous.py +84 -0
  206. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/multi_objective.py +372 -0
  207. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/policy.py +95 -0
  208. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/predictive.py +47 -0
  209. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/preemption.py +43 -0
  210. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/tiered_store.py +604 -0
  211. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/token_bank.py +62 -0
  212. distributed_llm-0.4.1/src/distllm/core/advanced_scheduling/wan.py +85 -0
  213. distributed_llm-0.4.1/src/distllm/core/aegis_compliance.py +890 -0
  214. distributed_llm-0.4.1/src/distllm/core/aether_federated.py +1326 -0
  215. distributed_llm-0.4.1/src/distllm/core/agentic_router.py +749 -0
  216. distributed_llm-0.4.1/src/distllm/core/api_key_store.py +478 -0
  217. distributed_llm-0.4.1/src/distllm/core/arbitrage_engine.py +613 -0
  218. distributed_llm-0.4.1/src/distllm/core/aria_autoscaler.py +1339 -0
  219. distributed_llm-0.4.1/src/distllm/core/async_connection_pool.py +187 -0
  220. distributed_llm-0.4.1/src/distllm/core/async_pipelined_speculative.py +543 -0
  221. distributed_llm-0.4.1/src/distllm/core/atlas_mesh.py +1437 -0
  222. distributed_llm-0.4.1/src/distllm/core/auto_discovery.py +351 -0
  223. distributed_llm-0.4.1/src/distllm/core/auto_partitioner.py +396 -0
  224. distributed_llm-0.4.1/src/distllm/core/autonomous_healer.py +466 -0
  225. distributed_llm-0.4.1/src/distllm/core/autoq.py +1545 -0
  226. distributed_llm-0.4.1/src/distllm/core/backup_manager.py +344 -0
  227. distributed_llm-0.4.1/src/distllm/core/bargaining_engine.py +450 -0
  228. distributed_llm-0.4.1/src/distllm/core/batch_builder.py +480 -0
  229. distributed_llm-0.4.1/src/distllm/core/batch_scheduler.py +1342 -0
  230. distributed_llm-0.4.1/src/distllm/core/block_affinity_tracker.py +162 -0
  231. distributed_llm-0.4.1/src/distllm/core/block_eviction_policy.py +363 -0
  232. distributed_llm-0.4.1/src/distllm/core/cache_aware_router.py +116 -0
  233. distributed_llm-0.4.1/src/distllm/core/cache_bench.py +239 -0
  234. distributed_llm-0.4.1/src/distllm/core/cache_coherence.py +139 -0
  235. distributed_llm-0.4.1/src/distllm/core/cache_doctor.py +220 -0
  236. distributed_llm-0.4.1/src/distllm/core/cache_eviction.py +181 -0
  237. distributed_llm-0.4.1/src/distllm/core/cache_index.py +91 -0
  238. distributed_llm-0.4.1/src/distllm/core/cache_manager.py +703 -0
  239. distributed_llm-0.4.1/src/distllm/core/cache_migration.py +134 -0
  240. distributed_llm-0.4.1/src/distllm/core/cache_persistence.py +200 -0
  241. distributed_llm-0.4.1/src/distllm/core/cache_query_log.py +195 -0
  242. distributed_llm-0.4.1/src/distllm/core/cache_snapshot.py +178 -0
  243. distributed_llm-0.4.1/src/distllm/core/cache_template_warmer.py +112 -0
  244. distributed_llm-0.4.1/src/distllm/core/cache_warming.py +188 -0
  245. distributed_llm-0.4.1/src/distllm/core/calibration.py +223 -0
  246. distributed_llm-0.4.1/src/distllm/core/carbon_migration.py +338 -0
  247. distributed_llm-0.4.1/src/distllm/core/cert_rotation.py +402 -0
  248. distributed_llm-0.4.1/src/distllm/core/certificate_manager.py +414 -0
  249. distributed_llm-0.4.1/src/distllm/core/cluster_manager.py +212 -0
  250. distributed_llm-0.4.1/src/distllm/core/cluster_predictive_prefetcher.py +239 -0
  251. distributed_llm-0.4.1/src/distllm/core/cluster_registry.py +227 -0
  252. distributed_llm-0.4.1/src/distllm/core/cluster_state_store.py +442 -0
  253. distributed_llm-0.4.1/src/distllm/core/compliance_evidence.py +503 -0
  254. distributed_llm-0.4.1/src/distllm/core/compressed_speculative.py +399 -0
  255. distributed_llm-0.4.1/src/distllm/core/connection_pool.py +387 -0
  256. distributed_llm-0.4.1/src/distllm/core/constrained_decoder.py +678 -0
  257. distributed_llm-0.4.1/src/distllm/core/coordinator.py +1594 -0
  258. distributed_llm-0.4.1/src/distllm/core/coordinator_cli.py +130 -0
  259. distributed_llm-0.4.1/src/distllm/core/coordinator_config.py +203 -0
  260. distributed_llm-0.4.1/src/distllm/core/coordinator_config_wiring.py +316 -0
  261. distributed_llm-0.4.1/src/distllm/core/coordinator_election.py +246 -0
  262. distributed_llm-0.4.1/src/distllm/core/coordinator_failover.py +197 -0
  263. distributed_llm-0.4.1/src/distllm/core/coordinator_health.py +135 -0
  264. distributed_llm-0.4.1/src/distllm/core/coordinator_lifecycle.py +272 -0
  265. distributed_llm-0.4.1/src/distllm/core/coordinator_metrics.py +155 -0
  266. distributed_llm-0.4.1/src/distllm/core/coordinator_multi_model.py +41 -0
  267. distributed_llm-0.4.1/src/distllm/core/coordinator_request.py +246 -0
  268. distributed_llm-0.4.1/src/distllm/core/coordinator_state.py +215 -0
  269. distributed_llm-0.4.1/src/distllm/core/coordinator_subsystem.py +614 -0
  270. distributed_llm-0.4.1/src/distllm/core/correctness_cert.py +133 -0
  271. distributed_llm-0.4.1/src/distllm/core/correctness_harness.py +421 -0
  272. distributed_llm-0.4.1/src/distllm/core/cortex_multimodel.py +939 -0
  273. distributed_llm-0.4.1/src/distllm/core/cost_comparison.py +250 -0
  274. distributed_llm-0.4.1/src/distllm/core/cost_dashboard.py +363 -0
  275. distributed_llm-0.4.1/src/distllm/core/cost_optimizer.py +317 -0
  276. distributed_llm-0.4.1/src/distllm/core/cost_tracker.py +569 -0
  277. distributed_llm-0.4.1/src/distllm/core/cross_cloud_router.py +924 -0
  278. distributed_llm-0.4.1/src/distllm/core/cross_model_prefix_sharing.py +237 -0
  279. distributed_llm-0.4.1/src/distllm/core/cuda_graph.py +165 -0
  280. distributed_llm-0.4.1/src/distllm/core/debug.py +84 -0
  281. distributed_llm-0.4.1/src/distllm/core/device_registry.py +289 -0
  282. distributed_llm-0.4.1/src/distllm/core/di.py +153 -0
  283. distributed_llm-0.4.1/src/distllm/core/differential_privacy.py +183 -0
  284. distributed_llm-0.4.1/src/distllm/core/distributed_distillation.py +402 -0
  285. distributed_llm-0.4.1/src/distllm/core/distributed_speculative.py +1563 -0
  286. distributed_llm-0.4.1/src/distllm/core/dp_inference/__init__.py +657 -0
  287. distributed_llm-0.4.1/src/distllm/core/dp_inference/accounting.py +144 -0
  288. distributed_llm-0.4.1/src/distllm/core/dp_inference/config.py +139 -0
  289. distributed_llm-0.4.1/src/distllm/core/dp_inference/mechanisms.py +137 -0
  290. distributed_llm-0.4.1/src/distllm/core/dp_inference.py +1016 -0
  291. distributed_llm-0.4.1/src/distllm/core/draft_model_router.py +435 -0
  292. distributed_llm-0.4.1/src/distllm/core/draft_quality_scorer.py +157 -0
  293. distributed_llm-0.4.1/src/distllm/core/draft_tree.py +232 -0
  294. distributed_llm-0.4.1/src/distllm/core/dynamic_memory_budget.py +179 -0
  295. distributed_llm-0.4.1/src/distllm/core/dynamic_sharder.py +364 -0
  296. distributed_llm-0.4.1/src/distllm/core/dynamic_speculation.py +131 -0
  297. distributed_llm-0.4.1/src/distllm/core/evaluation/__init__.py +57 -0
  298. distributed_llm-0.4.1/src/distllm/core/evaluation/constants.py +86 -0
  299. distributed_llm-0.4.1/src/distllm/core/evaluation/db.py +185 -0
  300. distributed_llm-0.4.1/src/distllm/core/evaluation/formatters.py +82 -0
  301. distributed_llm-0.4.1/src/distllm/core/evaluation/loaders.py +320 -0
  302. distributed_llm-0.4.1/src/distllm/core/evaluation/models.py +66 -0
  303. distributed_llm-0.4.1/src/distllm/core/evaluation/report.py +79 -0
  304. distributed_llm-0.4.1/src/distllm/core/evaluation/runner.py +518 -0
  305. distributed_llm-0.4.1/src/distllm/core/evaluation/scorers.py +278 -0
  306. distributed_llm-0.4.1/src/distllm/core/evaluation/worker.py +123 -0
  307. distributed_llm-0.4.1/src/distllm/core/evaluation_harness.py +1530 -0
  308. distributed_llm-0.4.1/src/distllm/core/event_bus.py +516 -0
  309. distributed_llm-0.4.1/src/distllm/core/faas_7b.py +201 -0
  310. distributed_llm-0.4.1/src/distllm/core/feature_flags.py +245 -0
  311. distributed_llm-0.4.1/src/distllm/core/federated_finetuner.py +377 -0
  312. distributed_llm-0.4.1/src/distllm/core/federated_incentives.py +267 -0
  313. distributed_llm-0.4.1/src/distllm/core/framework_adapters.py +390 -0
  314. distributed_llm-0.4.1/src/distllm/core/gaia_cache.py +1330 -0
  315. distributed_llm-0.4.1/src/distllm/core/gossip_cache_bridge.py +202 -0
  316. distributed_llm-0.4.1/src/distllm/core/gpu_power_manager.py +173 -0
  317. distributed_llm-0.4.1/src/distllm/core/gpu_profiler.py +59 -0
  318. distributed_llm-0.4.1/src/distllm/core/gpu_resource_manager.py +338 -0
  319. distributed_llm-0.4.1/src/distllm/core/graceful_degradation.py +264 -0
  320. distributed_llm-0.4.1/src/distllm/core/grammar_constrained.py +549 -0
  321. distributed_llm-0.4.1/src/distllm/core/grammar_constrained_draft.py +91 -0
  322. distributed_llm-0.4.1/src/distllm/core/grammar_decoder.py +285 -0
  323. distributed_llm-0.4.1/src/distllm/core/ha_coordinator.py +452 -0
  324. distributed_llm-0.4.1/src/distllm/core/hardware_plugin_registry.py +126 -0
  325. distributed_llm-0.4.1/src/distllm/core/hashing.py +29 -0
  326. distributed_llm-0.4.1/src/distllm/core/health_manager.py +320 -0
  327. distributed_llm-0.4.1/src/distllm/core/heterogeneous_scheduler.py +663 -0
  328. distributed_llm-0.4.1/src/distllm/core/hibernation_manager.py +250 -0
  329. distributed_llm-0.4.1/src/distllm/core/hierarchical_digest.py +168 -0
  330. distributed_llm-0.4.1/src/distllm/core/hybrid_cache.py +253 -0
  331. distributed_llm-0.4.1/src/distllm/core/hydra_diffusion.py +177 -0
  332. distributed_llm-0.4.1/src/distllm/core/inference_engine.py +1072 -0
  333. distributed_llm-0.4.1/src/distllm/core/intelligent_autoscaler.py +219 -0
  334. distributed_llm-0.4.1/src/distllm/core/kraken_chaos.py +1407 -0
  335. distributed_llm-0.4.1/src/distllm/core/kv_backup.py +217 -0
  336. distributed_llm-0.4.1/src/distllm/core/kv_cache.py +1271 -0
  337. distributed_llm-0.4.1/src/distllm/core/kv_cache_adaptive_quantizer.py +168 -0
  338. distributed_llm-0.4.1/src/distllm/core/kv_cache_compressor.py +290 -0
  339. distributed_llm-0.4.1/src/distllm/core/kv_cache_manager.py +142 -0
  340. distributed_llm-0.4.1/src/distllm/core/kv_cache_marketplace.py +319 -0
  341. distributed_llm-0.4.1/src/distllm/core/kv_cache_metrics.py +205 -0
  342. distributed_llm-0.4.1/src/distllm/core/kv_cache_migration.py +137 -0
  343. distributed_llm-0.4.1/src/distllm/core/kv_cache_paged.py +78 -0
  344. distributed_llm-0.4.1/src/distllm/core/kv_cache_replication.py +107 -0
  345. distributed_llm-0.4.1/src/distllm/core/kv_cache_serialization.py +182 -0
  346. distributed_llm-0.4.1/src/distllm/core/latency_tracker.py +17 -0
  347. distributed_llm-0.4.1/src/distllm/core/leaky_bucket_limiter.py +194 -0
  348. distributed_llm-0.4.1/src/distllm/core/learning_router.py +652 -0
  349. distributed_llm-0.4.1/src/distllm/core/llamacpp_backend.py +23 -0
  350. distributed_llm-0.4.1/src/distllm/core/load_balancer.py +286 -0
  351. distributed_llm-0.4.1/src/distllm/core/media_pipeline.py +387 -0
  352. distributed_llm-0.4.1/src/distllm/core/memory_defragmenter.py +666 -0
  353. distributed_llm-0.4.1/src/distllm/core/metering.py +449 -0
  354. distributed_llm-0.4.1/src/distllm/core/metrics_collector.py +39 -0
  355. distributed_llm-0.4.1/src/distllm/core/micro_batch_scheduler.py +170 -0
  356. distributed_llm-0.4.1/src/distllm/core/model_hub_enhanced.py +382 -0
  357. distributed_llm-0.4.1/src/distllm/core/model_registry.py +9 -0
  358. distributed_llm-0.4.1/src/distllm/core/model_router.py +930 -0
  359. distributed_llm-0.4.1/src/distllm/core/model_selector.py +245 -0
  360. distributed_llm-0.4.1/src/distllm/core/model_sizing.py +334 -0
  361. distributed_llm-0.4.1/src/distllm/core/model_version_manager.py +414 -0
  362. distributed_llm-0.4.1/src/distllm/core/moe_orchestrator.py +205 -0
  363. distributed_llm-0.4.1/src/distllm/core/money.py +53 -0
  364. distributed_llm-0.4.1/src/distllm/core/monitor.py +141 -0
  365. distributed_llm-0.4.1/src/distllm/core/mtp_head.py +444 -0
  366. distributed_llm-0.4.1/src/distllm/core/multi_draft_verifier.py +346 -0
  367. distributed_llm-0.4.1/src/distllm/core/multi_model_serving.py +624 -0
  368. distributed_llm-0.4.1/src/distllm/core/multimodal_engine.py +194 -0
  369. distributed_llm-0.4.1/src/distllm/core/neural_partition_optimizer.py +1398 -0
  370. distributed_llm-0.4.1/src/distllm/core/node_recovery.py +27 -0
  371. distributed_llm-0.4.1/src/distllm/core/notification_manager.py +317 -0
  372. distributed_llm-0.4.1/src/distllm/core/param_update_channel.py +104 -0
  373. distributed_llm-0.4.1/src/distllm/core/pareto_optimizer.py +227 -0
  374. distributed_llm-0.4.1/src/distllm/core/performance_alerts.py +198 -0
  375. distributed_llm-0.4.1/src/distllm/core/performance_baseline.py +252 -0
  376. distributed_llm-0.4.1/src/distllm/core/persistence.py +947 -0
  377. distributed_llm-0.4.1/src/distllm/core/persistent_store.py +485 -0
  378. distributed_llm-0.4.1/src/distllm/core/pipeline_composer.py +211 -0
  379. distributed_llm-0.4.1/src/distllm/core/pipeline_executor.py +500 -0
  380. distributed_llm-0.4.1/src/distllm/core/pipeline_orchestrator.py +17 -0
  381. distributed_llm-0.4.1/src/distllm/core/pipeline_overlap.py +177 -0
  382. distributed_llm-0.4.1/src/distllm/core/placement.py +442 -0
  383. distributed_llm-0.4.1/src/distllm/core/plugin_marketplace.py +483 -0
  384. distributed_llm-0.4.1/src/distllm/core/plugin_sandbox.py +751 -0
  385. distributed_llm-0.4.1/src/distllm/core/plugin_system.py +601 -0
  386. distributed_llm-0.4.1/src/distllm/core/plugins/__init__.py +26 -0
  387. distributed_llm-0.4.1/src/distllm/core/plugins/sandbox.py +38 -0
  388. distributed_llm-0.4.1/src/distllm/core/predictive_cache.py +29 -0
  389. distributed_llm-0.4.1/src/distllm/core/predictive_cache_warming.py +323 -0
  390. distributed_llm-0.4.1/src/distllm/core/predictive_failure.py +163 -0
  391. distributed_llm-0.4.1/src/distllm/core/preemptible_scheduler.py +343 -0
  392. distributed_llm-0.4.1/src/distllm/core/preference_learning.py +606 -0
  393. distributed_llm-0.4.1/src/distllm/core/prefix_cache.py +17 -0
  394. distributed_llm-0.4.1/src/distllm/core/pricing_providers.py +576 -0
  395. distributed_llm-0.4.1/src/distllm/core/priority_heap.py +62 -0
  396. distributed_llm-0.4.1/src/distllm/core/privacy_budget.py +177 -0
  397. distributed_llm-0.4.1/src/distllm/core/prompt_caching_service.py +228 -0
  398. distributed_llm-0.4.1/src/distllm/core/prompt_library.py +838 -0
  399. distributed_llm-0.4.1/src/distllm/core/protocols.py +213 -0
  400. distributed_llm-0.4.1/src/distllm/core/provider_health.py +234 -0
  401. distributed_llm-0.4.1/src/distllm/core/provisioning.py +329 -0
  402. distributed_llm-0.4.1/src/distllm/core/pulse_performance_model.py +1558 -0
  403. distributed_llm-0.4.1/src/distllm/core/quantization_selector.py +210 -0
  404. distributed_llm-0.4.1/src/distllm/core/radix_tree_cache.py +306 -0
  405. distributed_llm-0.4.1/src/distllm/core/rebalancer.py +25 -0
  406. distributed_llm-0.4.1/src/distllm/core/redis_prompt_cache.py +311 -0
  407. distributed_llm-0.4.1/src/distllm/core/replication_controller.py +128 -0
  408. distributed_llm-0.4.1/src/distllm/core/request_auditor.py +215 -0
  409. distributed_llm-0.4.1/src/distllm/core/request_fingerprinting.py +231 -0
  410. distributed_llm-0.4.1/src/distllm/core/request_latency.py +211 -0
  411. distributed_llm-0.4.1/src/distllm/core/request_pipeline.py +810 -0
  412. distributed_llm-0.4.1/src/distllm/core/request_replay.py +253 -0
  413. distributed_llm-0.4.1/src/distllm/core/request_tracker.py +184 -0
  414. distributed_llm-0.4.1/src/distllm/core/resource_manager.py +657 -0
  415. distributed_llm-0.4.1/src/distllm/core/route_audit.py +175 -0
  416. distributed_llm-0.4.1/src/distllm/core/routing_extensions.py +604 -0
  417. distributed_llm-0.4.1/src/distllm/core/schedule_simulator.py +289 -0
  418. distributed_llm-0.4.1/src/distllm/core/schedule_viz.py +233 -0
  419. distributed_llm-0.4.1/src/distllm/core/scheduler/__init__.py +34 -0
  420. distributed_llm-0.4.1/src/distllm/core/scheduler/budget.py +25 -0
  421. distributed_llm-0.4.1/src/distllm/core/scheduler/budget_computer.py +322 -0
  422. distributed_llm-0.4.1/src/distllm/core/scheduler/chunked_prefill.py +52 -0
  423. distributed_llm-0.4.1/src/distllm/core/scheduler/kv_cache_manager.py +313 -0
  424. distributed_llm-0.4.1/src/distllm/core/scheduler/preemption_manager.py +251 -0
  425. distributed_llm-0.4.1/src/distllm/core/scheduler/pressure.py +48 -0
  426. distributed_llm-0.4.1/src/distllm/core/scheduler/sequence.py +179 -0
  427. distributed_llm-0.4.1/src/distllm/core/secret_manager.py +315 -0
  428. distributed_llm-0.4.1/src/distllm/core/semantic_cache.py +369 -0
  429. distributed_llm-0.4.1/src/distllm/core/sentinel_qos.py +833 -0
  430. distributed_llm-0.4.1/src/distllm/core/shadow_eval_runner.py +194 -0
  431. distributed_llm-0.4.1/src/distllm/core/shared_layer_pool.py +279 -0
  432. distributed_llm-0.4.1/src/distllm/core/smart_model_router.py +309 -0
  433. distributed_llm-0.4.1/src/distllm/core/spec_equivalence.py +140 -0
  434. distributed_llm-0.4.1/src/distllm/core/spec_verify.py +225 -0
  435. distributed_llm-0.4.1/src/distllm/core/speculative_adaptor.py +108 -0
  436. distributed_llm-0.4.1/src/distllm/core/speculative_dashboard.py +134 -0
  437. distributed_llm-0.4.1/src/distllm/core/speculative_decoder.py +1286 -0
  438. distributed_llm-0.4.1/src/distllm/core/speculative_profiler.py +132 -0
  439. distributed_llm-0.4.1/src/distllm/core/split_brain.py +236 -0
  440. distributed_llm-0.4.1/src/distllm/core/spot_failover.py +292 -0
  441. distributed_llm-0.4.1/src/distllm/core/spot_forecasting.py +463 -0
  442. distributed_llm-0.4.1/src/distllm/core/starvation_monitor.py +70 -0
  443. distributed_llm-0.4.1/src/distllm/core/state_replication.py +261 -0
  444. distributed_llm-0.4.1/src/distllm/core/stats_collector.py +64 -0
  445. distributed_llm-0.4.1/src/distllm/core/step_processor.py +115 -0
  446. distributed_llm-0.4.1/src/distllm/core/straggler_alerts.py +174 -0
  447. distributed_llm-0.4.1/src/distllm/core/straggler_aware_scheduler.py +255 -0
  448. distributed_llm-0.4.1/src/distllm/core/straggler_detector.py +29 -0
  449. distributed_llm-0.4.1/src/distllm/core/streaming_cost.py +286 -0
  450. distributed_llm-0.4.1/src/distllm/core/streaming_generator.py +228 -0
  451. distributed_llm-0.4.1/src/distllm/core/structured_output/__init__.py +348 -0
  452. distributed_llm-0.4.1/src/distllm/core/structured_output/config.py +38 -0
  453. distributed_llm-0.4.1/src/distllm/core/structured_output/engine.py +367 -0
  454. distributed_llm-0.4.1/src/distllm/core/structured_output/streaming.py +183 -0
  455. distributed_llm-0.4.1/src/distllm/core/structured_output/validator.py +199 -0
  456. distributed_llm-0.4.1/src/distllm/core/subsystem_registry.py +171 -0
  457. distributed_llm-0.4.1/src/distllm/core/synapse_debugger.py +226 -0
  458. distributed_llm-0.4.1/src/distllm/core/synth_data_generator.py +122 -0
  459. distributed_llm-0.4.1/src/distllm/core/telemetry.py +240 -0
  460. distributed_llm-0.4.1/src/distllm/core/tenant_billing.py +446 -0
  461. distributed_llm-0.4.1/src/distllm/core/tenant_cost_attribution.py +314 -0
  462. distributed_llm-0.4.1/src/distllm/core/token_generator.py +368 -0
  463. distributed_llm-0.4.1/src/distllm/core/token_streaming_buffer.py +147 -0
  464. distributed_llm-0.4.1/src/distllm/core/topology_aware_lb.py +324 -0
  465. distributed_llm-0.4.1/src/distllm/core/topology_aware_tiering.py +344 -0
  466. distributed_llm-0.4.1/src/distllm/core/tree_speculative_decoder.py +405 -0
  467. distributed_llm-0.4.1/src/distllm/core/types.py +17 -0
  468. distributed_llm-0.4.1/src/distllm/core/unified_router.py +439 -0
  469. distributed_llm-0.4.1/src/distllm/core/unified_sla_router.py +242 -0
  470. distributed_llm-0.4.1/src/distllm/core/usage_meter.py +915 -0
  471. distributed_llm-0.4.1/src/distllm/core/vectorstore/__init__.py +30 -0
  472. distributed_llm-0.4.1/src/distllm/core/vectorstore/base.py +106 -0
  473. distributed_llm-0.4.1/src/distllm/core/vectorstore/chroma_store.py +99 -0
  474. distributed_llm-0.4.1/src/distllm/core/vectorstore/factory.py +97 -0
  475. distributed_llm-0.4.1/src/distllm/core/vectorstore/pgvector_store.py +123 -0
  476. distributed_llm-0.4.1/src/distllm/core/vectorstore/providers/__init__.py +7 -0
  477. distributed_llm-0.4.1/src/distllm/core/vectorstore/providers/milvus.py +219 -0
  478. distributed_llm-0.4.1/src/distllm/core/vectorstore/providers/pinecone.py +142 -0
  479. distributed_llm-0.4.1/src/distllm/core/vectorstore/providers/qdrant.py +176 -0
  480. distributed_llm-0.4.1/src/distllm/core/vectorstore/providers/weaviate.py +185 -0
  481. distributed_llm-0.4.1/src/distllm/core/vectorstore/qdrant_store.py +148 -0
  482. distributed_llm-0.4.1/src/distllm/core/vectorstore/rag.py +151 -0
  483. distributed_llm-0.4.1/src/distllm/core/vllm_backend.py +21 -0
  484. distributed_llm-0.4.1/src/distllm/core/vllm_node.py +174 -0
  485. distributed_llm-0.4.1/src/distllm/core/voyager_multimodal.py +1354 -0
  486. distributed_llm-0.4.1/src/distllm/core/webgpu_manager.py +382 -0
  487. distributed_llm-0.4.1/src/distllm/core/webhook_formatters.py +243 -0
  488. distributed_llm-0.4.1/src/distllm/core/webhook_manager.py +433 -0
  489. distributed_llm-0.4.1/src/distllm/core/wisp_wasm.py +934 -0
  490. distributed_llm-0.4.1/src/distllm/core/workload_classifier.py +137 -0
  491. distributed_llm-0.4.1/src/distllm/dashboard/__init__.py +17 -0
  492. distributed_llm-0.4.1/src/distllm/dashboard/verification_history.py +192 -0
  493. distributed_llm-0.4.1/src/distllm/dashboard/ws_handler.py +586 -0
  494. distributed_llm-0.4.1/src/distllm/dist/__init__.py +85 -0
  495. distributed_llm-0.4.1/src/distllm/dist/__init__.pyi +132 -0
  496. distributed_llm-0.4.1/src/distllm/dist/adaptive_speculator.py +384 -0
  497. distributed_llm-0.4.1/src/distllm/dist/admin_cli.py +293 -0
  498. distributed_llm-0.4.1/src/distllm/dist/api_docs.py +594 -0
  499. distributed_llm-0.4.1/src/distllm/dist/async_pipeline.py +578 -0
  500. distributed_llm-0.4.1/src/distllm/dist/attention.py +1699 -0
  501. distributed_llm-0.4.1/src/distllm/dist/attention_block_pool.py +634 -0
  502. distributed_llm-0.4.1/src/distllm/dist/attention_distributed.py +138 -0
  503. distributed_llm-0.4.1/src/distllm/dist/autoscaler.py +196 -0
  504. distributed_llm-0.4.1/src/distllm/dist/backends/__init__.py +29 -0
  505. distributed_llm-0.4.1/src/distllm/dist/backends/backend_profiles.py +357 -0
  506. distributed_llm-0.4.1/src/distllm/dist/backends/graceful_degradation.py +409 -0
  507. distributed_llm-0.4.1/src/distllm/dist/backends/health_monitor.py +518 -0
  508. distributed_llm-0.4.1/src/distllm/dist/backends/llamacpp.py +125 -0
  509. distributed_llm-0.4.1/src/distllm/dist/backends/ray.py +89 -0
  510. distributed_llm-0.4.1/src/distllm/dist/backends/vllm.py +177 -0
  511. distributed_llm-0.4.1/src/distllm/dist/block_pool.py +662 -0
  512. distributed_llm-0.4.1/src/distllm/dist/block_transfer_service.py +267 -0
  513. distributed_llm-0.4.1/src/distllm/dist/byzantine.py +2193 -0
  514. distributed_llm-0.4.1/src/distllm/dist/cache.py +305 -0
  515. distributed_llm-0.4.1/src/distllm/dist/cache_digest.py +405 -0
  516. distributed_llm-0.4.1/src/distllm/dist/chaos/__init__.py +52 -0
  517. distributed_llm-0.4.1/src/distllm/dist/chaos/chaos_orchestrator.py +229 -0
  518. distributed_llm-0.4.1/src/distllm/dist/chaos/fault_injector.py +1273 -0
  519. distributed_llm-0.4.1/src/distllm/dist/chunked_prefill.py +136 -0
  520. distributed_llm-0.4.1/src/distllm/dist/cloud_selector.py +257 -0
  521. distributed_llm-0.4.1/src/distllm/dist/config.py +70 -0
  522. distributed_llm-0.4.1/src/distllm/dist/cross_cluster.py +231 -0
  523. distributed_llm-0.4.1/src/distllm/dist/daas/__init__.py +46 -0
  524. distributed_llm-0.4.1/src/distllm/dist/daas/load_balancer.py +275 -0
  525. distributed_llm-0.4.1/src/distllm/dist/daas/marketplace_integration.py +374 -0
  526. distributed_llm-0.4.1/src/distllm/dist/daas/resource_isolation.py +280 -0
  527. distributed_llm-0.4.1/src/distllm/dist/daas/tenant_dispatcher.py +252 -0
  528. distributed_llm-0.4.1/src/distllm/dist/daas/usage_meter.py +360 -0
  529. distributed_llm-0.4.1/src/distllm/dist/daas_server.py +514 -0
  530. distributed_llm-0.4.1/src/distllm/dist/disagg/__init__.py +162 -0
  531. distributed_llm-0.4.1/src/distllm/dist/disagg/pool.py +214 -0
  532. distributed_llm-0.4.1/src/distllm/dist/disagg/transfer.py +77 -0
  533. distributed_llm-0.4.1/src/distllm/dist/disagg/transfer_compression.py +793 -0
  534. distributed_llm-0.4.1/src/distllm/dist/disagg/transfer_engine.py +998 -0
  535. distributed_llm-0.4.1/src/distllm/dist/discovery.py +166 -0
  536. distributed_llm-0.4.1/src/distllm/dist/draft_bank.py +344 -0
  537. distributed_llm-0.4.1/src/distllm/dist/draft_migration.py +382 -0
  538. distributed_llm-0.4.1/src/distllm/dist/ebpf_transport.py +364 -0
  539. distributed_llm-0.4.1/src/distllm/dist/edge_cloud.py +544 -0
  540. distributed_llm-0.4.1/src/distllm/dist/edge_federation.py +426 -0
  541. distributed_llm-0.4.1/src/distllm/dist/execution_planner.py +148 -0
  542. distributed_llm-0.4.1/src/distllm/dist/federated_merge.py +560 -0
  543. distributed_llm-0.4.1/src/distllm/dist/federation.py +1114 -0
  544. distributed_llm-0.4.1/src/distllm/dist/flash_attention.py +237 -0
  545. distributed_llm-0.4.1/src/distllm/dist/fsdp.py +295 -0
  546. distributed_llm-0.4.1/src/distllm/dist/geo.py +361 -0
  547. distributed_llm-0.4.1/src/distllm/dist/ice_transport.py +2968 -0
  548. distributed_llm-0.4.1/src/distllm/dist/kv_migration.py +237 -0
  549. distributed_llm-0.4.1/src/distllm/dist/latency.py +60 -0
  550. distributed_llm-0.4.1/src/distllm/dist/lifecycle.py +467 -0
  551. distributed_llm-0.4.1/src/distllm/dist/marketplace.py +891 -0
  552. distributed_llm-0.4.1/src/distllm/dist/merkle.py +178 -0
  553. distributed_llm-0.4.1/src/distllm/dist/metrics.py +456 -0
  554. distributed_llm-0.4.1/src/distllm/dist/model_store.py +107 -0
  555. distributed_llm-0.4.1/src/distllm/dist/multi_tenant.py +339 -0
  556. distributed_llm-0.4.1/src/distllm/dist/multimodal.py +392 -0
  557. distributed_llm-0.4.1/src/distllm/dist/nat.py +934 -0
  558. distributed_llm-0.4.1/src/distllm/dist/nccl.py +733 -0
  559. distributed_llm-0.4.1/src/distllm/dist/network.py +126 -0
  560. distributed_llm-0.4.1/src/distllm/dist/node_client.py +568 -0
  561. distributed_llm-0.4.1/src/distllm/dist/node_pb2.py +66 -0
  562. distributed_llm-0.4.1/src/distllm/dist/node_pb2.pyi +236 -0
  563. distributed_llm-0.4.1/src/distllm/dist/node_pb2_grpc.py +312 -0
  564. distributed_llm-0.4.1/src/distllm/dist/node_pb2_grpc.pyi +41 -0
  565. distributed_llm-0.4.1/src/distllm/dist/node_registrar.py +247 -0
  566. distributed_llm-0.4.1/src/distllm/dist/node_service.py +572 -0
  567. distributed_llm-0.4.1/src/distllm/dist/observability.py +258 -0
  568. distributed_llm-0.4.1/src/distllm/dist/otel.py +158 -0
  569. distributed_llm-0.4.1/src/distllm/dist/p2p/__init__.py +22 -0
  570. distributed_llm-0.4.1/src/distllm/dist/p2p/discovery.py +132 -0
  571. distributed_llm-0.4.1/src/distllm/dist/p2p/gossip.py +1339 -0
  572. distributed_llm-0.4.1/src/distllm/dist/p2p/kademlia_dht.py +1058 -0
  573. distributed_llm-0.4.1/src/distllm/dist/p2p/load_balancer.py +131 -0
  574. distributed_llm-0.4.1/src/distllm/dist/p2p/quic_transport.py +700 -0
  575. distributed_llm-0.4.1/src/distllm/dist/p2p/router.py +607 -0
  576. distributed_llm-0.4.1/src/distllm/dist/p2p/transport.py +399 -0
  577. distributed_llm-0.4.1/src/distllm/dist/p2p_model_distributor.py +160 -0
  578. distributed_llm-0.4.1/src/distllm/dist/paged_attention_kernel.py +281 -0
  579. distributed_llm-0.4.1/src/distllm/dist/parallel.py +1061 -0
  580. distributed_llm-0.4.1/src/distllm/dist/parallel_planner.py +586 -0
  581. distributed_llm-0.4.1/src/distllm/dist/parallel_topology.py +231 -0
  582. distributed_llm-0.4.1/src/distllm/dist/partition/__init__.py +146 -0
  583. distributed_llm-0.4.1/src/distllm/dist/partition/adaptive.py +532 -0
  584. distributed_llm-0.4.1/src/distllm/dist/partition/benchmark_suite.py +479 -0
  585. distributed_llm-0.4.1/src/distllm/dist/partition/cli.py +189 -0
  586. distributed_llm-0.4.1/src/distllm/dist/partition/cloud_arbitrage.py +523 -0
  587. distributed_llm-0.4.1/src/distllm/dist/partition/config.py +97 -0
  588. distributed_llm-0.4.1/src/distllm/dist/partition/cost_model.py +553 -0
  589. distributed_llm-0.4.1/src/distllm/dist/partition/learned_cost.py +653 -0
  590. distributed_llm-0.4.1/src/distllm/dist/partition/mixed_precision_tuner.py +310 -0
  591. distributed_llm-0.4.1/src/distllm/dist/partition/network_cost_model.py +664 -0
  592. distributed_llm-0.4.1/src/distllm/dist/partition/optimizer.py +650 -0
  593. distributed_llm-0.4.1/src/distllm/dist/partition/pareto_optimizer.py +466 -0
  594. distributed_llm-0.4.1/src/distllm/dist/partition/partitioner.py +363 -0
  595. distributed_llm-0.4.1/src/distllm/dist/partition/persistence.py +392 -0
  596. distributed_llm-0.4.1/src/distllm/dist/partition/plugins.py +270 -0
  597. distributed_llm-0.4.1/src/distllm/dist/partition/profiles.py +659 -0
  598. distributed_llm-0.4.1/src/distllm/dist/partition/quant_bench.py +373 -0
  599. distributed_llm-0.4.1/src/distllm/dist/partition/quant_calibrate.py +229 -0
  600. distributed_llm-0.4.1/src/distllm/dist/partition/quant_coordinator.py +260 -0
  601. distributed_llm-0.4.1/src/distllm/dist/partition/quant_cost.py +293 -0
  602. distributed_llm-0.4.1/src/distllm/dist/partition/quant_partition.py +432 -0
  603. distributed_llm-0.4.1/src/distllm/dist/partition/quant_report.py +301 -0
  604. distributed_llm-0.4.1/src/distllm/dist/partition/quantization_metrics.py +355 -0
  605. distributed_llm-0.4.1/src/distllm/dist/partition/quantization_search.py +290 -0
  606. distributed_llm-0.4.1/src/distllm/dist/partition/quantization_tuner.py +1383 -0
  607. distributed_llm-0.4.1/src/distllm/dist/partition/topology.py +218 -0
  608. distributed_llm-0.4.1/src/distllm/dist/partition/validator.py +405 -0
  609. distributed_llm-0.4.1/src/distllm/dist/partition/visualizer.py +275 -0
  610. distributed_llm-0.4.1/src/distllm/dist/pipeline/__init__.py +71 -0
  611. distributed_llm-0.4.1/src/distllm/dist/pipeline/bandwidth_controller.py +780 -0
  612. distributed_llm-0.4.1/src/distllm/dist/pipeline/compression_negotiation.py +771 -0
  613. distributed_llm-0.4.1/src/distllm/dist/pipeline/context.py +80 -0
  614. distributed_llm-0.4.1/src/distllm/dist/pipeline/continuous_batching.py +435 -0
  615. distributed_llm-0.4.1/src/distllm/dist/pipeline/disagg_orchestrator.py +284 -0
  616. distributed_llm-0.4.1/src/distllm/dist/pipeline/orchestrator.py +727 -0
  617. distributed_llm-0.4.1/src/distllm/dist/pipeline/pipeline_reconfig.py +1395 -0
  618. distributed_llm-0.4.1/src/distllm/dist/pipeline/profiler.py +84 -0
  619. distributed_llm-0.4.1/src/distllm/dist/pipeline/serialization.py +176 -0
  620. distributed_llm-0.4.1/src/distllm/dist/pipeline/simulator.py +172 -0
  621. distributed_llm-0.4.1/src/distllm/dist/pipeline/strategy.py +193 -0
  622. distributed_llm-0.4.1/src/distllm/dist/pipeline/token_accumulator.py +211 -0
  623. distributed_llm-0.4.1/src/distllm/dist/pipeline/transport.py +230 -0
  624. distributed_llm-0.4.1/src/distllm/dist/pipeline/wan_disagg_orchestrator.py +564 -0
  625. distributed_llm-0.4.1/src/distllm/dist/power_cap.py +358 -0
  626. distributed_llm-0.4.1/src/distllm/dist/predictive_cache.py +399 -0
  627. distributed_llm-0.4.1/src/distllm/dist/preemption.py +198 -0
  628. distributed_llm-0.4.1/src/distllm/dist/prefix_cache.py +461 -0
  629. distributed_llm-0.4.1/src/distllm/dist/prefix_clustering.py +305 -0
  630. distributed_llm-0.4.1/src/distllm/dist/privacy/__init__.py +411 -0
  631. distributed_llm-0.4.1/src/distllm/dist/privacy/privacy_accountant.py +344 -0
  632. distributed_llm-0.4.1/src/distllm/dist/privacy.py +240 -0
  633. distributed_llm-0.4.1/src/distllm/dist/provisioning.py +338 -0
  634. distributed_llm-0.4.1/src/distllm/dist/quality.py +118 -0
  635. distributed_llm-0.4.1/src/distllm/dist/quic_transport.py +335 -0
  636. distributed_llm-0.4.1/src/distllm/dist/quota_enforcer.py +265 -0
  637. distributed_llm-0.4.1/src/distllm/dist/rebalancer.py +234 -0
  638. distributed_llm-0.4.1/src/distllm/dist/recovery.py +827 -0
  639. distributed_llm-0.4.1/src/distllm/dist/recovery_drill.py +281 -0
  640. distributed_llm-0.4.1/src/distllm/dist/redis_cache.py +265 -0
  641. distributed_llm-0.4.1/src/distllm/dist/redundant.py +308 -0
  642. distributed_llm-0.4.1/src/distllm/dist/redundant_executor.py +1536 -0
  643. distributed_llm-0.4.1/src/distllm/dist/reputation.py +231 -0
  644. distributed_llm-0.4.1/src/distllm/dist/router.py +382 -0
  645. distributed_llm-0.4.1/src/distllm/dist/routing/__init__.py +19 -0
  646. distributed_llm-0.4.1/src/distllm/dist/routing/arbitrage_engine.py +575 -0
  647. distributed_llm-0.4.1/src/distllm/dist/routing/composite.py +179 -0
  648. distributed_llm-0.4.1/src/distllm/dist/routing/consistent_hash.py +144 -0
  649. distributed_llm-0.4.1/src/distllm/dist/routing/latency_aware.py +116 -0
  650. distributed_llm-0.4.1/src/distllm/dist/routing/load_aware.py +114 -0
  651. distributed_llm-0.4.1/src/distllm/dist/scheduling/__init__.py +38 -0
  652. distributed_llm-0.4.1/src/distllm/dist/scheduling/batcher.py +95 -0
  653. distributed_llm-0.4.1/src/distllm/dist/scheduling/classifier.py +153 -0
  654. distributed_llm-0.4.1/src/distllm/dist/scheduling/deadline_scheduler.py +958 -0
  655. distributed_llm-0.4.1/src/distllm/dist/scheduling/iteration.py +404 -0
  656. distributed_llm-0.4.1/src/distllm/dist/scheduling/profiler.py +57 -0
  657. distributed_llm-0.4.1/src/distllm/dist/simulation/__init__.py +54 -0
  658. distributed_llm-0.4.1/src/distllm/dist/simulation/chaos_simulator.py +901 -0
  659. distributed_llm-0.4.1/src/distllm/dist/simulation/cluster_simulator.py +667 -0
  660. distributed_llm-0.4.1/src/distllm/dist/simulation/cost_aware_provisioning.py +370 -0
  661. distributed_llm-0.4.1/src/distllm/dist/simulation/digital_twin.py +617 -0
  662. distributed_llm-0.4.1/src/distllm/dist/simulation/topology_optimizer.py +747 -0
  663. distributed_llm-0.4.1/src/distllm/dist/simulation/what_if.py +492 -0
  664. distributed_llm-0.4.1/src/distllm/dist/speculative/__init__.py +47 -0
  665. distributed_llm-0.4.1/src/distllm/dist/speculative/adaptive_spec.py +291 -0
  666. distributed_llm-0.4.1/src/distllm/dist/speculative/draft_cache.py +246 -0
  667. distributed_llm-0.4.1/src/distllm/dist/speculative/draft_orchestrator.py +634 -0
  668. distributed_llm-0.4.1/src/distllm/dist/speculative/draft_registry.py +439 -0
  669. distributed_llm-0.4.1/src/distllm/dist/speculative/multi_draft.py +304 -0
  670. distributed_llm-0.4.1/src/distllm/dist/speculative/online_sisd.py +523 -0
  671. distributed_llm-0.4.1/src/distllm/dist/straggler.py +819 -0
  672. distributed_llm-0.4.1/src/distllm/dist/streaming_kv_transfer.py +174 -0
  673. distributed_llm-0.4.1/src/distllm/dist/structured_output/__init__.py +7 -0
  674. distributed_llm-0.4.1/src/distllm/dist/structured_output/engine.py +144 -0
  675. distributed_llm-0.4.1/src/distllm/dist/tensor_pool.py +120 -0
  676. distributed_llm-0.4.1/src/distllm/dist/tgi_compat.py +254 -0
  677. distributed_llm-0.4.1/src/distllm/dist/topology.py +141 -0
  678. distributed_llm-0.4.1/src/distllm/dist/topology_consensus.py +1961 -0
  679. distributed_llm-0.4.1/src/distllm/dist/topology_dynamic.py +270 -0
  680. distributed_llm-0.4.1/src/distllm/dist/tp_inprocess.py +214 -0
  681. distributed_llm-0.4.1/src/distllm/dist/tp_launcher.py +310 -0
  682. distributed_llm-0.4.1/src/distllm/dist/tracing.py +325 -0
  683. distributed_llm-0.4.1/src/distllm/dist/transport.py +493 -0
  684. distributed_llm-0.4.1/src/distllm/dist/wan_speculative.py +295 -0
  685. distributed_llm-0.4.1/src/distllm/dist/wandb_integration.py +252 -0
  686. distributed_llm-0.4.1/src/distllm/dist/webrtc.py +846 -0
  687. distributed_llm-0.4.1/src/distllm/dist/wide_area.py +515 -0
  688. distributed_llm-0.4.1/src/distllm/dist/worker.py +635 -0
  689. distributed_llm-0.4.1/src/distllm/dist/zero_copy.py +307 -0
  690. distributed_llm-0.4.1/src/distllm/errors/__init__.py +105 -0
  691. distributed_llm-0.4.1/src/distllm/errors/policies.py +106 -0
  692. distributed_llm-0.4.1/src/distllm/errors/retry.py +168 -0
  693. distributed_llm-0.4.1/src/distllm/errors/types.py +721 -0
  694. distributed_llm-0.4.1/src/distllm/health/__init__.py +6 -0
  695. distributed_llm-0.4.1/src/distllm/health/failover.py +81 -0
  696. distributed_llm-0.4.1/src/distllm/health/prober.py +31 -0
  697. distributed_llm-0.4.1/src/distllm/health/service.py +173 -0
  698. distributed_llm-0.4.1/src/distllm/health/state.py +76 -0
  699. distributed_llm-0.4.1/src/distllm/integrations/__init__.py +72 -0
  700. distributed_llm-0.4.1/src/distllm/integrations/_common/__init__.py +7 -0
  701. distributed_llm-0.4.1/src/distllm/integrations/_common/base_tool_provider.py +189 -0
  702. distributed_llm-0.4.1/src/distllm/integrations/_common/cost_tracker.py +144 -0
  703. distributed_llm-0.4.1/src/distllm/integrations/_common/model_router.py +148 -0
  704. distributed_llm-0.4.1/src/distllm/integrations/ci/__init__.py +24 -0
  705. distributed_llm-0.4.1/src/distllm/integrations/ci/_common.py +92 -0
  706. distributed_llm-0.4.1/src/distllm/integrations/ci/gitlab.py +345 -0
  707. distributed_llm-0.4.1/src/distllm/integrations/ci/jenkins.py +273 -0
  708. distributed_llm-0.4.1/src/distllm/integrations/mlflow_tracking.py +372 -0
  709. distributed_llm-0.4.1/src/distllm/integrations/spark_connector.py +909 -0
  710. distributed_llm-0.4.1/src/distllm/integrations/wandb/__init__.py +81 -0
  711. distributed_llm-0.4.1/src/distllm/models/__init__.py +40 -0
  712. distributed_llm-0.4.1/src/distllm/models/_trust_remote.py +48 -0
  713. distributed_llm-0.4.1/src/distllm/models/adapter.py +768 -0
  714. distributed_llm-0.4.1/src/distllm/models/adapter_router.py +198 -0
  715. distributed_llm-0.4.1/src/distllm/models/cache.py +172 -0
  716. distributed_llm-0.4.1/src/distllm/models/model_hub.py +650 -0
  717. distributed_llm-0.4.1/src/distllm/models/partition_planner.py +384 -0
  718. distributed_llm-0.4.1/src/distllm/models/partitioner.py +784 -0
  719. distributed_llm-0.4.1/src/distllm/models/rope_scaling.py +119 -0
  720. distributed_llm-0.4.1/src/distllm/models/safetensors_index.py +179 -0
  721. distributed_llm-0.4.1/src/distllm/observability/__init__.py +107 -0
  722. distributed_llm-0.4.1/src/distllm/observability/alerting_config.py +881 -0
  723. distributed_llm-0.4.1/src/distllm/observability/capacity_models.py +398 -0
  724. distributed_llm-0.4.1/src/distllm/observability/capacity_planning.py +2870 -0
  725. distributed_llm-0.4.1/src/distllm/observability/exporter.py +228 -0
  726. distributed_llm-0.4.1/src/distllm/observability/exporter_datadog.py +1362 -0
  727. distributed_llm-0.4.1/src/distllm/observability/health_config.py +1282 -0
  728. distributed_llm-0.4.1/src/distllm/observability/incident_response.py +779 -0
  729. distributed_llm-0.4.1/src/distllm/observability/logging.py +211 -0
  730. distributed_llm-0.4.1/src/distllm/observability/logging_config.py +864 -0
  731. distributed_llm-0.4.1/src/distllm/observability/loki_sink.py +178 -0
  732. distributed_llm-0.4.1/src/distllm/observability/metrics.py +111 -0
  733. distributed_llm-0.4.1/src/distllm/observability/metrics_completeness.py +393 -0
  734. distributed_llm-0.4.1/src/distllm/observability/otel_logging.py +290 -0
  735. distributed_llm-0.4.1/src/distllm/observability/self_healing_config.py +1308 -0
  736. distributed_llm-0.4.1/src/distllm/observability/slo_config.py +1520 -0
  737. distributed_llm-0.4.1/src/distllm/observability/spans.py +235 -0
  738. distributed_llm-0.4.1/src/distllm/observability/tracing.py +268 -0
  739. distributed_llm-0.4.1/src/distllm/observability/tracing_config.py +676 -0
  740. distributed_llm-0.4.1/src/distllm/observability/wandb_monitor.py +66 -0
  741. distributed_llm-0.4.1/src/distllm/plugins/__init__.py +14 -0
  742. distributed_llm-0.4.1/src/distllm/plugins/airflow.py +110 -0
  743. distributed_llm-0.4.1/src/distllm/plugins/auth_plugin.py +576 -0
  744. distributed_llm-0.4.1/src/distllm/plugins/builtin.py +376 -0
  745. distributed_llm-0.4.1/src/distllm/plugins/cache_plugin.py +576 -0
  746. distributed_llm-0.4.1/src/distllm/plugins/health_plugin.py +396 -0
  747. distributed_llm-0.4.1/src/distllm/plugins/kubeflow.py +84 -0
  748. distributed_llm-0.4.1/src/distllm/plugins/mlflow_plugin.py +71 -0
  749. distributed_llm-0.4.1/src/distllm/plugins/registry.py +135 -0
  750. distributed_llm-0.4.1/src/distllm/prompts/__init__.py +39 -0
  751. distributed_llm-0.4.1/src/distllm/prompts/analysis.py +103 -0
  752. distributed_llm-0.4.1/src/distllm/prompts/code.py +172 -0
  753. distributed_llm-0.4.1/src/distllm/prompts/creative.py +115 -0
  754. distributed_llm-0.4.1/src/distllm/prompts/education.py +91 -0
  755. distributed_llm-0.4.1/src/distllm/prompts/engine.py +119 -0
  756. distributed_llm-0.4.1/src/distllm/prompts/exchange.py +705 -0
  757. distributed_llm-0.4.1/src/distllm/prompts/language.py +81 -0
  758. distributed_llm-0.4.1/src/distllm/prompts/library.py +1198 -0
  759. distributed_llm-0.4.1/src/distllm/prompts/management.py +35 -0
  760. distributed_llm-0.4.1/src/distllm/prompts/productivity.py +86 -0
  761. distributed_llm-0.4.1/src/distllm/prompts/professional.py +111 -0
  762. distributed_llm-0.4.1/src/distllm/prompts/prompt_def.py +33 -0
  763. distributed_llm-0.4.1/src/distllm/prompts/reasoning.py +108 -0
  764. distributed_llm-0.4.1/src/distllm/prompts/specialized.py +140 -0
  765. distributed_llm-0.4.1/src/distllm/prompts/templates.py +128 -0
  766. distributed_llm-0.4.1/src/distllm/prompts/writing.py +140 -0
  767. distributed_llm-0.4.1/src/distllm/py.typed +0 -0
  768. distributed_llm-0.4.1/src/distllm/sdk/__init__.py +82 -0
  769. distributed_llm-0.4.1/src/distllm/sdk/circuit_breaker.py +139 -0
  770. distributed_llm-0.4.1/src/distllm/sdk/client.py +1191 -0
  771. distributed_llm-0.4.1/src/distllm/sdk/observability.py +42 -0
  772. distributed_llm-0.4.1/src/distllm/sdk/streaming.py +228 -0
  773. distributed_llm-0.4.1/src/distllm/sdk/transport.py +224 -0
  774. distributed_llm-0.4.1/src/distllm/sdk/types.py +288 -0
  775. distributed_llm-0.4.1/src/distllm/security/__init__.py +63 -0
  776. distributed_llm-0.4.1/src/distllm/security/content_moderation/__init__.py +44 -0
  777. distributed_llm-0.4.1/src/distllm/security/content_moderation/base.py +405 -0
  778. distributed_llm-0.4.1/src/distllm/security/content_moderation/jailbreak.py +192 -0
  779. distributed_llm-0.4.1/src/distllm/security/content_moderation/pii.py +262 -0
  780. distributed_llm-0.4.1/src/distllm/security/content_moderation/pipeline.py +272 -0
  781. distributed_llm-0.4.1/src/distllm/security/content_moderation/topics.py +153 -0
  782. distributed_llm-0.4.1/src/distllm/security/content_moderation/toxicity.py +131 -0
  783. distributed_llm-0.4.1/src/distllm/security/e2e.py +437 -0
  784. distributed_llm-0.4.1/src/distllm/security/edge_attestation.py +381 -0
  785. distributed_llm-0.4.1/src/distllm/security/log_redaction.py +244 -0
  786. distributed_llm-0.4.1/src/distllm/security/quantum_safe_tls.py +314 -0
  787. distributed_llm-0.4.1/src/distllm/security/spiffe.py +347 -0
  788. distributed_llm-0.4.1/src/distllm/security/tee.py +461 -0
  789. distributed_llm-0.4.1/src/distllm/security/utils.py +139 -0
  790. distributed_llm-0.4.1/src/distllm/security/watermark.py +779 -0
  791. distributed_llm-0.4.1/src/distllm/terraform/__init__.py +260 -0
  792. distributed_llm-0.4.1/src/distllm/ui/__init__.py +7 -0
  793. distributed_llm-0.4.1/src/distllm/ui/app.py +98 -0
  794. distributed_llm-0.4.1/src/distllm/utils/__init__.py +0 -0
  795. distributed_llm-0.4.1/src/distllm/utils/gbnf_grammar.py +99 -0
  796. distributed_llm-0.4.1/src/distllm/utils/lazy_imports.py +90 -0
  797. distributed_llm-0.4.1/src/distllm/utils/scheduling.py +38 -0
  798. distributed_llm-0.4.1/src/distllm/verification/__init__.py +49 -0
  799. distributed_llm-0.4.1/src/distllm/verification/comparator.py +263 -0
  800. distributed_llm-0.4.1/src/distllm/verification/hash_registry.py +220 -0
  801. distributed_llm-0.4.1/src/distllm/verification/report.py +240 -0
  802. distributed_llm-0.4.1/src/distllm/verification/runner.py +822 -0
  803. distributed_llm-0.4.1/src/distllm/verification/test_verify.py +205 -0
  804. distributed_llm-0.4.1/src/distributed_llm.egg-info/PKG-INFO +315 -0
  805. distributed_llm-0.4.1/src/distributed_llm.egg-info/SOURCES.txt +851 -0
  806. distributed_llm-0.4.1/src/distributed_llm.egg-info/dependency_links.txt +1 -0
  807. distributed_llm-0.4.1/src/distributed_llm.egg-info/entry_points.txt +5 -0
  808. distributed_llm-0.4.1/src/distributed_llm.egg-info/requires.txt +136 -0
  809. distributed_llm-0.4.1/src/distributed_llm.egg-info/top_level.txt +1 -0
  810. distributed_llm-0.4.1/tests/test_c4_ci_testing_extra_regression.py +55 -0
  811. distributed_llm-0.4.1/tests/test_comprehensive.py +1706 -0
  812. distributed_llm-0.4.1/tests/test_cross_cloud_router.py +298 -0
  813. distributed_llm-0.4.1/tests/test_cross_platform.py +342 -0
  814. distributed_llm-0.4.1/tests/test_errors_retry.py +414 -0
  815. distributed_llm-0.4.1/tests/test_features_6_1_bugs.py +242 -0
  816. distributed_llm-0.4.1/tests/test_features_autopilot_privacy_plugins.py +246 -0
  817. distributed_llm-0.4.1/tests/test_features_fusion_prefetch.py +186 -0
  818. distributed_llm-0.4.1/tests/test_features_integration_cluster.py +234 -0
  819. distributed_llm-0.4.1/tests/test_features_integrations.py +160 -0
  820. distributed_llm-0.4.1/tests/test_features_modules_5_1.py +138 -0
  821. distributed_llm-0.4.1/tests/test_features_property.py +161 -0
  822. distributed_llm-0.4.1/tests/test_features_release_gates.py +390 -0
  823. distributed_llm-0.4.1/tests/test_features_sla_equivalence.py +137 -0
  824. distributed_llm-0.4.1/tests/test_gpu.py +166 -0
  825. distributed_llm-0.4.1/tests/test_high_severity_fixes.py +106 -0
  826. distributed_llm-0.4.1/tests/test_high_severity_fixes_2.py +198 -0
  827. distributed_llm-0.4.1/tests/test_high_severity_fixes_3.py +157 -0
  828. distributed_llm-0.4.1/tests/test_high_severity_gpu.py +171 -0
  829. distributed_llm-0.4.1/tests/test_integration_full.py +251 -0
  830. distributed_llm-0.4.1/tests/test_l6_ssrf_guard.py +31 -0
  831. distributed_llm-0.4.1/tests/test_marketplace.py +289 -0
  832. distributed_llm-0.4.1/tests/test_medium_money_preempt_dp.py +184 -0
  833. distributed_llm-0.4.1/tests/test_medium_severity_fixes.py +153 -0
  834. distributed_llm-0.4.1/tests/test_medium_severity_fixes_2.py +257 -0
  835. distributed_llm-0.4.1/tests/test_medium_severity_fixes_3.py +158 -0
  836. distributed_llm-0.4.1/tests/test_migrations.py +48 -0
  837. distributed_llm-0.4.1/tests/test_oidc_c2_regression.py +172 -0
  838. distributed_llm-0.4.1/tests/test_pipeline.py +332 -0
  839. distributed_llm-0.4.1/tests/test_replication_controller.py +77 -0
  840. distributed_llm-0.4.1/tests/test_reputation.py +140 -0
  841. distributed_llm-0.4.1/tests/test_review_table_h9_m6_hash.py +76 -0
  842. distributed_llm-0.4.1/tests/test_review_table_m17_m14_router.py +118 -0
  843. distributed_llm-0.4.1/tests/test_routing_chaos.py +165 -0
  844. distributed_llm-0.4.1/tests/test_routing_integration.py +154 -0
  845. distributed_llm-0.4.1/tests/test_routing_performance.py +90 -0
  846. distributed_llm-0.4.1/tests/test_routing_properties.py +144 -0
  847. distributed_llm-0.4.1/tests/test_routing_security.py +105 -0
  848. distributed_llm-0.4.1/tests/test_spec_verify_shared.py +136 -0
  849. distributed_llm-0.4.1/tests/test_speculative_auto.py +176 -0
  850. distributed_llm-0.4.1/tests/test_speculative_verify_index.py +189 -0
  851. distributed_llm-0.4.1/tests/test_stable_hashing.py +46 -0
  852. distributed_llm-0.4.1/tests/test_straggler_comprehensive.py +583 -0
  853. distributed_llm-0.4.1/tests/test_tenant_cost_money.py +43 -0
@@ -0,0 +1,97 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity.
18
+
19
+ "You" (or "Your") shall mean an individual or Legal Entity
20
+ exercising permissions granted by this License.
21
+
22
+ "Source" form shall mean the preferred form for making modifications,
23
+ including but not limited to software source code, documentation
24
+ source, and configuration files.
25
+
26
+ "Object" form shall mean any form resulting from mechanical
27
+ transformation or translation of a Source form, including but
28
+ not limited to compiled object code, generated documentation,
29
+ and conversions to other media types.
30
+
31
+ "Work" shall mean the work of authorship, whether in Source or
32
+ Object form, made available under the License.
33
+
34
+ "Derivative Works" shall mean any work, whether in Source or Object
35
+ form, that is based on (or derived from) the Work.
36
+
37
+ "Contribution" shall mean any work of authorship, including
38
+ the original version of the Work and any modifications or additions
39
+ to that Work or Derivative Works thereof, that is intentionally
40
+ submitted to the Licensor.
41
+
42
+ "Contributor" shall mean Licensor and any individual or Legal Entity
43
+ on behalf of whom a Contribution has been received by Licensor.
44
+
45
+ 2. Grant of Copyright License. Subject to the terms and conditions of
46
+ this License, each Contributor hereby grants to You a perpetual,
47
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
48
+ copyright license to reproduce, prepare Derivative Works of,
49
+ publicly display, publicly perform, sublicense, and distribute the
50
+ Work and such Derivative Works in Source or Object form.
51
+
52
+ 3. Grant of Patent License. Subject to the terms and conditions of
53
+ this License, each Contributor hereby grants to You a perpetual,
54
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
55
+ (except as stated in this section) patent license to make, have made,
56
+ use, offer to sell, sell, import, and otherwise transfer the Work.
57
+
58
+ 4. Redistribution. You may reproduce and distribute copies of the
59
+ Work or Derivative Works thereof in any medium, with or without
60
+ modifications, provided that You meet the following conditions:
61
+
62
+ (a) You must give any other recipients of the Work or
63
+ Derivative Works a copy of this License; and
64
+
65
+ (b) You must cause any modified files to carry prominent notices
66
+ stating that You changed the files; and
67
+
68
+ (c) You must retain, in the Source form of any Derivative Works
69
+ that You distribute, all copyright, patent, trademark, and
70
+ attribution notices from the Source form of the Work; and
71
+
72
+ (d) You may add Your own copyright statement to Your modifications and
73
+ may provide additional or different license terms and conditions
74
+ for use, reproduction, or distribution of Your modifications.
75
+
76
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
77
+ any Contribution intentionally submitted for inclusion in the Work
78
+ by You to the Licensor shall be under the terms and conditions of
79
+ this License.
80
+
81
+ 6. Trademarks. This License does not grant permission to use the trade
82
+ names, trademarks, service marks, or product names of the Licensor.
83
+
84
+ 7. Disclaimer of Warranty. Unless required by applicable law or
85
+ agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
86
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
87
+
88
+ 8. Limitation of Liability. In no event shall any Contributor be liable
89
+ to You for damages arising from use of the Work or inability to use
90
+ the Work.
91
+
92
+ 9. Accepting Warranty or Additional Liability. While redistributing
93
+ the Work or Derivative Works thereof, You may offer to accept support,
94
+ warranty, indemnity, or other liability obligations consistent with
95
+ this License.
96
+
97
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,315 @@
1
+ Metadata-Version: 2.4
2
+ Name: distributed-llm
3
+ Version: 0.4.1
4
+ Summary: Distributed LLM inference — pool GPUs across multiple devices to run models no single machine can handle
5
+ Author: Distributed LLM Contributors
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/distributed-llm/distributed-llm
8
+ Project-URL: Documentation, https://github.com/distributed-llm/distributed-llm#readme
9
+ Project-URL: Repository, https://github.com/distributed-llm/distributed-llm
10
+ Project-URL: Issues, https://github.com/distributed-llm/distributed-llm/issues
11
+ Keywords: llm,inference,distributed,pipeline-parallelism,gpu-sharing,peer-to-peer,open-source
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: System :: Distributed Computing
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: fastapi>=0.109.0
27
+ Requires-Dist: uvicorn>=0.27.0
28
+ Requires-Dist: pydantic>=2.5.0
29
+ Requires-Dist: pydantic-settings>=2.0.0
30
+ Requires-Dist: httpx>=0.27
31
+ Requires-Dist: pyyaml>=6.0
32
+ Requires-Dist: loguru>=0.7.0
33
+ Requires-Dist: pyjwt>=2.0.0
34
+ Requires-Dist: numpy>=1.26.0
35
+ Requires-Dist: psutil>=5.9.0
36
+ Provides-Extra: observability
37
+ Requires-Dist: prometheus-client>=0.20; extra == "observability"
38
+ Requires-Dist: opentelemetry-api>=1.21.0; extra == "observability"
39
+ Requires-Dist: opentelemetry-sdk>=1.21.0; extra == "observability"
40
+ Requires-Dist: opentelemetry-exporter-prometheus>=0.42b0; extra == "observability"
41
+ Provides-Extra: self-hosted
42
+ Requires-Dist: torch>=2.5.0; extra == "self-hosted"
43
+ Requires-Dist: transformers>=4.48.0; extra == "self-hosted"
44
+ Requires-Dist: accelerate>=1.0.0; extra == "self-hosted"
45
+ Requires-Dist: safetensors>=0.4.0; extra == "self-hosted"
46
+ Requires-Dist: huggingface-hub>=0.20.0; extra == "self-hosted"
47
+ Requires-Dist: sentencepiece>=0.1.99; extra == "self-hosted"
48
+ Requires-Dist: nvidia-ml-py>=12.0; extra == "self-hosted"
49
+ Provides-Extra: ray
50
+ Requires-Dist: ray[default]>=2.30.0; extra == "ray"
51
+ Provides-Extra: backends
52
+ Requires-Dist: vllm<0.9.0,>=0.7.0; extra == "backends"
53
+ Requires-Dist: sglang<0.5.0,>=0.4.0; extra == "backends"
54
+ Requires-Dist: llama-cpp-python>=0.3.0; extra == "backends"
55
+ Provides-Extra: dev
56
+ Requires-Dist: pytest>=7.0; extra == "dev"
57
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
58
+ Requires-Dist: hypothesis>=6.90; extra == "dev"
59
+ Requires-Dist: pytest-benchmark>=4.0; extra == "dev"
60
+ Requires-Dist: black>=24.0; extra == "dev"
61
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
62
+ Requires-Dist: mypy>=1.8; extra == "dev"
63
+ Requires-Dist: opentelemetry-test-utils>=0.42b0; extra == "dev"
64
+ Requires-Dist: bandit[toml]>=1.7; extra == "dev"
65
+ Requires-Dist: detect-secrets>=1.5; extra == "dev"
66
+ Provides-Extra: sdk
67
+ Requires-Dist: httpx>=0.27.0; extra == "sdk"
68
+ Provides-Extra: cli
69
+ Requires-Dist: typer[all]>=0.9.0; extra == "cli"
70
+ Requires-Dist: rich>=13.7.0; extra == "cli"
71
+ Requires-Dist: prompt_toolkit>=3.0.0; extra == "cli"
72
+ Provides-Extra: ui
73
+ Requires-Dist: jinja2>=3.1.0; extra == "ui"
74
+ Requires-Dist: python-multipart>=0.0.6; extra == "ui"
75
+ Requires-Dist: qrcode[pil]>=7.4; extra == "ui"
76
+ Provides-Extra: examples
77
+ Requires-Dist: langchain-openai>=0.1.0; extra == "examples"
78
+ Requires-Dist: langchain-core>=0.1.0; extra == "examples"
79
+ Requires-Dist: llama-index-llms-openai>=0.1.0; extra == "examples"
80
+ Requires-Dist: llama-index-core>=0.10.0; extra == "examples"
81
+ Requires-Dist: crewai>=0.30.0; extra == "examples"
82
+ Provides-Extra: security
83
+ Requires-Dist: cryptography>=41.0; extra == "security"
84
+ Requires-Dist: pynacl>=1.5.0; extra == "security"
85
+ Provides-Extra: moderation
86
+ Requires-Dist: transformers>=4.36.0; extra == "moderation"
87
+ Requires-Dist: onnxruntime>=1.16.0; extra == "moderation"
88
+ Provides-Extra: mlflow
89
+ Requires-Dist: mlflow>=2.0.0; extra == "mlflow"
90
+ Provides-Extra: monitoring
91
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.21.0; extra == "monitoring"
92
+ Requires-Dist: opentelemetry-proto>=1.21.0; extra == "monitoring"
93
+ Requires-Dist: nvidia-ml-py>=12.0; extra == "monitoring"
94
+ Requires-Dist: psutil>=5.9.0; extra == "monitoring"
95
+ Provides-Extra: model-extras
96
+ Requires-Dist: bitsandbytes>=0.41.0; extra == "model-extras"
97
+ Requires-Dist: peft>=0.14.0; extra == "model-extras"
98
+ Provides-Extra: wan
99
+ Requires-Dist: aioquic>=1.0.0; extra == "wan"
100
+ Provides-Extra: wandb
101
+ Requires-Dist: wandb>=0.18; extra == "wandb"
102
+ Requires-Dist: nvidia-ml-py>=12.0; extra == "wandb"
103
+ Provides-Extra: spark
104
+ Requires-Dist: pyspark>=3.4.0; extra == "spark"
105
+ Provides-Extra: spark-mlflow
106
+ Requires-Dist: distributed-llm[mlflow,spark]; extra == "spark-mlflow"
107
+ Provides-Extra: openai-agents
108
+ Requires-Dist: openai-agents>=0.1.0; extra == "openai-agents"
109
+ Requires-Dist: openai>=1.0.0; extra == "openai-agents"
110
+ Provides-Extra: agno
111
+ Requires-Dist: agno>=1.0.0; extra == "agno"
112
+ Provides-Extra: autogpt
113
+ Requires-Dist: autogpt>=0.4.0; extra == "autogpt"
114
+ Provides-Extra: vector-db-pinecone
115
+ Requires-Dist: pinecone>=3.0.0; extra == "vector-db-pinecone"
116
+ Provides-Extra: vector-db-qdrant
117
+ Requires-Dist: qdrant-client>=1.9.0; extra == "vector-db-qdrant"
118
+ Provides-Extra: vector-db-weaviate
119
+ Requires-Dist: weaviate-client>=4.0.0; extra == "vector-db-weaviate"
120
+ Provides-Extra: vector-db-milvus
121
+ Requires-Dist: pymilvus>=2.3.0; extra == "vector-db-milvus"
122
+ Provides-Extra: vector-db-all
123
+ Requires-Dist: distributed-llm[vector-db-milvus,vector-db-pinecone,vector-db-qdrant,vector-db-weaviate]; extra == "vector-db-all"
124
+ Provides-Extra: spot
125
+ Requires-Dist: httpx>=0.27; extra == "spot"
126
+ Provides-Extra: all
127
+ Requires-Dist: distributed-llm[agno,autogpt,backends,cli,examples,mlflow,observability,openai-agents,ray,sdk,security,self-hosted,spark,spot,ui,wan]; extra == "all"
128
+ Requires-Dist: distributed-llm[model-extras]; extra == "all"
129
+ Provides-Extra: all-dev
130
+ Requires-Dist: distributed-llm[all,dev]; extra == "all-dev"
131
+ Requires-Dist: locust>=2.20; extra == "all-dev"
132
+ Requires-Dist: safety>=3.0; extra == "all-dev"
133
+ Dynamic: license-file
134
+
135
+ # DistLLM — Distributed Inference Across All Your Devices
136
+
137
+ **Pool GPUs from every device you own to run models no single machine can handle.**
138
+
139
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
140
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
141
+
142
+ You have a gaming PC with an RTX 4090. Your laptop has an RTX 4060. Your friend has a desktop with an RTX 3080. None of you can run Llama 3.1 70B alone. **Together, you can.**
143
+
144
+ DistLLM splits large language models across all your devices using pipeline parallelism. Each device runs a fraction of the model layers. Automatic discovery. Auto-partitioning. Works over LAN, WiFi, or internet.
145
+
146
+ ```
147
+ Your Laptop (RTX 4060) ────┐
148
+ │
149
+ Your Gaming PC (RTX 4090) ──┼──► DistLLM Cluster ──► Run 70B models
150
+ │
151
+ Friend's PC (RTX 3080) ────┘
152
+ ```
153
+
154
+ ## Why DistLLM?
155
+
156
+ | Problem | Solution |
157
+ |---------|----------|
158
+ | One GPU can't run today's best models | Split across all your devices |
159
+ | Cloud inference costs thousands/month | Use the GPUs you already own |
160
+ | Data privacy concerns with cloud APIs | Your data stays on your devices |
161
+ | Slow single-device inference | Pipeline parallelism = faster generation |
162
+ | Setting up distributed systems is hard | One command to start, one to join |
163
+
164
+ ## Quick Start
165
+
166
+ ```bash
167
+ pip install distllm
168
+
169
+ # On your main machine — start a cluster
170
+ distllm cluster start --model meta-llama/Llama-3.2-7B
171
+
172
+ # On every other machine — join the cluster
173
+ distllm cluster join
174
+ ```
175
+
176
+ ## How It Works
177
+
178
+ DistLLM uses **pipeline parallelism** — the model is split across devices by layers:
179
+
180
+ ```
181
+ Device 1 (Laptop): Layers 0-5 ──→ Device 2 (Desktop): Layers 6-11 ──→ Device 3 (Friend's PC): Layers 12-17
182
+
183
+ Each device runs ~6 layers → fits in 6-8GB VRAM
184
+ Combined pool → runs models up to 70B parameters
185
+ ```
186
+
187
+ Key capabilities:
188
+ - **Auto-discovery**: devices find each other on the same network automatically
189
+ - **Auto-partitioning**: automatically assigns layers based on each device's GPU
190
+ - **Node recovery**: if a device disconnects, remaining nodes take over
191
+ - **Straggler detection**: slow nodes are detected and worked around
192
+ - **WAN optimization**: token accumulation for low-latency cross-internet inference
193
+ - **Privacy-first**: keep sensitive layers on your own devices
194
+
195
+ ## Installation
196
+
197
+ ```bash
198
+ # Core package
199
+ pip install distllm
200
+
201
+ # With vLLM backend (recommended for NVIDIA GPUs)
202
+ pip install "distllm[vllm]"
203
+
204
+ # With llama.cpp backend (CPU, AMD, Apple Silicon)
205
+ pip install "distllm[llamacpp]"
206
+
207
+ # Development
208
+ pip install -e ".[dev]"
209
+ ```
210
+
211
+ ## Key Features
212
+
213
+ - **Pipeline parallelism** — split any HuggingFace model across N devices
214
+ - **Auto-discovery** — mDNS/zeroconf device finding on LAN
215
+ - **6 backends** — vLLM, llama.cpp, TensorRT-LLM, ExLlamaV2, ONNX, PyTorch
216
+ - **Auth plugin** — JWT authentication + RBAC role-based access control
217
+ - **Health watchdog** — Continuous node health monitoring with auto circuit-breaking
218
+ - **Semantic caching** — Deduplicate repeated prompts with embedding similarity
219
+ - **Token streaming** — `generate_stream()` for real-time token-by-token responses
220
+ - **Config validation** — Cross-field validation catches invalid combinations at load time
221
+ - **Circuit breaker** — Graduated backpressure for load shedding
222
+ - **Auto-partitioning** — hardware-aware DP solver for optimal layer assignment
223
+ - **Node recovery** — checkpoint-based recovery when nodes disconnect
224
+ - **Straggler detection** — statistical outlier detection for slow nodes
225
+ - **Dynamic rebalancing** — redistribute layers when nodes join/leave
226
+ - **P2P KV cache gossip** — CRDT-based cache sharing between nodes
227
+ - **Wide-area support** — token accumulation for internet-scale inference
228
+ - **Quantization** — 4-bit/8-bit to fit larger models on consumer GPUs
229
+ - **OpenAI-compatible API** — use any OpenAI client to send requests
230
+ - **Full observability** — Prometheus metrics, OTel tracing, structured logging
231
+ - **Interactive chat** — `distllm chat` for CLI-based interaction
232
+ - **Auth plugin** — JWT authentication with RBAC role-based access control
233
+ - **Health watchdog** — continuous node health monitoring with automatic failover
234
+ - **Semantic cache** — caching plugin with deduplication for repeated prompts
235
+ - **Token streaming** — `generate_stream()` SDK method for token-by-token responses
236
+ - **Health endpoints** — `/healthz` (liveness) and `/readyz` (readiness) for Kubernetes probes
237
+
238
+ ## CLI Commands
239
+
240
+ ```bash
241
+ # Start a coordinator node
242
+ distllm-coordinator --model meta-llama/Llama-3.2-1B --local --chat
243
+
244
+ # Start distributed coordinator
245
+ distllm-coordinator --model meta-llama/Llama-3.2-7B \
246
+ --nodes laptop:50051:0:5 desktop:50052:6:11 friend:50053:12:17
247
+
248
+ # Start a worker node
249
+ distllm-node --node-id laptop --model meta-llama/Llama-3.2-7B \
250
+ --start-layer 0 --end-layer 5 --total-layers 18 \
251
+ --coordinator-host 192.168.1.100 --coordinator-port 50050
252
+
253
+ # Start the REST API server
254
+ distllm-api --model meta-llama/Llama-3.2-1B --local
255
+
256
+ # System diagnostics (check Python, CUDA, GPU, network, ports)
257
+ distllm doctor
258
+
259
+ # Quantize a model for smaller footprint
260
+ distllm tune quantize --model meta-llama/Llama-3.2-7B --bits 4
261
+
262
+ # Batch inference over a dataset
263
+ distllm tune batch --input prompts.jsonl --output results.jsonl
264
+
265
+ # Warm the semantic cache from prior prompts
266
+ distllm tune cache --preload cache_seed.jsonl
267
+ ```
268
+
269
+ ## Documentation
270
+
271
+ - [Architecture](docs/architecture.md) — Pipeline parallelism, node topology, KV cache management
272
+ - [Deployment](DEPLOYMENT.md) — Local, Docker, and multi-machine deployment
273
+ - [API Reference](docs/api.md) — OpenAI-compatible API docs
274
+
275
+ ## Project Structure
276
+
277
+ ```
278
+ src/distllm/
279
+ ├── core/ # Coordinator, request pipeline, batch scheduler
280
+ ├── dist/ # Distributed inference engine
281
+ │ ├── pipeline.py # PipelineOrchestrator — multi-node execution
282
+ │ ├── worker.py # WorkerNode — per-device model subset
283
+ │ ├── recovery.py # NodeRecoveryManager — failure handling
284
+ │ ├── straggler.py # StragglerDetector — slow node detection
285
+ │ ├── rebalancer.py # Dynamic pipeline rebalancing
286
+ │ ├── wide_area.py # WAN-optimized inference
287
+ │ ├── parallel.py # Hybrid parallelism auto-selector
288
+ │ ├── p2p/ # P2P gossip protocol & discovery
289
+ │ └── partition/ # Hardware-aware auto-partitioner
290
+ ├── api/ # OpenAI-compatible REST API
291
+ ├── models/ # Model partitioning & loading
292
+ ├── cli/ # CLI tool
293
+ ├── sdk/ # Python client
294
+ ├── observability/ # Metrics, tracing, logging
295
+ └── dashboard/ # Web dashboard
296
+ ```
297
+
298
+ ## Supported Model Architectures
299
+
300
+ GPT-2, GPT-Neo, Llama 2/3, Mistral, Mixtral, Qwen2.5, Phi, DeepSeek, StableLM, Pythia, Baichuan, ChatGLM, InternLM, and more via HuggingFace AutoModel.
301
+
302
+ ## Roadmap
303
+
304
+ - **Current**: Pipeline parallelism across LAN devices, manual node configuration
305
+ - **Q3 2026**: Auto-discovery (mDNS), auto-partitioning, node recovery, GUI dashboard
306
+ - **Q4 2026**: NAT traversal (cross-internet), P2P model distribution, GPU reputation system
307
+ - **2027**: Federated clusters, speculative parallelism, privacy-preserving split, incentive system
308
+
309
+ ## Contributing
310
+
311
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
312
+
313
+ ## License
314
+
315
+ Apache 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,181 @@
1
+ # DistLLM — Distributed Inference Across All Your Devices
2
+
3
+ **Pool GPUs from every device you own to run models no single machine can handle.**
4
+
5
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
6
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
+
8
+ You have a gaming PC with an RTX 4090. Your laptop has an RTX 4060. Your friend has a desktop with an RTX 3080. None of you can run Llama 3.1 70B alone. **Together, you can.**
9
+
10
+ DistLLM splits large language models across all your devices using pipeline parallelism. Each device runs a fraction of the model layers. Automatic discovery. Auto-partitioning. Works over LAN, WiFi, or internet.
11
+
12
+ ```
13
+ Your Laptop (RTX 4060) ────┐
14
+ │
15
+ Your Gaming PC (RTX 4090) ──┼──► DistLLM Cluster ──► Run 70B models
16
+ │
17
+ Friend's PC (RTX 3080) ────┘
18
+ ```
19
+
20
+ ## Why DistLLM?
21
+
22
+ | Problem | Solution |
23
+ |---------|----------|
24
+ | One GPU can't run today's best models | Split across all your devices |
25
+ | Cloud inference costs thousands/month | Use the GPUs you already own |
26
+ | Data privacy concerns with cloud APIs | Your data stays on your devices |
27
+ | Slow single-device inference | Pipeline parallelism = faster generation |
28
+ | Setting up distributed systems is hard | One command to start, one to join |
29
+
30
+ ## Quick Start
31
+
32
+ ```bash
33
+ pip install distllm
34
+
35
+ # On your main machine — start a cluster
36
+ distllm cluster start --model meta-llama/Llama-3.2-7B
37
+
38
+ # On every other machine — join the cluster
39
+ distllm cluster join
40
+ ```
41
+
42
+ ## How It Works
43
+
44
+ DistLLM uses **pipeline parallelism** — the model is split across devices by layers:
45
+
46
+ ```
47
+ Device 1 (Laptop): Layers 0-5 ──→ Device 2 (Desktop): Layers 6-11 ──→ Device 3 (Friend's PC): Layers 12-17
48
+
49
+ Each device runs ~6 layers → fits in 6-8GB VRAM
50
+ Combined pool → runs models up to 70B parameters
51
+ ```
52
+
53
+ Key capabilities:
54
+ - **Auto-discovery**: devices find each other on the same network automatically
55
+ - **Auto-partitioning**: automatically assigns layers based on each device's GPU
56
+ - **Node recovery**: if a device disconnects, remaining nodes take over
57
+ - **Straggler detection**: slow nodes are detected and worked around
58
+ - **WAN optimization**: token accumulation for low-latency cross-internet inference
59
+ - **Privacy-first**: keep sensitive layers on your own devices
60
+
61
+ ## Installation
62
+
63
+ ```bash
64
+ # Core package
65
+ pip install distllm
66
+
67
+ # With vLLM backend (recommended for NVIDIA GPUs)
68
+ pip install "distllm[vllm]"
69
+
70
+ # With llama.cpp backend (CPU, AMD, Apple Silicon)
71
+ pip install "distllm[llamacpp]"
72
+
73
+ # Development
74
+ pip install -e ".[dev]"
75
+ ```
76
+
77
+ ## Key Features
78
+
79
+ - **Pipeline parallelism** — split any HuggingFace model across N devices
80
+ - **Auto-discovery** — mDNS/zeroconf device finding on LAN
81
+ - **6 backends** — vLLM, llama.cpp, TensorRT-LLM, ExLlamaV2, ONNX, PyTorch
82
+ - **Auth plugin** — JWT authentication + RBAC role-based access control
83
+ - **Health watchdog** — Continuous node health monitoring with auto circuit-breaking
84
+ - **Semantic caching** — Deduplicate repeated prompts with embedding similarity
85
+ - **Token streaming** — `generate_stream()` for real-time token-by-token responses
86
+ - **Config validation** — Cross-field validation catches invalid combinations at load time
87
+ - **Circuit breaker** — Graduated backpressure for load shedding
88
+ - **Auto-partitioning** — hardware-aware DP solver for optimal layer assignment
89
+ - **Node recovery** — checkpoint-based recovery when nodes disconnect
90
+ - **Straggler detection** — statistical outlier detection for slow nodes
91
+ - **Dynamic rebalancing** — redistribute layers when nodes join/leave
92
+ - **P2P KV cache gossip** — CRDT-based cache sharing between nodes
93
+ - **Wide-area support** — token accumulation for internet-scale inference
94
+ - **Quantization** — 4-bit/8-bit to fit larger models on consumer GPUs
95
+ - **OpenAI-compatible API** — use any OpenAI client to send requests
96
+ - **Full observability** — Prometheus metrics, OTel tracing, structured logging
97
+ - **Interactive chat** — `distllm chat` for CLI-based interaction
98
+ - **Auth plugin** — JWT authentication with RBAC role-based access control
99
+ - **Health watchdog** — continuous node health monitoring with automatic failover
100
+ - **Semantic cache** — caching plugin with deduplication for repeated prompts
101
+ - **Token streaming** — `generate_stream()` SDK method for token-by-token responses
102
+ - **Health endpoints** — `/healthz` (liveness) and `/readyz` (readiness) for Kubernetes probes
103
+
104
+ ## CLI Commands
105
+
106
+ ```bash
107
+ # Start a coordinator node
108
+ distllm-coordinator --model meta-llama/Llama-3.2-1B --local --chat
109
+
110
+ # Start distributed coordinator
111
+ distllm-coordinator --model meta-llama/Llama-3.2-7B \
112
+ --nodes laptop:50051:0:5 desktop:50052:6:11 friend:50053:12:17
113
+
114
+ # Start a worker node
115
+ distllm-node --node-id laptop --model meta-llama/Llama-3.2-7B \
116
+ --start-layer 0 --end-layer 5 --total-layers 18 \
117
+ --coordinator-host 192.168.1.100 --coordinator-port 50050
118
+
119
+ # Start the REST API server
120
+ distllm-api --model meta-llama/Llama-3.2-1B --local
121
+
122
+ # System diagnostics (check Python, CUDA, GPU, network, ports)
123
+ distllm doctor
124
+
125
+ # Quantize a model for smaller footprint
126
+ distllm tune quantize --model meta-llama/Llama-3.2-7B --bits 4
127
+
128
+ # Batch inference over a dataset
129
+ distllm tune batch --input prompts.jsonl --output results.jsonl
130
+
131
+ # Warm the semantic cache from prior prompts
132
+ distllm tune cache --preload cache_seed.jsonl
133
+ ```
134
+
135
+ ## Documentation
136
+
137
+ - [Architecture](docs/architecture.md) — Pipeline parallelism, node topology, KV cache management
138
+ - [Deployment](DEPLOYMENT.md) — Local, Docker, and multi-machine deployment
139
+ - [API Reference](docs/api.md) — OpenAI-compatible API docs
140
+
141
+ ## Project Structure
142
+
143
+ ```
144
+ src/distllm/
145
+ ├── core/ # Coordinator, request pipeline, batch scheduler
146
+ ├── dist/ # Distributed inference engine
147
+ │ ├── pipeline.py # PipelineOrchestrator — multi-node execution
148
+ │ ├── worker.py # WorkerNode — per-device model subset
149
+ │ ├── recovery.py # NodeRecoveryManager — failure handling
150
+ │ ├── straggler.py # StragglerDetector — slow node detection
151
+ │ ├── rebalancer.py # Dynamic pipeline rebalancing
152
+ │ ├── wide_area.py # WAN-optimized inference
153
+ │ ├── parallel.py # Hybrid parallelism auto-selector
154
+ │ ├── p2p/ # P2P gossip protocol & discovery
155
+ │ └── partition/ # Hardware-aware auto-partitioner
156
+ ├── api/ # OpenAI-compatible REST API
157
+ ├── models/ # Model partitioning & loading
158
+ ├── cli/ # CLI tool
159
+ ├── sdk/ # Python client
160
+ ├── observability/ # Metrics, tracing, logging
161
+ └── dashboard/ # Web dashboard
162
+ ```
163
+
164
+ ## Supported Model Architectures
165
+
166
+ GPT-2, GPT-Neo, Llama 2/3, Mistral, Mixtral, Qwen2.5, Phi, DeepSeek, StableLM, Pythia, Baichuan, ChatGLM, InternLM, and more via HuggingFace AutoModel.
167
+
168
+ ## Roadmap
169
+
170
+ - **Current**: Pipeline parallelism across LAN devices, manual node configuration
171
+ - **Q3 2026**: Auto-discovery (mDNS), auto-partitioning, node recovery, GUI dashboard
172
+ - **Q4 2026**: NAT traversal (cross-internet), P2P model distribution, GPU reputation system
173
+ - **2027**: Federated clusters, speculative parallelism, privacy-preserving split, incentive system
174
+
175
+ ## Contributing
176
+
177
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
178
+
179
+ ## License
180
+
181
+ Apache 2.0. See [LICENSE](LICENSE).