Skip to content

Commit 0c91871

Browse files
authored
Remove CLI/app integrations and require Python 3.12+ (#86)
* Remove CLI and Tracer app integrations * Require Python 3.12 and test through 3.14 * Require joblib with Python 3.12 compatibility
1 parent 093792a commit 0c91871

35 files changed

Lines changed: 396 additions & 4022 deletions

‎.github/workflows/ci.yml‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ on:
88

99
jobs:
1010
test:
11+
name: Python ${{ matrix.python-version }} (${{ matrix.dependencies }})
1112
runs-on: ubuntu-latest
1213
strategy:
1314
matrix:
14-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15+
python-version: ["3.12", "3.13", "3.14"]
16+
dependencies: [latest]
17+
include:
18+
- python-version: "3.12"
19+
dependencies: minimum
1520

1621
steps:
1722
- uses: actions/checkout@v4
@@ -24,7 +29,28 @@ jobs:
2429
- name: Install package and dev dependencies
2530
run: |
2631
python -m pip install --upgrade pip
27-
pip install -e ".[dev]"
32+
if [ "${{ matrix.dependencies }}" = "minimum" ]; then
33+
python -m pip install -e ".[dev]" "numpy==1.26.4" "scikit-learn==1.4.2" "joblib==1.3.2"
34+
else
35+
python -m pip install -e ".[dev]"
36+
fi
37+
python -m pip check
2838
2939
- name: Run tests
3040
run: pytest tests/ -v --tb=short
41+
42+
watch-js:
43+
runs-on: ubuntu-latest
44+
defaults:
45+
run:
46+
working-directory: js
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: "20"
52+
cache: npm
53+
cache-dependency-path: js/package-lock.json
54+
- run: npm ci
55+
- run: npm test -- --maxWorkers=1 --minWorkers=1
56+
- run: npm run build

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.11"
20+
python-version: "3.14"
2121
- name: Verify pushed tag matches package version
2222
run: |
2323
tag="${GITHUB_REF_NAME#v}"

‎AGENTS.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pip install tracer-llm # numpy, scikit-learn, joblib - that's it
1414
pip install tracer-llm[embeddings] # adds sentence-transformers (if user needs text-in routing)
1515
```
1616

17-
No GPU required. No API keys required for fitting. Works on Python 3.9+.
17+
No GPU required. No API keys required for fitting. Requires Python 3.12+; CI tests 3.12, 3.13, and 3.14.
1818

1919
---
2020

@@ -154,8 +154,8 @@ router = tracer.load_router(".tracer", embedder=my_embedder)
154154
```
155155

156156
### Pattern 4: HTTP server (zero deps)
157-
```bash
158-
tracer serve .tracer --port 8000
157+
```python
158+
tracer.serve(".tracer", port=8000)
159159
# POST /predict {"embedding": [...]} → {"label", "decision", "accept_score"}
160160
```
161161

@@ -173,7 +173,7 @@ tracer serve .tracer --port 8000
173173
## Things you CAN do autonomously
174174

175175
- Install `tracer-llm` (it's lightweight, MIT licensed)
176-
- Run `tracer demo` to show the user what it does
176+
- Follow `notebooks/01-quickstart.ipynb` for a worked example
177177
- Write traces to JSONL from any data source
178178
- Fit a policy if traces + embeddings are available
179179
- Generate the HTML report
@@ -195,7 +195,6 @@ tracer serve .tracer --port 8000
195195
| `Embedder.from_endpoint(url)` | External embedding API | Needs URL + auth from human |
196196
| `tracer.generate_html_report(dir)` | Visual audit | No |
197197
| `tracer.serve(dir, port=8000)` | HTTP server | No |
198-
| `tracer demo` | Interactive demo | No |
199198

200199
---
201200

‎CHANGELOG.md‎

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
All notable changes to TRACER are recorded here. This project follows semantic
44
versioning.
55

6+
## Unreleased
7+
8+
### Changed (breaking)
9+
- Require Python 3.12 or newer; drop support for Python 3.9–3.11. CI tests
10+
Python 3.12, 3.13, and 3.14, plus the minimum core dependencies on 3.12.
11+
- Allow NumPy 1.26.4 through 2.x so Python 3.14 can install compatible wheels.
12+
Require scikit-learn 1.4.2+ and joblib 1.3.2+ in core, and PyTorch 2.4.1+
13+
for the optional embedding extras. Remove the obsolete NumPy downgrade advice.
14+
- Build releases and run the documented Python sidecar on Python 3.14.
15+
16+
### Removed (breaking)
17+
- The `tracer` command-line executable and command implementations. Use the
18+
Python APIs for fitting, scanning, updating, reports, and serving predictions.
19+
- The Tracer app client, authentication, and automatic app telemetry exporters
20+
in both Python and JavaScript. Existing app credentials no longer trigger
21+
uploads. Local recording, custom sinks, and explicitly configured generic
22+
HTTP exports remain available.
23+
- App connection instructions and command-line documentation. All current
24+
examples use the library APIs.
25+
626
## 0.3.3 (2026-06)
727

828
### Fixed
@@ -20,48 +40,27 @@ versioning.
2040
`ValueError` messages. Previously the count excluded blank lines, so
2141
the reported line was lower than the actual position of the bad record.
2242

23-
## 0.3.1 (2026-06)
24-
25-
### Changed
26-
- `tracer cloud` commands that take a tracer (`get`, `training`, `analytics`,
27-
`label-space`, `traces`, ...) now accept either the tracer slug or its id.
28-
- `tracer cloud scan` works without logging in, matching the public web scan.
29-
30-
### Fixed
31-
- `tracer cloud keys create` and `tracer cloud ingest-keys create` now honor
32-
`--json` and emit the created record (including the one-time secret) as JSON.
33-
3443
## 0.3.0 (2026-06)
3544

3645
### Added
37-
- `tracer.watch`: a decorator (and HTTP fallback) that observes the LLM calls
38-
your pipeline already makes and ships them, free, to Tracer Cloud, where they
39-
accumulate and auto-optimize once there are enough. Captures the full request
40-
and response on the OpenTelemetry GenAI (`gen_ai.*`) schema, with pluggable
41-
sinks (local file, Tracer Cloud, OTLP, or several at once).
46+
- `tracer.watch`: a decorator that records LLM calls on the OpenTelemetry
47+
GenAI (`gen_ai.*`) schema, with pluggable local and generic export sinks.
4248
- `@tracer-llm/watch`: a zero-dependency JavaScript/TypeScript mirror of the watch
4349
decorator (async-context aware), so JS pipelines get the same one-line
4450
observability as Python.
45-
- `tracer cloud`: a full command-line interface for Tracer Cloud, at parity with
46-
the dashboard. Browser or password login, then manage tracers (create, quick
47-
and bulk uploads, agentic `onboard`, rename, delete), training (retrain,
48-
auto-retrain, promote/rollback, live status), routing (`route`), test
49-
batteries, the model library, API keys, observability ingest keys, billing,
50-
analytics, trace selection (`traces`), and a public `scan`.
5151
- Lazy package initialization so `import tracer` stays fast and only pulls in the
5252
heavy pieces when you actually use them.
5353

5454
### Changed
55-
- `tracer scan` is more robust on messy uploads: tolerant input/label aliasing
56-
and a clarification path so ambiguous files still produce a result.
55+
- Trace ingestion accepts additional input and label aliases.
5756

5857
### Docs
59-
- New guides for the watch decorator and the `tracer cloud` CLI.
58+
- New guide for the watch decorator.
6059

6160
## 0.2.0 (2026-06)
6261

6362
### Added
64-
- `tracer scan`: a fast, conservative day-one read of a traces file, before any
63+
- `tracer.scan()`: a fast, conservative day-one read of a traces file, before any
6564
training. It groups traffic by similarity and measures, on a held-out slice it
6665
never saw, how much a near-free model can answer at your target agreement,
6766
using exact Clopper-Pearson bounds, with an optional per-1k and monthly savings
@@ -72,24 +71,20 @@ versioning.
7271
far from the training distribution (kNN distance, global and per-predicted-label
7372
thresholds) regardless of surrogate confidence, so off-distribution traffic goes
7473
to the teacher instead of getting a confident guess.
75-
- `tracer fit --trees` to opt in the tree surrogates, and `--skip` to drop named
76-
candidates from the zoo.
74+
- `FitConfig.skip_candidates` to drop named candidates from the zoo, including
75+
tree surrogates when a lighter sweep is desired.
7776
- Trace loaders accept common key aliases for both input and label
7877
(`input/query/text/prompt/question` and
7978
`teacher/teacher_output/label/intent/output/answer`).
80-
- Bring-your-own embeddings for `tracer scan`: local sentence-transformers by
81-
default (`--embed-model`), a precomputed `.npy` (`--embeddings`), or your own
82-
HTTP embedding endpoint (`--embed-url`, with header and response-key options).
79+
- Bring-your-own embeddings for `tracer.scan()`: pass a precomputed array with
80+
`embeddings=`, or select a local sentence-transformers model with `model=`.
8381

8482
### Changed
8583
- The parity gate now certifies on an exact held-out lower bound instead of an
8684
in-sample point estimate, so a policy cannot clear the target by in-sample luck
8785
and then break the contract on real traffic. Coverage is now monotonic in the
8886
target, and a hybrid select-then-verify procedure recovers coverage at strict
8987
targets that a plain held-out split discarded.
90-
- Tree surrogates (decision tree, random forest, extra-trees, gradient boosting)
91-
are now off by default in `tracer fit`; the default zoo is the fast linear and
92-
MLP heads. Use `--trees` for hard, high-class-count tasks.
9388
- The HTML report is restyled to the light Tracer theme, and the word "audit" is
9489
dropped across the report and docs.
9590

‎CONTRIBUTING.md‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ we're optimizing for.
5656

5757
## Setup
5858

59+
Use Python 3.12 or newer. CI tests 3.12, 3.13, and 3.14 with current
60+
dependencies, plus 3.12 with the minimum supported core dependencies.
61+
5962
```bash
6063
git clone https://github.com/adrida/tracer
6164
cd tracer
@@ -68,13 +71,20 @@ pip install -e ".[dev]"
6871
pytest tests/ -v
6972
```
7073

71-
Tests use synthetic data and run in temporary directories. No external
72-
dependencies or API keys required.
74+
Tests use synthetic data and run in temporary directories. No model downloads
75+
or API keys are required. To check the JavaScript recorder:
76+
77+
```bash
78+
cd js
79+
npm ci
80+
npm test -- --maxWorkers=1 --minWorkers=1
81+
npm run build
82+
```
7383

7484
## Quick sanity check
7585

7686
```bash
77-
tracer demo
87+
pytest tests/test_router.py tests/test_watch.py -q
7888
```
7989

8090
## Project structure
@@ -101,9 +111,8 @@ src/tracer/
101111
runtime/
102112
router.py <- production Router class
103113
serve.py <- lightweight HTTP prediction server (stdlib only)
104-
cli/
105-
main.py <- tracer CLI entry point (fit, report, update, demo, serve)
106-
_ui.py <- terminal formatting and progress display
114+
scanner.py <- pre-training traffic diagnostics and reports
115+
watch.py <- local trace recording and generic export sinks
107116
```
108117

109118
## Adding a new surrogate model

0 commit comments

Comments
 (0)