|
8 | 8 | [](https://pepy.tech/project/tracer-llm) |
9 | 9 | [](https://pepy.tech/project/tracer-llm) |
10 | 10 | [](https://pypi.org/project/tracer-llm/) |
| 11 | +[](https://www.npmjs.com/package/@tracer-llm/watch) |
11 | 12 | [](LICENSE) |
12 | 13 | [](https://github.com/adrida/tracer/actions) |
13 | 14 | [](https://tracerml.ai) |
@@ -95,7 +96,22 @@ The same watched spans map 1:1 to `TraceRecord`, so once you have traffic you ca |
95 | 96 |
|
96 | 97 | ## Using from JavaScript / Node.js |
97 | 98 |
|
98 | | -TRACER works with JS pipelines without any Python in your application code. The pattern: log traces from JS → fit offline with the CLI → run `tracer serve` as a sidecar → call it via `fetch`. |
| 99 | +**Watch your JS LLM calls (free observability):** [`@tracer-llm/watch`](https://www.npmjs.com/package/@tracer-llm/watch) mirrors the Python decorator with zero dependencies, recording every call as an OpenTelemetry GenAI span (local by default, or streamed free to Tracer Cloud). |
| 100 | + |
| 101 | +```bash |
| 102 | +npm install @tracer-llm/watch |
| 103 | +``` |
| 104 | + |
| 105 | +```js |
| 106 | +import { watch } from "@tracer-llm/watch"; |
| 107 | + |
| 108 | +const w = watch("support_classifier", { system: "provider-x", model: "model-x" }); |
| 109 | + |
| 110 | +// Wrap the function that calls your model; the return value is auto-captured. |
| 111 | +const classify = w(async (ticket) => callYourLLM(ticket)); |
| 112 | +``` |
| 113 | + |
| 114 | +Full guide: [docs/javascript.md](docs/javascript.md). To route (not just observe) from JS, log traces, fit offline with the CLI, run `tracer serve` as a sidecar, and call it via `fetch`: |
99 | 115 |
|
100 | 116 | ```js |
101 | 117 | // 1. Log every LLM classification |
@@ -188,6 +204,7 @@ X = tracer.embed(texts) # default: all-MiniLM-L6-v2 (384-dim) |
188 | 204 | | `tracer update new_traces.jsonl` | Refit with new traces | |
189 | 205 | | `tracer report-html` | Open the HTML report | |
190 | 206 | | `tracer serve .tracer --port 8000` | HTTP prediction server | |
| 207 | +| `tracer cloud login` | Drive Tracer Cloud from the terminal: create, train, route, test, and watch tracers, at parity with the dashboard ([docs](docs/cloud.md)) | |
191 | 208 |
|
192 | 209 | `tracer scan` is the fast, conservative first look (similarity grouping plus exact held-out bounds, no training). It needs about 1,000 traces and works best around 5,000; below 1,000 it asks you to collect more, or pass `--force` for a best-effort floor. Embeddings are computed locally by default (sentence-transformers), or point it at your own embedding service with `--embed-url`. `tracer fit` then trains the real router and certifies more of the same traffic. The HTML report includes an interactive 3D map of your embedding space with a verdict/label colour toggle. See the [CLI reference](docs/cli.md) for every flag. |
193 | 210 |
|
|
0 commit comments