isagellm-core 0.1.0.2__cp311-none-any.whl → 0.1.0.3__cp311-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isagellm-core
3
- Version: 0.1.0.2
3
+ Version: 0.1.0.3
4
4
  Summary: sageLLM core runtime (config/observability/registries), plugin-ready
5
5
  Author: IntelliStream Team
6
6
  License: Proprietary - IntelliStream
@@ -32,23 +32,15 @@ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
32
32
  [![License](https://img.shields.io/github/license/intellistream/sagellm-core.svg)](https://github.com/intellistream/sagellm-core/blob/main/LICENSE)
33
33
  [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
34
34
 
35
- core 只依赖协议与抽象,不直接 import 硬件 SDK。
35
+ sageLLM Core - Engine runtime and configuration system for LLM inference.
36
36
 
37
- - 仓库名:`sagellm-core`
38
- - PyPI 包名:`isagellm-core`
39
- - import 名:`sagellm_core`
37
+ ## Features
40
38
 
41
- ## 架构层级
42
-
43
- sagellm-core 位于 **Level 2**,依赖:
44
- - **Level 0**: `isagellm-protocol` (协议定义)
45
- - **Level 1**: `isagellm-backend` (后端抽象,包含 BackendProvider)
46
-
47
- 为下游提供:
48
- - 配置体系(config.py)
49
- - Engine 抽象接口(engine.py)
50
- - 插件发现机制(plugins.py)
51
- - 工厂函数(factory.py)
39
+ - 🔧 Flexible configuration system (YAML/JSON)
40
+ - 🔌 Plugin-based backend and engine discovery
41
+ - 🎯 Mock mode for development and testing
42
+ - 📊 Built-in demo runner for benchmarking
43
+ - Type-safe with Pydantic v2
52
44
 
53
45
  ## 安装
54
46
 
@@ -85,14 +77,7 @@ python -m sagellm_core.demo --mock --segments short
85
77
  > pip install -e ../sagellm-backend
86
78
  > ```
87
79
 
88
- ## 插件发现(entry points)
89
-
90
- - backends:`sagellm.backends`(由 sagellm-backend 提供基础实现)
91
- - engines:`sagellm.engines`(由各 engine 包提供实现)
92
-
93
- core 在运行时扫描 entry points;当配置指定 kind 但未安装插件时必须 fail-fast,并给出安装提示。
94
-
95
- ## 配置系统(Task0.02)
80
+ ## Configuration System
96
81
 
97
82
  ### 使用方法
98
83
 
@@ -107,20 +92,15 @@ backend = create_backend(config.backend)
107
92
  engine = create_engine(config.engine, backend)
108
93
  ```
109
94
 
110
- ### 配置结构
95
+ ### Configuration Structure
111
96
 
112
- 所有配置类均使用 pydantic v2 实现严格校验:
113
- - 缺失必填字段立即抛出 `ValidationError`
114
- - 未知字段被拒绝(`extra="forbid"`)
115
- - 数值约束被强制执行
116
-
117
- 主要配置类:
118
- - `BackendConfig`: 后端设备配置(kind, device, device_ids)
119
- - `EngineConfig`: 推理引擎配置(kind, model, model_path, 等)
120
- - `WorkloadConfig`: 工作负载配置(segments, concurrency, kv_budget_tokens, 等)
121
- - `OutputConfig`: 输出配置(metrics_path, report_path, log_path, log_level)
122
- - `MockConfig`: 模拟模式配置(enable, fixed_latency_ms, jitter_ms, error_rate)
123
- - `DemoConfig`: 顶层配置(包含以上所有配置 + 特性开关)
97
+ Main configuration components:
98
+ - `BackendConfig`: Device and backend settings
99
+ - `EngineConfig`: Inference engine configuration
100
+ - `WorkloadConfig`: Workload parameters
101
+ - `OutputConfig`: Output paths and logging
102
+ - `MockConfig`: Mock mode settings for testing
103
+ - `DemoConfig`: Top-level demo configuration
124
104
 
125
105
  ### 配置示例
126
106
 
@@ -224,18 +204,7 @@ output:
224
204
  report_path: ./output/report.md
225
205
  ```
226
206
 
227
- ### 验收标准(Task0.08)
228
-
229
- - [x] `python -m sagellm_core.demo --help` 输出帮助信息
230
- - [x] `python -m sagellm_core.demo --config examples/demo_config.yaml --mock` 可运行
231
- - [x] 缺少 --config 参数时报错
232
- - [x] 配置文件不存在时报错
233
- - [x] 无效的 segment 值时报错
234
- - [x] `ruff check` 和 `mypy` 通过
235
-
236
- **注意**:实际 workload 执行逻辑在 task0_10 实现,当前阶段运行会输出 `NotImplementedError`。
237
-
238
- ## 开发指南
207
+ ## Development Guide
239
208
 
240
209
  ### 快速开始
241
210
 
@@ -254,11 +223,9 @@ pre-commit install
254
223
  pytest tests/ -v
255
224
  ```
256
225
 
257
- ### 质量保证体系
226
+ ### Testing and Quality
258
227
 
259
- sageLLM 实施三层质量保证:
260
-
261
- #### 1. Pre-commit Hooks(提交前自动检查)
228
+ #### Pre-commit Hooks
262
229
 
263
230
  安装后,每次 `git commit` 会自动运行:
264
231
  - **Ruff**: 代码格式化 + Lint 检查
@@ -273,57 +240,34 @@ pre-commit run --all-files
273
240
  git commit --no-verify
274
241
  ```
275
242
 
276
- #### 2. 单元测试(本地验证)
243
+ #### Running Tests
277
244
 
278
245
  ```bash
279
- # 运行所有测试
246
+ # Run all tests
280
247
  pytest tests/ -v
281
248
 
282
- # 运行特定模块测试
249
+ # Run specific test module
283
250
  pytest tests/unit/test_demo.py -v
284
- pytest tests/unit/test_config.py -v
285
251
 
286
- # 生成覆盖率报告
252
+ # Generate coverage report
287
253
  pytest tests/ --cov=sagellm_core --cov-report=html
288
- open htmlcov/index.html
289
254
  ```
290
255
 
291
- 测试要求:
292
- - ✅ 新功能必须有对应单元测试
293
- - ✅ 覆盖率不低于现有水平
294
- - ✅ 所有测试必须支持 mock 模式(无需 GPU)
295
-
296
- #### 3. CI/CD(自动化验证)
297
-
298
- 每次 PR 触发 GitHub Actions 自动运行:
299
- - **Lint Job**: Ruff + Mypy 检查
300
- - **Test Job**: 多 Python 版本矩阵测试(3.10, 3.11, 3.12)
301
- - **Protocol Job**: 验证与 Protocol v0.1 对齐
302
- - **Build Job**: 验证包构建
256
+ #### Continuous Integration
303
257
 
304
- 查看 CI 状态:`.github/workflows/ci.yml`
258
+ GitHub Actions automatically runs on each PR:
259
+ - Code linting and formatting checks
260
+ - Tests across Python 3.10, 3.11, 3.12
261
+ - Package build verification
305
262
 
306
- ### 代码规范
263
+ ### Code Style
307
264
 
308
- **核心原则**:
309
- 1. **Protocol-first** - 修改接口前先升级 Protocol
310
- 2. **Mock-first** - 所有模块支持 mock 模式
311
- 3. **Fail-fast** - 禁止隐式默认值,配置错误立即报错
312
- 4. **Type-safe** - 所有函数必须有类型注解
265
+ This project uses:
266
+ - **Ruff** for formatting and linting
267
+ - **Mypy** for type checking
268
+ - **Type hints** are required for all functions
313
269
 
314
- ```python
315
- # ✅ 正确示例
316
- def create_backend(config: BackendConfig) -> BaseBackend:
317
- if config.kind == "mock":
318
- return MockBackend(config)
319
- raise PluginResolutionError(f"Unknown backend: {config.kind}")
320
-
321
- # ❌ 错误示例
322
- def create_backend(config): # 缺少类型注解
323
- return MockBackend(config.get("kind", "mock")) # 隐式默认值
324
- ```
325
-
326
- 详细规范参见 [CONTRIBUTING.md](CONTRIBUTING.md)
270
+ For detailed guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md)
327
271
 
328
272
  ### 代码检查
329
273
 
@@ -348,19 +292,10 @@ pre-commit run --all-files
348
292
  - `isagellm-protocol>=0.1.0,<0.2.0`: 协议定义(Level 0)
349
293
  - `isagellm-backend>=0.1.0,<0.2.0`: 后端抽象(Level 1)
350
294
 
351
- ## 依赖层级说明
295
+ ## Related Packages
352
296
 
353
- ```
354
- Level 0: isagellm-protocol (最基础,无依赖)
355
-
356
- Level 1: isagellm-backend (依赖 protocol)
357
-
358
- Level 2: isagellm-core (依赖 protocol + backend) ← 当前包
359
-
360
- Level 3: 功能模块(依赖 protocol + backend + core)
361
- ├─ isagellm-kv-cache
362
- ├─ isagellm-comm
363
- └─ isagellm-compression
364
-
365
- Level 4: isagellm-demo (依赖所有模块)
366
- ```
297
+ - `isagellm-protocol` - Protocol definitions
298
+ - `isagellm-backend` - Backend abstraction layer
299
+ - `isagellm` - Main package with CLI
300
+
301
+ For more packages, see the [sageLLM ecosystem](https://github.com/intellistream/sagellm)
@@ -1,5 +1,5 @@
1
- sagellm_core/__init__.py,sha256=LpmwcJlxM8ykr8CiVjF1P3KfjQnX-DlWC0z6cBdFbII,1318
2
- sagellm_core/__init__.pyc,sha256=Udt8y0HGtcHO-8ELYg_qX-FmAlhiJe__5RCursK7wCE,1462
1
+ sagellm_core/__init__.py,sha256=tCd-s6qtnmcAlkTPIAPI6eVAv2VDpTv1x3BTIPmJksc,1318
2
+ sagellm_core/__init__.pyc,sha256=1gOLrD7tMlJWBJfli9YCkaCz3ARTW6TOF1BV6sC9vjc,1462
3
3
  sagellm_core/__main__.pyc,sha256=4wEXHFB0JVZaI6wLACU59_b-LfEbujTQZyzONaalAYA,384
4
4
  sagellm_core/config.pyc,sha256=8gGOOBcHRSSv883bDIJNXzB069ntBc0yYEf-PFAeWdU,9617
5
5
  sagellm_core/demo.pyc,sha256=MAeTgokTW8kW906wjvTLN1yNLfOOl3_hokpVzJ-Lt4I,6377
@@ -11,7 +11,7 @@ sagellm_core/plugins.pyc,sha256=rhdewQ_zJxnmRFBjUozBlhQtIwFg0C1rFD8zMT7ZeKI,2618
11
11
  sagellm_core/py.typed,sha256=ixa8YukDZ3kLo0WsFJRGohLMyHzbMur1ALmmASML2cs,64
12
12
  sagellm_core/runner.pyc,sha256=kUPITl68dX1rOY5Fg5o6KRBMjMhMAQFNizEuRF44PgM,14248
13
13
  sagellm_core/workload.pyc,sha256=LDuZAdimFAd3pHn8E9WG7LjwU_1IKABZ-gaMCMjOTus,4118
14
- sagellm_core/__pycache__/__init__.cpython-311.pyc,sha256=R2nIc2MOizHOtAi3qteyJyfWIPxXbBQgZtp2jvYiJhg,1492
14
+ sagellm_core/__pycache__/__init__.cpython-311.pyc,sha256=rD-1rR4IMX4lKJKlNtTrMkPLHY-rWF-S06ZjtGu1pQU,1492
15
15
  sagellm_core/__pycache__/config.cpython-311.pyc,sha256=4c_gjzVmxIRApzmUq8LCboOG3wPqmmwWVFxZS3JOHOg,9647
16
16
  sagellm_core/__pycache__/demo.cpython-311.pyc,sha256=yOMGCRRQigl8sclMTcg-iHThQoxrRTPWSUdgDYJ3hgU,6407
17
17
  sagellm_core/__pycache__/engine.cpython-311.pyc,sha256=6wUoB2Rz8YqoVpefE28b_vqxAozdXFiCYJZ_gn5Vi9A,614
@@ -26,7 +26,7 @@ sagellm_core/engines/__init__.pyc,sha256=F8_ZNvo0w79MF136pvCmRArLhPjae6uGsds7v9O
26
26
  sagellm_core/engines/mock.pyc,sha256=D0kWj50DsPdaZAM_2W-vyTW11ofNsSF02knRGtfKEJA,586
27
27
  sagellm_core/engines/__pycache__/__init__.cpython-311.pyc,sha256=Y36wU_L1T0NqaGBb-oqt38qVk38lunfTWTv5n-TkCLI,361
28
28
  sagellm_core/engines/__pycache__/mock.cpython-311.pyc,sha256=bt1MKmriqKcL_HF2gvQQ5JfxI-ij24G4fZvgFXjBAmM,616
29
- isagellm_core-0.1.0.2.dist-info/METADATA,sha256=nSW2I1mm63Y-KwzgrnbQmzglGjtRR3NcIHzehUZGj1w,9949
30
- isagellm_core-0.1.0.2.dist-info/WHEEL,sha256=ZJeWpR6hcCRGwxVKXlDk-HsGwijNyTq4fszaDj4Ycyo,93
31
- isagellm_core-0.1.0.2.dist-info/top_level.txt,sha256=wcgdWrvkaoYYh_dWSFI5Toi8PZsHutVqfhTB2tb0K6g,13
32
- isagellm_core-0.1.0.2.dist-info/RECORD,,
29
+ isagellm_core-0.1.0.3.dist-info/METADATA,sha256=wKlVRTDAi3oqLa6FMZsxPRpjaU2j_O9DivkGDzqzjy0,7558
30
+ isagellm_core-0.1.0.3.dist-info/WHEEL,sha256=ZJeWpR6hcCRGwxVKXlDk-HsGwijNyTq4fszaDj4Ycyo,93
31
+ isagellm_core-0.1.0.3.dist-info/top_level.txt,sha256=wcgdWrvkaoYYh_dWSFI5Toi8PZsHutVqfhTB2tb0K6g,13
32
+ isagellm_core-0.1.0.3.dist-info/RECORD,,
sagellm_core/__init__.py CHANGED
@@ -27,7 +27,7 @@ from sagellm_core.health import HealthStatus
27
27
  from sagellm_core.plugins import PluginResolutionError, list_entry_points, resolve_kind
28
28
  from sagellm_core.runner import DemoRunner, RunnerContext
29
29
 
30
- __version__ = "0.1.0.2"
30
+ __version__ = "0.1.0.3"
31
31
 
32
32
  __all__ = [
33
33
  # Version
sagellm_core/__init__.pyc CHANGED
Binary file