amberlib 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amberlib-0.1.0/LICENSE +21 -0
- amberlib-0.1.0/PKG-INFO +195 -0
- amberlib-0.1.0/README.md +170 -0
- amberlib-0.1.0/pyproject.toml +62 -0
- amberlib-0.1.0/setup.cfg +4 -0
- amberlib-0.1.0/src/amberlib/__init__.py +3 -0
- amberlib-0.1.0/src/amberlib/cli.py +578 -0
- amberlib-0.1.0/src/amberlib/corpus_nll.py +464 -0
- amberlib-0.1.0/src/amberlib/cost.py +25 -0
- amberlib-0.1.0/src/amberlib/daemon.py +1198 -0
- amberlib-0.1.0/src/amberlib/engine.py +696 -0
- amberlib-0.1.0/src/amberlib/local_worker.py +394 -0
- amberlib-0.1.0/src/amberlib/plugins/__init__.py +18 -0
- amberlib-0.1.0/src/amberlib/printed.py +871 -0
- amberlib-0.1.0/src/amberlib/telemetry.py +192 -0
- amberlib-0.1.0/src/amberlib/verifiers.py +464 -0
- amberlib-0.1.0/src/amberlib/worker.py +220 -0
- amberlib-0.1.0/src/amberlib/workload.py +69 -0
- amberlib-0.1.0/src/amberlib.egg-info/PKG-INFO +195 -0
- amberlib-0.1.0/src/amberlib.egg-info/SOURCES.txt +24 -0
- amberlib-0.1.0/src/amberlib.egg-info/dependency_links.txt +1 -0
- amberlib-0.1.0/src/amberlib.egg-info/entry_points.txt +3 -0
- amberlib-0.1.0/src/amberlib.egg-info/requires.txt +3 -0
- amberlib-0.1.0/src/amberlib.egg-info/top_level.txt +1 -0
- amberlib-0.1.0/tests/test_amber_v2.py +555 -0
- amberlib-0.1.0/tests/test_corpus_nll_amber.py +470 -0
amberlib-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anibal Angulo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
amberlib-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: amberlib
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Model-agnostic GPU daemon (amberd) and continual compiler CLI (amber) for coding agents optimizing custom LLM inference engines
|
|
5
|
+
Author: Anibal Angulo
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ajac-zero/amber
|
|
8
|
+
Project-URL: Repository, https://github.com/ajac-zero/amber
|
|
9
|
+
Project-URL: Issues, https://github.com/ajac-zero/amber/issues
|
|
10
|
+
Keywords: llm,inference,gpu,triton,cuda,compiler,coding-agents
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: torch
|
|
23
|
+
Requires-Dist: torch; extra == "torch"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<img src="https://raw.githubusercontent.com/ajac-zero/amber/main/assets/amber-logo.png" alt="Amber logo" width="160" />
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<a href="https://github.com/ajac-zero/amber/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/ajac-zero/amber/ci.yml?branch=main&style=flat-square&label=CI" alt="CI" /></a>
|
|
32
|
+
<a href="https://pypi.org/project/amberlib/"><img src="https://img.shields.io/pypi/v/amberlib?style=flat-square&color=D97706" alt="PyPI" /></a>
|
|
33
|
+
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square" alt="Python 3.11+" />
|
|
34
|
+
<img src="https://img.shields.io/badge/license-MIT-F59E0B?style=flat-square" alt="MIT License" />
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
# Amber
|
|
38
|
+
On-demand, continuously hardening custom LLM inference engines.
|
|
39
|
+
|
|
40
|
+
## What this project is about
|
|
41
|
+
|
|
42
|
+
Amber is a framework for agents to build custom inference engines that perfectly fit *YOUR* hardware and *YOUR* workload.
|
|
43
|
+
|
|
44
|
+
When inference was tied to dozens of engineering hours, the most optimal path was for the community to all work on a shared inference engine that would serve everyone. Although this is a heroic effort, it results in an accumulation of edge cases as user environments grow. The idea behind Amber, inspired by [Resin](https://github.com/ajac-zero/resin) and [Together Compiler](https://arxiv.org/abs/2611.14681), is that agents can now build *AND* continuously adapt an inference engine based on your hardware and your workload characteristics, using any agent you wish.
|
|
45
|
+
|
|
46
|
+
## How this project works
|
|
47
|
+
|
|
48
|
+
Amber contains **zero hardcoded model architectures or kernels**. Instead, the engine will be built by your agents via two components: the CLI and the Daemon.
|
|
49
|
+
|
|
50
|
+
The daemon is the custom inference engine that runs on your GPU host, exposes your model via an OpenAI-compatible API, and accepts 'model packages' from your agents, which change the underlying kernels of your engine. It can then hot-reload these packages in less than a second and promote packages that are verified performance wins atomically. It also holds an internal message board for multiple agents to coordinate improvements.
|
|
51
|
+
|
|
52
|
+
The CLI is what each agent uses client-side to communicate with the daemon. Through the CLI, they can check baseline latency, target weights, committed stack, CUDA kernel profile of active incumbent, evaluate and submit changes, and access the message board to coordinate with other agents.
|
|
53
|
+
|
|
54
|
+
```mermaid
|
|
55
|
+
flowchart LR
|
|
56
|
+
Agents["Coding Agent(s)<br/>Claude Code · Codex · Amp"]
|
|
57
|
+
Clients["Clients<br/>OpenAI SDK · curl"]
|
|
58
|
+
|
|
59
|
+
subgraph Control["amberd Control (:8765)"]
|
|
60
|
+
direction LR
|
|
61
|
+
Reload["Two-Tier Reload<br/>fast · structural"] --> Verify["CorpusNLLVerifier<br/>prefill + decode · parity<br/>immutable S0"] --> Board["Agent Board<br/>notes · base_hash"]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
subgraph Serving["amberd Serving (:8000)"]
|
|
65
|
+
direction LR
|
|
66
|
+
API["OpenAI API<br/>/v1/completions<br/>/v1/chat/completions"] --> Tele["Telemetry<br/>traffic drift"]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
Agents -->|"amber CLI"| Reload
|
|
70
|
+
Board -.->|"promote"| API
|
|
71
|
+
Tele -.->|"retarget"| Control
|
|
72
|
+
Clients -->|"HTTP"| API
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Quickstart
|
|
76
|
+
|
|
77
|
+
Install Amber:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Client CLI only (zero dependencies, no PyTorch required)
|
|
81
|
+
pip install amberlib
|
|
82
|
+
|
|
83
|
+
# GPU / model host running amberd
|
|
84
|
+
pip install "amberlib[torch]"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Start the daemon (listens on `:8765` control / `:8000` serving by default):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
amberd
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
In a second terminal, deploy the included [`examples/tiny_lm`](examples/tiny_lm/) induction-head Transformer, watch `CorpusNLLVerifier` reject a vocab-tail bug and accept a clean vectorized speedup, then promote and emit:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
amber deploy examples/tiny_lm
|
|
97
|
+
amber pull /tmp/work_tiny
|
|
98
|
+
|
|
99
|
+
# Fast-but-buggy candidate (corrupts one tail logit) -> REJECTED_NUMERICS
|
|
100
|
+
cp examples/tiny_lm/candidates/buggy_tail/kernels.py /tmp/work_tiny/kernels.py
|
|
101
|
+
amber eval --files /tmp/work_tiny/kernels.py --name buggy_tail --summary
|
|
102
|
+
|
|
103
|
+
# Clean vectorized candidate -> ACCEPTED (~45% faster, 0.0000 delta-NLL)
|
|
104
|
+
cp examples/tiny_lm/candidates/fast_fused/kernels.py /tmp/work_tiny/kernels.py
|
|
105
|
+
amber eval --files /tmp/work_tiny/kernels.py --name fast_fused --summary
|
|
106
|
+
|
|
107
|
+
amber board --summary
|
|
108
|
+
amber promote
|
|
109
|
+
amber emit /tmp/emitted_tiny_lm
|
|
110
|
+
|
|
111
|
+
# Run the emitted standalone engine with zero Amber dependency
|
|
112
|
+
python /tmp/emitted_tiny_lm/run.py --prompt-ids 5,7,9,11,5,7 --max-tokens 6
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Agent Skill
|
|
116
|
+
|
|
117
|
+
Amber ships an open [Agent Skill](https://skills.sh) at [`skills/amber/SKILL.md`](skills/amber/SKILL.md) that teaches Claude Code, Codex, Amp, Cursor, OpenCode, and other coding agents how to deploy, profile, optimize, and collaborate on a live `amberd` instance.
|
|
118
|
+
|
|
119
|
+
Install it into your coding agent via [`npx skills`](https://github.com/vercel-labs/skills):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npx skills add ajac-zero/amber
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Or run it once without installing:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npx skills use ajac-zero/amber@amber --agent claude-code
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Once installed, point your agent at `AMBER_URL=http://<gpu-host>:8765` and let it iterate through `amber profile`, `amber pull`, `amber eval`, `amber board`, and `amber promote`.
|
|
132
|
+
|
|
133
|
+
## CLI Overview
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
amber info # GPU, runtime versions, active deployment, drift
|
|
137
|
+
amber status # baseline/incumbent latency, target weights, committed stack
|
|
138
|
+
amber telemetry # live serving CTXxBATCH histogram + L1/TV drift score
|
|
139
|
+
amber target --from-telemetry # lock target weights to live serving traffic
|
|
140
|
+
amber target --shapes 4096x16:0.8,512x16:0.2 # or lock target to an explicit batch workload
|
|
141
|
+
amber profile --key 1024x4 --top 15 # CUDA kernel profile of active incumbent
|
|
142
|
+
amber pull ./work # download winning files + .amber_base (source_hash)
|
|
143
|
+
amber eval --files ./work/kernels.py --name my_opt # evaluate (JSON on stdout, compact summary on stderr)
|
|
144
|
+
amber eval --files ./work/kernels.py --name x --summary # compact verdict summary only
|
|
145
|
+
amber board --summary # compact history with timings, NLL, parity, failure reasons
|
|
146
|
+
amber notes / amber post --kind claim "..." # multi-agent coordination board
|
|
147
|
+
amber promote / amber rollback / amber restart # live serving lifecycle
|
|
148
|
+
amber verify-bench --cmd "python bench.py" # outer benchmark against AMBER_SERVE_URL
|
|
149
|
+
amber emit ./dist/my_engine # export standalone runnable package (includes run.py)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Scope & Current Limitations
|
|
153
|
+
|
|
154
|
+
Amber is intentionally narrow and honest about what it does and does not do *today*:
|
|
155
|
+
|
|
156
|
+
* **Single-GPU focus:** No multi-GPU tensor/pipeline parallelism orchestration yet.
|
|
157
|
+
* **Serving concurrency:** `:8000` serves requests through the deployed package's `generate()` (single-request unless your package wraps a continuous-batching engine).
|
|
158
|
+
* **Single-step timing:** Timing measures `ms/step` per `(ctx, batch)` shape, not effective `ms/committed_token` for speculative decoding (MTP/EAGLE).
|
|
159
|
+
* **Python package slots:** Editable tracked files are `loader.py`, `model.py`, `kernels.py` (agents can still compile inline CUDA via `torch.utils.cpp_extension.load_inline`, but standalone `.cu` files are not tracked as separate slots yet).
|
|
160
|
+
|
|
161
|
+
## Development
|
|
162
|
+
|
|
163
|
+
Amber uses [`uv`](https://docs.astral.sh/uv/), [`ruff`](https://docs.astral.sh/ruff/), [`ty`](https://docs.astral.sh/ty/), and `pytest`.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Editable install with PyTorch + dev tools
|
|
167
|
+
uv venv && uv pip install -e ".[torch]" pytest ruff ty
|
|
168
|
+
|
|
169
|
+
# Lint & format check
|
|
170
|
+
uvx ruff check src tests examples
|
|
171
|
+
uvx ruff format --check src tests examples
|
|
172
|
+
|
|
173
|
+
# Static type check
|
|
174
|
+
uvx ty check --python .venv/bin/python src tests examples
|
|
175
|
+
|
|
176
|
+
# Zero-dependency stdlib tests (verifies amber CLI/daemon without torch)
|
|
177
|
+
python3 -m unittest tests/test_amber_v2.py -v
|
|
178
|
+
|
|
179
|
+
# Full test suite (CorpusNLLVerifier + daemon + examples/tiny_lm)
|
|
180
|
+
pytest tests/ -v
|
|
181
|
+
|
|
182
|
+
# Build sdist and wheel
|
|
183
|
+
uv build
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
All four checks run automatically in [GitHub Actions CI](https://github.com/ajac-zero/amber/actions/workflows/ci.yml) and are required on pull requests.
|
|
187
|
+
|
|
188
|
+
## Credits
|
|
189
|
+
|
|
190
|
+
* **[Resin](https://github.com/ajac-zero/resin)** — open-source LLM inference runtime that inspired Amber's printed-engine architecture.
|
|
191
|
+
* **[Together Compiler (TKCC)](https://arxiv.org/abs/2611.14681)** — Abhyankar et al. (2026), *Together Compiler: Continual Compilation for AI Inference*, which inspired the tiered persistent engine and continual agent-compilation loop.
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
MIT — see [`LICENSE`](LICENSE).
|
amberlib-0.1.0/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/ajac-zero/amber/main/assets/amber-logo.png" alt="Amber logo" width="160" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/ajac-zero/amber/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/ajac-zero/amber/ci.yml?branch=main&style=flat-square&label=CI" alt="CI" /></a>
|
|
7
|
+
<a href="https://pypi.org/project/amberlib/"><img src="https://img.shields.io/pypi/v/amberlib?style=flat-square&color=D97706" alt="PyPI" /></a>
|
|
8
|
+
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square" alt="Python 3.11+" />
|
|
9
|
+
<img src="https://img.shields.io/badge/license-MIT-F59E0B?style=flat-square" alt="MIT License" />
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
# Amber
|
|
13
|
+
On-demand, continuously hardening custom LLM inference engines.
|
|
14
|
+
|
|
15
|
+
## What this project is about
|
|
16
|
+
|
|
17
|
+
Amber is a framework for agents to build custom inference engines that perfectly fit *YOUR* hardware and *YOUR* workload.
|
|
18
|
+
|
|
19
|
+
When inference was tied to dozens of engineering hours, the most optimal path was for the community to all work on a shared inference engine that would serve everyone. Although this is a heroic effort, it results in an accumulation of edge cases as user environments grow. The idea behind Amber, inspired by [Resin](https://github.com/ajac-zero/resin) and [Together Compiler](https://arxiv.org/abs/2611.14681), is that agents can now build *AND* continuously adapt an inference engine based on your hardware and your workload characteristics, using any agent you wish.
|
|
20
|
+
|
|
21
|
+
## How this project works
|
|
22
|
+
|
|
23
|
+
Amber contains **zero hardcoded model architectures or kernels**. Instead, the engine will be built by your agents via two components: the CLI and the Daemon.
|
|
24
|
+
|
|
25
|
+
The daemon is the custom inference engine that runs on your GPU host, exposes your model via an OpenAI-compatible API, and accepts 'model packages' from your agents, which change the underlying kernels of your engine. It can then hot-reload these packages in less than a second and promote packages that are verified performance wins atomically. It also holds an internal message board for multiple agents to coordinate improvements.
|
|
26
|
+
|
|
27
|
+
The CLI is what each agent uses client-side to communicate with the daemon. Through the CLI, they can check baseline latency, target weights, committed stack, CUDA kernel profile of active incumbent, evaluate and submit changes, and access the message board to coordinate with other agents.
|
|
28
|
+
|
|
29
|
+
```mermaid
|
|
30
|
+
flowchart LR
|
|
31
|
+
Agents["Coding Agent(s)<br/>Claude Code · Codex · Amp"]
|
|
32
|
+
Clients["Clients<br/>OpenAI SDK · curl"]
|
|
33
|
+
|
|
34
|
+
subgraph Control["amberd Control (:8765)"]
|
|
35
|
+
direction LR
|
|
36
|
+
Reload["Two-Tier Reload<br/>fast · structural"] --> Verify["CorpusNLLVerifier<br/>prefill + decode · parity<br/>immutable S0"] --> Board["Agent Board<br/>notes · base_hash"]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
subgraph Serving["amberd Serving (:8000)"]
|
|
40
|
+
direction LR
|
|
41
|
+
API["OpenAI API<br/>/v1/completions<br/>/v1/chat/completions"] --> Tele["Telemetry<br/>traffic drift"]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Agents -->|"amber CLI"| Reload
|
|
45
|
+
Board -.->|"promote"| API
|
|
46
|
+
Tele -.->|"retarget"| Control
|
|
47
|
+
Clients -->|"HTTP"| API
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quickstart
|
|
51
|
+
|
|
52
|
+
Install Amber:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Client CLI only (zero dependencies, no PyTorch required)
|
|
56
|
+
pip install amberlib
|
|
57
|
+
|
|
58
|
+
# GPU / model host running amberd
|
|
59
|
+
pip install "amberlib[torch]"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Start the daemon (listens on `:8765` control / `:8000` serving by default):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
amberd
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
In a second terminal, deploy the included [`examples/tiny_lm`](examples/tiny_lm/) induction-head Transformer, watch `CorpusNLLVerifier` reject a vocab-tail bug and accept a clean vectorized speedup, then promote and emit:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
amber deploy examples/tiny_lm
|
|
72
|
+
amber pull /tmp/work_tiny
|
|
73
|
+
|
|
74
|
+
# Fast-but-buggy candidate (corrupts one tail logit) -> REJECTED_NUMERICS
|
|
75
|
+
cp examples/tiny_lm/candidates/buggy_tail/kernels.py /tmp/work_tiny/kernels.py
|
|
76
|
+
amber eval --files /tmp/work_tiny/kernels.py --name buggy_tail --summary
|
|
77
|
+
|
|
78
|
+
# Clean vectorized candidate -> ACCEPTED (~45% faster, 0.0000 delta-NLL)
|
|
79
|
+
cp examples/tiny_lm/candidates/fast_fused/kernels.py /tmp/work_tiny/kernels.py
|
|
80
|
+
amber eval --files /tmp/work_tiny/kernels.py --name fast_fused --summary
|
|
81
|
+
|
|
82
|
+
amber board --summary
|
|
83
|
+
amber promote
|
|
84
|
+
amber emit /tmp/emitted_tiny_lm
|
|
85
|
+
|
|
86
|
+
# Run the emitted standalone engine with zero Amber dependency
|
|
87
|
+
python /tmp/emitted_tiny_lm/run.py --prompt-ids 5,7,9,11,5,7 --max-tokens 6
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Agent Skill
|
|
91
|
+
|
|
92
|
+
Amber ships an open [Agent Skill](https://skills.sh) at [`skills/amber/SKILL.md`](skills/amber/SKILL.md) that teaches Claude Code, Codex, Amp, Cursor, OpenCode, and other coding agents how to deploy, profile, optimize, and collaborate on a live `amberd` instance.
|
|
93
|
+
|
|
94
|
+
Install it into your coding agent via [`npx skills`](https://github.com/vercel-labs/skills):
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx skills add ajac-zero/amber
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or run it once without installing:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx skills use ajac-zero/amber@amber --agent claude-code
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Once installed, point your agent at `AMBER_URL=http://<gpu-host>:8765` and let it iterate through `amber profile`, `amber pull`, `amber eval`, `amber board`, and `amber promote`.
|
|
107
|
+
|
|
108
|
+
## CLI Overview
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
amber info # GPU, runtime versions, active deployment, drift
|
|
112
|
+
amber status # baseline/incumbent latency, target weights, committed stack
|
|
113
|
+
amber telemetry # live serving CTXxBATCH histogram + L1/TV drift score
|
|
114
|
+
amber target --from-telemetry # lock target weights to live serving traffic
|
|
115
|
+
amber target --shapes 4096x16:0.8,512x16:0.2 # or lock target to an explicit batch workload
|
|
116
|
+
amber profile --key 1024x4 --top 15 # CUDA kernel profile of active incumbent
|
|
117
|
+
amber pull ./work # download winning files + .amber_base (source_hash)
|
|
118
|
+
amber eval --files ./work/kernels.py --name my_opt # evaluate (JSON on stdout, compact summary on stderr)
|
|
119
|
+
amber eval --files ./work/kernels.py --name x --summary # compact verdict summary only
|
|
120
|
+
amber board --summary # compact history with timings, NLL, parity, failure reasons
|
|
121
|
+
amber notes / amber post --kind claim "..." # multi-agent coordination board
|
|
122
|
+
amber promote / amber rollback / amber restart # live serving lifecycle
|
|
123
|
+
amber verify-bench --cmd "python bench.py" # outer benchmark against AMBER_SERVE_URL
|
|
124
|
+
amber emit ./dist/my_engine # export standalone runnable package (includes run.py)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Scope & Current Limitations
|
|
128
|
+
|
|
129
|
+
Amber is intentionally narrow and honest about what it does and does not do *today*:
|
|
130
|
+
|
|
131
|
+
* **Single-GPU focus:** No multi-GPU tensor/pipeline parallelism orchestration yet.
|
|
132
|
+
* **Serving concurrency:** `:8000` serves requests through the deployed package's `generate()` (single-request unless your package wraps a continuous-batching engine).
|
|
133
|
+
* **Single-step timing:** Timing measures `ms/step` per `(ctx, batch)` shape, not effective `ms/committed_token` for speculative decoding (MTP/EAGLE).
|
|
134
|
+
* **Python package slots:** Editable tracked files are `loader.py`, `model.py`, `kernels.py` (agents can still compile inline CUDA via `torch.utils.cpp_extension.load_inline`, but standalone `.cu` files are not tracked as separate slots yet).
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
Amber uses [`uv`](https://docs.astral.sh/uv/), [`ruff`](https://docs.astral.sh/ruff/), [`ty`](https://docs.astral.sh/ty/), and `pytest`.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Editable install with PyTorch + dev tools
|
|
142
|
+
uv venv && uv pip install -e ".[torch]" pytest ruff ty
|
|
143
|
+
|
|
144
|
+
# Lint & format check
|
|
145
|
+
uvx ruff check src tests examples
|
|
146
|
+
uvx ruff format --check src tests examples
|
|
147
|
+
|
|
148
|
+
# Static type check
|
|
149
|
+
uvx ty check --python .venv/bin/python src tests examples
|
|
150
|
+
|
|
151
|
+
# Zero-dependency stdlib tests (verifies amber CLI/daemon without torch)
|
|
152
|
+
python3 -m unittest tests/test_amber_v2.py -v
|
|
153
|
+
|
|
154
|
+
# Full test suite (CorpusNLLVerifier + daemon + examples/tiny_lm)
|
|
155
|
+
pytest tests/ -v
|
|
156
|
+
|
|
157
|
+
# Build sdist and wheel
|
|
158
|
+
uv build
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
All four checks run automatically in [GitHub Actions CI](https://github.com/ajac-zero/amber/actions/workflows/ci.yml) and are required on pull requests.
|
|
162
|
+
|
|
163
|
+
## Credits
|
|
164
|
+
|
|
165
|
+
* **[Resin](https://github.com/ajac-zero/resin)** — open-source LLM inference runtime that inspired Amber's printed-engine architecture.
|
|
166
|
+
* **[Together Compiler (TKCC)](https://arxiv.org/abs/2611.14681)** — Abhyankar et al. (2026), *Together Compiler: Continual Compilation for AI Inference*, which inspired the tiered persistent engine and continual agent-compilation loop.
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT — see [`LICENSE`](LICENSE).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "amberlib"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Model-agnostic GPU daemon (amberd) and continual compiler CLI (amber) for coding agents optimizing custom LLM inference engines"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [{ name = "Anibal Angulo" }]
|
|
9
|
+
keywords = ["llm", "inference", "gpu", "triton", "cuda", "compiler", "coding-agents"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"Intended Audience :: Science/Research",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
19
|
+
]
|
|
20
|
+
requires-python = ">=3.11"
|
|
21
|
+
dependencies = []
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
torch = ["torch"]
|
|
25
|
+
|
|
26
|
+
[dependency-groups]
|
|
27
|
+
dev = ["pytest>=8", "ruff>=0.11", "ty>=0.0.1a1"]
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
amber = "amberlib.cli:main"
|
|
31
|
+
amberd = "amberlib.cli:main_daemon"
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/ajac-zero/amber"
|
|
35
|
+
Repository = "https://github.com/ajac-zero/amber"
|
|
36
|
+
Issues = "https://github.com/ajac-zero/amber/issues"
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["setuptools>=77"]
|
|
40
|
+
build-backend = "setuptools.build_meta"
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.packages.find]
|
|
43
|
+
where = ["src"]
|
|
44
|
+
|
|
45
|
+
[tool.ruff]
|
|
46
|
+
target-version = "py311"
|
|
47
|
+
line-length = 120
|
|
48
|
+
|
|
49
|
+
[tool.ruff.lint]
|
|
50
|
+
select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
|
|
51
|
+
ignore = [
|
|
52
|
+
"E501", # long lines in docstrings, CLI help, and test fixtures
|
|
53
|
+
"SIM105", # explicit try/except/pass for optional CUDA cleanup
|
|
54
|
+
"SIM118", # Workload.keys() is a custom method, not a dict
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[tool.ty.environment]
|
|
58
|
+
python-version = "3.11"
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
testpaths = ["tests"]
|
|
62
|
+
pythonpath = ["src"]
|
amberlib-0.1.0/setup.cfg
ADDED