isagellm-core 0.4.0.8__tar.gz → 0.4.0.11__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 (149) hide show
  1. {isagellm_core-0.4.0.8/src/isagellm_core.egg-info → isagellm_core-0.4.0.11}/PKG-INFO +27 -1
  2. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/README.md +26 -0
  3. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/pyproject.toml +1 -1
  4. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11/src/isagellm_core.egg-info}/PKG-INFO +27 -1
  5. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/isagellm_core.egg-info/SOURCES.txt +15 -0
  6. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__init__.py +1 -1
  7. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__init__.pyc +0 -0
  8. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__main__.pyc +0 -0
  9. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/__init__.cpython-311.pyc +0 -0
  10. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/base_engine.cpython-311.pyc +0 -0
  11. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/config.cpython-311.pyc +0 -0
  12. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/demo.cpython-311.pyc +0 -0
  13. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/engine.cpython-311.pyc +0 -0
  14. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/engine_factory.cpython-311.pyc +0 -0
  15. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/engine_server.cpython-311.pyc +0 -0
  16. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/factory.cpython-311.pyc +0 -0
  17. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/health.cpython-311.pyc +0 -0
  18. isagellm_core-0.4.0.11/src/sagellm_core/__pycache__/llm_engine.cpython-311.pyc +0 -0
  19. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/mock_engine.cpython-311.pyc +0 -0
  20. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/pd_executor.cpython-311.pyc +0 -0
  21. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/plugins.cpython-311.pyc +0 -0
  22. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/runner.cpython-311.pyc +0 -0
  23. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/runtime.cpython-311.pyc +0 -0
  24. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/__pycache__/workload.cpython-311.pyc +0 -0
  25. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/config.pyc +0 -0
  26. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__init__.py +43 -0
  27. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__init__.pyc +0 -0
  28. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__pycache__/__init__.cpython-311.pyc +0 -0
  29. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__pycache__/base.cpython-311.pyc +0 -0
  30. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__pycache__/beam_search.cpython-311.pyc +0 -0
  31. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__pycache__/contrastive.cpython-311.pyc +0 -0
  32. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__pycache__/greedy.cpython-311.pyc +0 -0
  33. isagellm_core-0.4.0.11/src/sagellm_core/decoding/__pycache__/sampling.cpython-311.pyc +0 -0
  34. isagellm_core-0.4.0.11/src/sagellm_core/decoding/base.pyc +0 -0
  35. isagellm_core-0.4.0.11/src/sagellm_core/decoding/beam_search.pyc +0 -0
  36. isagellm_core-0.4.0.11/src/sagellm_core/decoding/contrastive.pyc +0 -0
  37. isagellm_core-0.4.0.11/src/sagellm_core/decoding/greedy.pyc +0 -0
  38. isagellm_core-0.4.0.11/src/sagellm_core/decoding/sampling.pyc +0 -0
  39. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/demo.pyc +0 -0
  40. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/distributed/__init__.pyc +0 -0
  41. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/distributed/__pycache__/__init__.cpython-311.pyc +0 -0
  42. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/distributed/__pycache__/strategies.cpython-311.pyc +0 -0
  43. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/distributed/strategies.pyc +0 -0
  44. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine.pyc +0 -0
  45. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/__init__.pyc +0 -0
  46. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/__pycache__/__init__.cpython-311.pyc +0 -0
  47. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/__pycache__/engine_core.cpython-311.pyc +0 -0
  48. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/engine_core.pyc +0 -0
  49. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/scheduler/__init__.pyc +0 -0
  50. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/scheduler/__pycache__/__init__.cpython-311.pyc +0 -0
  51. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/scheduler/__pycache__/scheduler.cpython-311.pyc +0 -0
  52. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/scheduler/scheduler.pyc +0 -0
  53. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_factory.pyc +0 -0
  54. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_server.pyc +0 -0
  55. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__init__.pyc +0 -0
  56. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/__init__.cpython-311.pyc +0 -0
  57. isagellm_core-0.4.0.11/src/sagellm_core/engines/__pycache__/ascend.cpython-311.pyc +0 -0
  58. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/cpu.cpython-311.pyc +0 -0
  59. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/embedding.cpython-311.pyc +0 -0
  60. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/hf_cuda.cpython-311.pyc +0 -0
  61. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/mock.cpython-311.pyc +0 -0
  62. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/pytorch.cpython-311.pyc +0 -0
  63. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__pycache__/pytorch_engine.cpython-311.pyc +0 -0
  64. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/embedding.pyc +0 -0
  65. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/__init__.pyc +0 -0
  66. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/__pycache__/__init__.cpython-311.pyc +0 -0
  67. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/__pycache__/executor_base.cpython-311.pyc +0 -0
  68. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/__pycache__/uniproc_executor.cpython-311.pyc +0 -0
  69. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/executor_base.pyc +0 -0
  70. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/uniproc_executor.pyc +0 -0
  71. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/factory.pyc +0 -0
  72. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/health.pyc +0 -0
  73. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/__init__.pyc +0 -0
  74. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/__pycache__/__init__.cpython-311.pyc +0 -0
  75. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/__pycache__/processor.cpython-311.pyc +0 -0
  76. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/__pycache__/tokenizer_utils.cpython-311.pyc +0 -0
  77. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/processor.pyc +0 -0
  78. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/tokenizer_utils.pyc +0 -0
  79. isagellm_core-0.4.0.11/src/sagellm_core/llm_engine.pyc +0 -0
  80. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/__init__.pyc +0 -0
  81. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/__pycache__/__init__.cpython-311.pyc +0 -0
  82. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/__pycache__/model_loader.cpython-311.pyc +0 -0
  83. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/__pycache__/weight_utils.cpython-311.pyc +0 -0
  84. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/model_loader.pyc +0 -0
  85. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/weight_utils.pyc +0 -0
  86. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/__init__.pyc +0 -0
  87. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/__pycache__/__init__.cpython-311.pyc +0 -0
  88. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/__pycache__/logger.cpython-311.pyc +0 -0
  89. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/__pycache__/metrics.cpython-311.pyc +0 -0
  90. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/logger.pyc +0 -0
  91. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/metrics.pyc +0 -0
  92. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/pd_executor.pyc +0 -0
  93. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/plugins.pyc +0 -0
  94. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/runner.pyc +0 -0
  95. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/runtime.pyc +0 -0
  96. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/__init__.pyc +0 -0
  97. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/__pycache__/__init__.cpython-311.pyc +0 -0
  98. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/__pycache__/params.cpython-311.pyc +0 -0
  99. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/__pycache__/sampler.cpython-311.pyc +0 -0
  100. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/params.pyc +0 -0
  101. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/sampler.pyc +0 -0
  102. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/__init__.pyc +0 -0
  103. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/__pycache__/__init__.cpython-311.pyc +0 -0
  104. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/__pycache__/worker.cpython-311.pyc +0 -0
  105. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/model_runner/__init__.pyc +0 -0
  106. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/model_runner/__pycache__/__init__.cpython-311.pyc +0 -0
  107. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/model_runner/__pycache__/model_runner.cpython-311.pyc +0 -0
  108. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/model_runner/model_runner.pyc +0 -0
  109. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/worker.pyc +0 -0
  110. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/workload.pyc +0 -0
  111. isagellm_core-0.4.0.11/tests/test_decoding_strategies.py +192 -0
  112. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_engine.py +11 -8
  113. isagellm_core-0.4.0.11/tests/test_llm_engine_decoding.py +108 -0
  114. isagellm_core-0.4.0.8/src/sagellm_core/__pycache__/llm_engine.cpython-311.pyc +0 -0
  115. isagellm_core-0.4.0.8/src/sagellm_core/engines/__pycache__/ascend.cpython-311.pyc +0 -0
  116. isagellm_core-0.4.0.8/src/sagellm_core/llm_engine.pyc +0 -0
  117. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/MANIFEST.in +0 -0
  118. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/setup.cfg +0 -0
  119. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/setup.py +0 -0
  120. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/isagellm_core.egg-info/dependency_links.txt +0 -0
  121. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/isagellm_core.egg-info/entry_points.txt +0 -0
  122. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/isagellm_core.egg-info/requires.txt +0 -0
  123. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/isagellm_core.egg-info/top_level.txt +0 -0
  124. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/distributed/__init__.py +0 -0
  125. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/__init__.py +0 -0
  126. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engine_core/scheduler/__init__.py +0 -0
  127. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/engines/__init__.py +0 -0
  128. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/executor/__init__.py +0 -0
  129. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/inputs/__init__.py +0 -0
  130. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/model/__init__.py +0 -0
  131. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/observability/__init__.py +0 -0
  132. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/py.typed +0 -0
  133. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/sampling/__init__.py +0 -0
  134. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/__init__.py +0 -0
  135. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/src/sagellm_core/worker/model_runner/__init__.py +0 -0
  136. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_ci_smoke.py +0 -0
  137. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_config.py +0 -0
  138. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_e2e_llm_integration.py +0 -0
  139. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_engine_behavior_parity.py +0 -0
  140. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_engine_contract_simplified.py +0 -0
  141. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_engine_server.py +0 -0
  142. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_llm_engine_contract.py +0 -0
  143. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_llm_engine_error_handling.py +0 -0
  144. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_model_loader.py +0 -0
  145. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_observability.py +0 -0
  146. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_pd_separation.py +0 -0
  147. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_sampling.py +0 -0
  148. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_streaming_pd.py +0 -0
  149. {isagellm_core-0.4.0.8 → isagellm_core-0.4.0.11}/tests/test_task0_10_workload.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isagellm-core
3
- Version: 0.4.0.8
3
+ Version: 0.4.0.11
4
4
  Summary: sageLLM core runtime with PD separation (MVP)
5
5
  Author: IntelliStream Team
6
6
  License: Proprietary - IntelliStream
@@ -280,3 +280,29 @@ pre-commit run --all-files
280
280
  - `isagellm` - Main package with CLI
281
281
 
282
282
  For more packages, see the [sageLLM ecosystem](https://github.com/intellistream/sagellm)
283
+
284
+ ## 🔄 贡献指南
285
+
286
+ 请遵循以下工作流程:
287
+
288
+ 1. **创建 Issue** - 描述问题/需求
289
+ ```bash
290
+ gh issue create --title "[Bug] 描述" --label "bug,sagellm-core"
291
+ ```
292
+
293
+ 2. **开发修复** - 在本地 `fix/#123-xxx` 分支解决
294
+ ```bash
295
+ git checkout -b fix/#123-xxx origin/main-dev
296
+ # 开发、测试...
297
+ pytest -v
298
+ ruff format . && ruff check . --fix
299
+ ```
300
+
301
+ 3. **发起 PR** - 提交到 `main-dev` 分支
302
+ ```bash
303
+ gh pr create --base main-dev --title "Fix: 描述" --body "Closes #123"
304
+ ```
305
+
306
+ 4. **合并** - 审批后合并到 `main-dev`
307
+
308
+ 更多详情见 [.github/copilot-instructions.md](.github/copilot-instructions.md)
@@ -246,3 +246,29 @@ pre-commit run --all-files
246
246
  - `isagellm` - Main package with CLI
247
247
 
248
248
  For more packages, see the [sageLLM ecosystem](https://github.com/intellistream/sagellm)
249
+
250
+ ## 🔄 贡献指南
251
+
252
+ 请遵循以下工作流程:
253
+
254
+ 1. **创建 Issue** - 描述问题/需求
255
+ ```bash
256
+ gh issue create --title "[Bug] 描述" --label "bug,sagellm-core"
257
+ ```
258
+
259
+ 2. **开发修复** - 在本地 `fix/#123-xxx` 分支解决
260
+ ```bash
261
+ git checkout -b fix/#123-xxx origin/main-dev
262
+ # 开发、测试...
263
+ pytest -v
264
+ ruff format . && ruff check . --fix
265
+ ```
266
+
267
+ 3. **发起 PR** - 提交到 `main-dev` 分支
268
+ ```bash
269
+ gh pr create --base main-dev --title "Fix: 描述" --body "Closes #123"
270
+ ```
271
+
272
+ 4. **合并** - 审批后合并到 `main-dev`
273
+
274
+ 更多详情见 [.github/copilot-instructions.md](.github/copilot-instructions.md)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "isagellm-core"
7
- version = "0.4.0.8"
7
+ version = "0.4.0.11"
8
8
  description = "sageLLM core runtime with PD separation (MVP)"
9
9
  readme = "README.md"
10
10
  requires-python = "==3.11.*"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isagellm-core
3
- Version: 0.4.0.8
3
+ Version: 0.4.0.11
4
4
  Summary: sageLLM core runtime with PD separation (MVP)
5
5
  Author: IntelliStream Team
6
6
  License: Proprietary - IntelliStream
@@ -280,3 +280,29 @@ pre-commit run --all-files
280
280
  - `isagellm` - Main package with CLI
281
281
 
282
282
  For more packages, see the [sageLLM ecosystem](https://github.com/intellistream/sagellm)
283
+
284
+ ## 🔄 贡献指南
285
+
286
+ 请遵循以下工作流程:
287
+
288
+ 1. **创建 Issue** - 描述问题/需求
289
+ ```bash
290
+ gh issue create --title "[Bug] 描述" --label "bug,sagellm-core"
291
+ ```
292
+
293
+ 2. **开发修复** - 在本地 `fix/#123-xxx` 分支解决
294
+ ```bash
295
+ git checkout -b fix/#123-xxx origin/main-dev
296
+ # 开发、测试...
297
+ pytest -v
298
+ ruff format . && ruff check . --fix
299
+ ```
300
+
301
+ 3. **发起 PR** - 提交到 `main-dev` 分支
302
+ ```bash
303
+ gh pr create --base main-dev --title "Fix: 描述" --body "Closes #123"
304
+ ```
305
+
306
+ 4. **合并** - 审批后合并到 `main-dev`
307
+
308
+ 更多详情见 [.github/copilot-instructions.md](.github/copilot-instructions.md)
@@ -41,6 +41,19 @@ src/sagellm_core/__pycache__/plugins.cpython-311.pyc
41
41
  src/sagellm_core/__pycache__/runner.cpython-311.pyc
42
42
  src/sagellm_core/__pycache__/runtime.cpython-311.pyc
43
43
  src/sagellm_core/__pycache__/workload.cpython-311.pyc
44
+ src/sagellm_core/decoding/__init__.py
45
+ src/sagellm_core/decoding/__init__.pyc
46
+ src/sagellm_core/decoding/base.pyc
47
+ src/sagellm_core/decoding/beam_search.pyc
48
+ src/sagellm_core/decoding/contrastive.pyc
49
+ src/sagellm_core/decoding/greedy.pyc
50
+ src/sagellm_core/decoding/sampling.pyc
51
+ src/sagellm_core/decoding/__pycache__/__init__.cpython-311.pyc
52
+ src/sagellm_core/decoding/__pycache__/base.cpython-311.pyc
53
+ src/sagellm_core/decoding/__pycache__/beam_search.cpython-311.pyc
54
+ src/sagellm_core/decoding/__pycache__/contrastive.cpython-311.pyc
55
+ src/sagellm_core/decoding/__pycache__/greedy.cpython-311.pyc
56
+ src/sagellm_core/decoding/__pycache__/sampling.cpython-311.pyc
44
57
  src/sagellm_core/distributed/__init__.py
45
58
  src/sagellm_core/distributed/__init__.pyc
46
59
  src/sagellm_core/distributed/strategies.pyc
@@ -114,12 +127,14 @@ src/sagellm_core/worker/model_runner/__pycache__/__init__.cpython-311.pyc
114
127
  src/sagellm_core/worker/model_runner/__pycache__/model_runner.cpython-311.pyc
115
128
  tests/test_ci_smoke.py
116
129
  tests/test_config.py
130
+ tests/test_decoding_strategies.py
117
131
  tests/test_e2e_llm_integration.py
118
132
  tests/test_engine.py
119
133
  tests/test_engine_behavior_parity.py
120
134
  tests/test_engine_contract_simplified.py
121
135
  tests/test_engine_server.py
122
136
  tests/test_llm_engine_contract.py
137
+ tests/test_llm_engine_decoding.py
123
138
  tests/test_llm_engine_error_handling.py
124
139
  tests/test_model_loader.py
125
140
  tests/test_observability.py
@@ -26,7 +26,7 @@ Architecture (vLLM v1 style):
26
26
 
27
27
  from __future__ import annotations
28
28
 
29
- __version__ = "0.4.0.8"
29
+ __version__ = "0.4.0.11"
30
30
 
31
31
  # ============================================================================
32
32
  # New Architecture (vLLM v1 style) - Hardware Agnostic
@@ -0,0 +1,43 @@
1
+ from __future__ import annotations
2
+
3
+ from sagellm_protocol.sampling import DecodingStrategy, SamplingParams
4
+
5
+ from sagellm_core.decoding.base import DecodingStrategyBase
6
+ from sagellm_core.decoding.beam_search import BeamSearchDecoding
7
+ from sagellm_core.decoding.contrastive import ContrastiveSearchDecoding
8
+ from sagellm_core.decoding.greedy import GreedyDecoding
9
+ from sagellm_core.decoding.sampling import SamplingDecoding
10
+
11
+
12
+ def create_decoding_strategy(params: SamplingParams) -> DecodingStrategyBase:
13
+ """工厂函数:根据 SamplingParams 创建解码策略
14
+
15
+ Args:
16
+ params: 采样参数配置
17
+
18
+ Returns:
19
+ 对应的解码策略实例
20
+
21
+ Raises:
22
+ ValueError: 不支持的解码策略
23
+ """
24
+ if params.strategy == DecodingStrategy.GREEDY:
25
+ return GreedyDecoding(params)
26
+ elif params.strategy == DecodingStrategy.SAMPLING:
27
+ return SamplingDecoding(params)
28
+ elif params.strategy == DecodingStrategy.BEAM_SEARCH:
29
+ return BeamSearchDecoding(params)
30
+ elif params.strategy == DecodingStrategy.CONTRASTIVE:
31
+ return ContrastiveSearchDecoding(params)
32
+ else:
33
+ raise ValueError(f"Unsupported decoding strategy: {params.strategy}")
34
+
35
+
36
+ __all__ = [
37
+ "DecodingStrategyBase",
38
+ "GreedyDecoding",
39
+ "SamplingDecoding",
40
+ "BeamSearchDecoding",
41
+ "ContrastiveSearchDecoding",
42
+ "create_decoding_strategy",
43
+ ]
@@ -0,0 +1,192 @@
1
+ """Tests for decoding strategies"""
2
+
3
+ from __future__ import annotations
4
+
5
+ import pytest
6
+
7
+ from sagellm_protocol.sampling import DecodingStrategy, SamplingParams
8
+
9
+ from sagellm_core.decoding import (
10
+ BeamSearchDecoding,
11
+ ContrastiveSearchDecoding,
12
+ GreedyDecoding,
13
+ SamplingDecoding,
14
+ create_decoding_strategy,
15
+ )
16
+
17
+
18
+ class TestSamplingParamsInference:
19
+ """Test SamplingParams automatic strategy inference
20
+
21
+ 用户可以通过参数推断策略,而不是显式指定 strategy。
22
+ 例如:temperature > 1.0 自动触发 SAMPLING 策略。
23
+ """
24
+
25
+ def test_default_is_greedy(self):
26
+ """默认应该是贪婪解码"""
27
+ params = SamplingParams()
28
+ assert params.strategy == DecodingStrategy.GREEDY
29
+ # Note: is_greedy 等辅助属性需要在 sagellm-protocol 中实现
30
+
31
+ def test_explicit_greedy(self):
32
+ """显式指定 GREEDY 策略"""
33
+ params = SamplingParams(strategy=DecodingStrategy.GREEDY)
34
+ assert params.strategy == DecodingStrategy.GREEDY
35
+
36
+ def test_explicit_sampling(self):
37
+ """显式指定 SAMPLING 策略(即使 temperature=1.0)"""
38
+ params = SamplingParams(strategy=DecodingStrategy.SAMPLING, temperature=0.7)
39
+ assert params.strategy == DecodingStrategy.SAMPLING
40
+
41
+ def test_explicit_beam_search(self):
42
+ """显式指定 BEAM_SEARCH 策略"""
43
+ params = SamplingParams(strategy=DecodingStrategy.BEAM_SEARCH, beam_size=5)
44
+ assert params.strategy == DecodingStrategy.BEAM_SEARCH
45
+
46
+ def test_explicit_contrastive(self):
47
+ """显式指定 CONTRASTIVE 策略"""
48
+ params = SamplingParams(
49
+ strategy=DecodingStrategy.CONTRASTIVE,
50
+ penalty_alpha=0.6,
51
+ )
52
+ assert params.strategy == DecodingStrategy.CONTRASTIVE
53
+
54
+
55
+ class TestGreedyDecoding:
56
+ """Test greedy decoding strategy"""
57
+
58
+ def test_greedy_basic(self):
59
+ """Test basic greedy decoding"""
60
+ params = SamplingParams(strategy=DecodingStrategy.GREEDY, max_tokens=100)
61
+ strategy = GreedyDecoding(params)
62
+
63
+ assert strategy.get_strategy_name() == "Greedy Decoding"
64
+
65
+ kwargs = strategy.to_generate_kwargs()
66
+ assert kwargs["max_new_tokens"] == 100
67
+ assert kwargs["do_sample"] is False
68
+ assert "pad_token_id" in kwargs
69
+
70
+
71
+ class TestSamplingDecoding:
72
+ """Test temperature sampling strategy"""
73
+
74
+ def test_sampling_basic(self):
75
+ """Test basic temperature sampling"""
76
+ params = SamplingParams(
77
+ strategy=DecodingStrategy.SAMPLING, temperature=0.7, top_p=0.9, max_tokens=200
78
+ )
79
+ strategy = SamplingDecoding(params)
80
+
81
+ assert "Temperature Sampling" in strategy.get_strategy_name()
82
+
83
+ kwargs = strategy.to_generate_kwargs()
84
+ assert kwargs["max_new_tokens"] == 200
85
+ assert kwargs["do_sample"] is True
86
+ assert kwargs["temperature"] == 0.7
87
+ assert kwargs["top_p"] == 0.9
88
+
89
+ def test_sampling_with_top_k(self):
90
+ """Test sampling with top_k"""
91
+ params = SamplingParams(
92
+ strategy=DecodingStrategy.SAMPLING,
93
+ temperature=0.8,
94
+ top_k=50,
95
+ max_tokens=150,
96
+ )
97
+ strategy = SamplingDecoding(params)
98
+
99
+ kwargs = strategy.to_generate_kwargs()
100
+ assert kwargs["top_k"] == 50
101
+
102
+ def test_sampling_with_repetition_penalty(self):
103
+ """Test sampling with repetition penalty"""
104
+ params = SamplingParams(
105
+ strategy=DecodingStrategy.SAMPLING,
106
+ temperature=0.7,
107
+ repetition_penalty=1.2,
108
+ max_tokens=150,
109
+ )
110
+ strategy = SamplingDecoding(params)
111
+
112
+ kwargs = strategy.to_generate_kwargs()
113
+ assert kwargs["repetition_penalty"] == 1.2
114
+
115
+
116
+ class TestBeamSearchDecoding:
117
+ """Test beam search strategy"""
118
+
119
+ def test_beam_search_basic(self):
120
+ """Test basic beam search"""
121
+ params = SamplingParams(
122
+ strategy=DecodingStrategy.BEAM_SEARCH,
123
+ beam_size=5,
124
+ length_penalty=0.8,
125
+ max_tokens=150,
126
+ )
127
+ strategy = BeamSearchDecoding(params)
128
+
129
+ assert "Beam Search" in strategy.get_strategy_name()
130
+ assert "beams=5" in strategy.get_strategy_name()
131
+
132
+ kwargs = strategy.to_generate_kwargs()
133
+ assert kwargs["max_new_tokens"] == 150
134
+ assert kwargs["num_beams"] == 5
135
+ assert kwargs["length_penalty"] == 0.8
136
+ assert kwargs["early_stopping"] is True
137
+
138
+
139
+ class TestContrastiveSearchDecoding:
140
+ """Test contrastive search strategy"""
141
+
142
+ def test_contrastive_basic(self):
143
+ """Test basic contrastive search"""
144
+ params = SamplingParams(
145
+ strategy=DecodingStrategy.CONTRASTIVE, penalty_alpha=0.6, max_tokens=300
146
+ )
147
+ strategy = ContrastiveSearchDecoding(params)
148
+
149
+ assert "Contrastive Search" in strategy.get_strategy_name()
150
+ assert "alpha=0.60" in strategy.get_strategy_name()
151
+
152
+ kwargs = strategy.to_generate_kwargs()
153
+ assert kwargs["max_new_tokens"] == 300
154
+ assert kwargs["penalty_alpha"] == 0.6
155
+ assert kwargs["top_k"] == 4 # Default for contrastive search
156
+
157
+
158
+ class TestDecodingStrategyFactory:
159
+ """Test strategy factory function"""
160
+
161
+ def test_create_greedy(self):
162
+ """Test creating greedy strategy"""
163
+ params = SamplingParams(strategy=DecodingStrategy.GREEDY)
164
+ strategy = create_decoding_strategy(params)
165
+ assert isinstance(strategy, GreedyDecoding)
166
+
167
+ def test_create_sampling(self):
168
+ """Test creating sampling strategy"""
169
+ params = SamplingParams(strategy=DecodingStrategy.SAMPLING, temperature=0.7)
170
+ strategy = create_decoding_strategy(params)
171
+ assert isinstance(strategy, SamplingDecoding)
172
+
173
+ def test_create_beam_search(self):
174
+ """Test creating beam search strategy"""
175
+ params = SamplingParams(strategy=DecodingStrategy.BEAM_SEARCH, beam_size=4)
176
+ strategy = create_decoding_strategy(params)
177
+ assert isinstance(strategy, BeamSearchDecoding)
178
+
179
+ def test_create_contrastive(self):
180
+ """Test creating contrastive strategy"""
181
+ params = SamplingParams(strategy=DecodingStrategy.CONTRASTIVE, penalty_alpha=0.6)
182
+ strategy = create_decoding_strategy(params)
183
+ assert isinstance(strategy, ContrastiveSearchDecoding)
184
+
185
+ def test_unsupported_strategy(self):
186
+ """Test unsupported strategy raises error"""
187
+ params = SamplingParams(strategy=DecodingStrategy.GREEDY)
188
+ # Manually set invalid strategy
189
+ params.strategy = "invalid_strategy" # type: ignore
190
+
191
+ with pytest.raises(ValueError, match="Unsupported decoding strategy"):
192
+ create_decoding_strategy(params)
@@ -162,13 +162,13 @@ def test_health_status_enum() -> None:
162
162
  @pytest.mark.skip(reason="TestCPUEngine has been removed in favor of LLMEngine")
163
163
  def test_create_cpu_test_engine() -> None:
164
164
  """Test creating lightweight CPU test engine instance"""
165
- config = EngineInstanceConfig(engine_id="test-cpu-1", model_path="sshleifer/tiny-gpt2")
166
- engine = TestCPUEngine(config)
167
-
168
- assert engine is not None
169
- assert hasattr(engine, "start")
170
- assert hasattr(engine, "execute")
171
- assert hasattr(engine, "stream")
165
+ # config = EngineInstanceConfig(engine_id="test-cpu-1", model_path="sshleifer/tiny-gpt2")
166
+ # engine = TestCPUEngine(config)
167
+ # assert engine is not None
168
+ # assert hasattr(engine, "start")
169
+ # assert hasattr(engine, "execute")
170
+ # assert hasattr(engine, "stream")
171
+ pass
172
172
 
173
173
 
174
174
  def test_create_engine_invalid_config() -> None:
@@ -234,6 +234,7 @@ async def test_engine_execute() -> None:
234
234
 
235
235
 
236
236
  @pytest.mark.asyncio
237
+ @pytest.mark.timeout(180) # 增加超时时间到 3 分钟
237
238
  async def test_engine_stream() -> None:
238
239
  """Test engine streaming"""
239
240
  from sagellm_core import LLMEngine
@@ -299,7 +300,9 @@ async def test_engine_get_info() -> None:
299
300
  pass
300
301
 
301
302
 
302
- @pytest.mark.skip(reason="LLMEngine does not have class methods is_available(), priority(), backend_type()")
303
+ @pytest.mark.skip(
304
+ reason="LLMEngine does not have class methods is_available(), priority(), backend_type()"
305
+ )
303
306
  def test_engine_class_methods() -> None:
304
307
  """Test Engine class methods (skipped - these are implementation details)"""
305
308
  pass
@@ -0,0 +1,108 @@
1
+ """集成测试:LLMEngine + 解码策略系统
2
+
3
+ 测试 LLMEngine 与解码策略的完整集成,包括:
4
+ - 默认贪婪解码行为
5
+ - 向后兼容的参数传递
6
+ - SamplingParams 对象使用
7
+ - 参数优先级处理
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import pytest
13
+ import pytest_asyncio
14
+
15
+ from sagellm_core import LLMEngine, LLMEngineConfig
16
+ from sagellm_protocol.sampling import DecodingStrategy, SamplingParams
17
+
18
+
19
+ @pytest_asyncio.fixture
20
+ async def engine():
21
+ """创建测试用 LLMEngine 实例"""
22
+ config = LLMEngineConfig(
23
+ model_path="sshleifer/tiny-gpt2", # 使用小模型快速测试
24
+ backend_type="cpu",
25
+ max_new_tokens=20,
26
+ )
27
+ engine = LLMEngine(config)
28
+ await engine.start()
29
+ yield engine
30
+ await engine.stop()
31
+
32
+
33
+ @pytest.mark.asyncio
34
+ async def test_default_greedy_decoding(engine):
35
+ """测试默认参数使用贪婪解码(temperature=0.0)"""
36
+ response = await engine.generate("Hello, how are")
37
+
38
+ assert response.output_text is not None
39
+ assert len(response.output_text) > 0
40
+ assert response.metrics.ttft_ms is not None
41
+ print(f"✓ 默认贪婪解码输出: {response.output_text[:100]}...")
42
+
43
+
44
+ @pytest.mark.asyncio
45
+ async def test_backward_compatible_params(engine):
46
+ """测试向后兼容的参数传递"""
47
+ response = await engine.generate("The weather today is", temperature=0.8, top_p=0.9, top_k=50)
48
+
49
+ assert response.output_text is not None
50
+ assert len(response.output_text) > 0
51
+ print(f"✓ 向后兼容参数输出: {response.output_text[:100]}...")
52
+
53
+
54
+ @pytest.mark.asyncio
55
+ async def test_sampling_params_object(engine):
56
+ """测试使用 SamplingParams 对象(推荐方式)"""
57
+ params = SamplingParams(
58
+ strategy=DecodingStrategy.SAMPLING,
59
+ max_tokens=15,
60
+ temperature=0.7,
61
+ top_p=0.9,
62
+ top_k=40,
63
+ )
64
+
65
+ response = await engine.generate("Once upon a time", sampling_params=params)
66
+
67
+ assert response.output_text is not None
68
+ assert len(response.output_text) > 0
69
+ print(f"✓ SamplingParams 对象输出: {response.output_text[:100]}...")
70
+
71
+
72
+ @pytest.mark.asyncio
73
+ async def test_sampling_params_override(engine):
74
+ """测试 SamplingParams 覆盖向后兼容参数"""
75
+ # SamplingParams 应优先于单独参数
76
+ params = SamplingParams(
77
+ strategy=DecodingStrategy.GREEDY,
78
+ temperature=0.0, # 贪婪解码
79
+ )
80
+
81
+ response = await engine.generate(
82
+ "Hello",
83
+ temperature=0.9, # 这个会被 SamplingParams 覆盖
84
+ sampling_params=params,
85
+ )
86
+
87
+ assert response.output_text is not None
88
+ assert len(response.output_text) > 0
89
+ print(f"✓ 参数优先级测试输出: {response.output_text[:100]}...")
90
+
91
+
92
+ @pytest.mark.asyncio
93
+ async def test_reproducible_sampling(engine):
94
+ """测试使用 seed 的可复现采样"""
95
+ params = SamplingParams(
96
+ strategy=DecodingStrategy.SAMPLING,
97
+ temperature=0.7,
98
+ top_p=0.9,
99
+ seed=42,
100
+ max_tokens=10,
101
+ )
102
+
103
+ response1 = await engine.generate("Hello", sampling_params=params)
104
+ response2 = await engine.generate("Hello", sampling_params=params)
105
+
106
+ # 相同 seed 应产生相同结果
107
+ assert response1.output_text == response2.output_text
108
+ print(f"✓ 可复现采样输出: {response1.output_text}")