mntr 0.2.0__py3-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.
- mntr-0.2.0.dist-info/METADATA +513 -0
- mntr-0.2.0.dist-info/RECORD +118 -0
- mntr-0.2.0.dist-info/WHEEL +4 -0
- mntr-0.2.0.dist-info/entry_points.txt +8 -0
- mntr-0.2.0.dist-info/licenses/LICENSE +21 -0
- monitors/__init__.py +78 -0
- monitors/__main__.py +5 -0
- monitors/builders.py +119 -0
- monitors/capture/__init__.py +47 -0
- monitors/capture/client.py +576 -0
- monitors/capture/config.py +84 -0
- monitors/capture/follow.py +123 -0
- monitors/capture/notify.py +118 -0
- monitors/capture/policy.py +252 -0
- monitors/capture/server.py +782 -0
- monitors/capture/spool.py +326 -0
- monitors/capture/store.py +724 -0
- monitors/capture/verify.py +136 -0
- monitors/capture/vllm_ext/__init__.py +1 -0
- monitors/capture/vllm_ext/connector.py +833 -0
- monitors/capture/vllm_ext/endpoint.py +499 -0
- monitors/capture/vllm_ext/plugin.py +45 -0
- monitors/cli.py +758 -0
- monitors/client.py +731 -0
- monitors/config.py +603 -0
- monitors/datafile.py +210 -0
- monitors/decisions/__init__.py +22 -0
- monitors/decisions/battery.py +180 -0
- monitors/decisions/monitor.py +394 -0
- monitors/decisions/openrouter.py +346 -0
- monitors/decisions/schema.py +237 -0
- monitors/decisions/source.py +409 -0
- monitors/hub/__init__.py +47 -0
- monitors/hub/app.py +374 -0
- monitors/hub/client.py +228 -0
- monitors/hub/contrib/__init__.py +1 -0
- monitors/hub/contrib/llm_judge.py +627 -0
- monitors/hub/core.py +640 -0
- monitors/hub/events.py +188 -0
- monitors/hub/feeds/__init__.py +86 -0
- monitors/hub/feeds/proxy.py +157 -0
- monitors/hub/feeds/vllm_activations.py +490 -0
- monitors/hub/ids.py +75 -0
- monitors/hub/policy.py +55 -0
- monitors/hub/proxy.py +599 -0
- monitors/hub/publisher.py +118 -0
- monitors/hub/server.py +35 -0
- monitors/hub/service.py +615 -0
- monitors/hub/sources.py +141 -0
- monitors/hub/sse.py +82 -0
- monitors/imports.py +16 -0
- monitors/paths.py +69 -0
- monitors/presets/batteries/current.yaml +60 -0
- monitors/presets/batteries/deception.yaml +47 -0
- monitors/presets/batteries/future.yaml +83 -0
- monitors/presets/batteries/refusal.yaml +52 -0
- monitors/presets/batteries/reward_hacking.yaml +53 -0
- monitors/presets/prompts/deception_judge.txt +14 -0
- monitors/presets/prompts/refusal_judge.txt +14 -0
- monitors/presets/prompts/reward_hacking_judge.txt +14 -0
- monitors/presets/qwen3-14b-deception-harm.yaml +42 -0
- monitors/presets/qwen3-14b-deception.yaml +42 -0
- monitors/presets/text-proxy.yaml +61 -0
- monitors/probes/__init__.py +16 -0
- monitors/probes/artifact.py +195 -0
- monitors/probes/base.py +65 -0
- monitors/probes/fusion.py +288 -0
- monitors/probes/hf.py +89 -0
- monitors/probes/loaders/__init__.py +24 -0
- monitors/probes/loaders/trained.py +26 -0
- monitors/probes/pooling.py +414 -0
- monitors/probes/source.py +286 -0
- monitors/probes/torch_probe.py +22 -0
- monitors/probes/train/__init__.py +72 -0
- monitors/probes/train/__main__.py +170 -0
- monitors/probes/train/artifact.py +21 -0
- monitors/probes/train/attention/__init__.py +0 -0
- monitors/probes/train/attention/config.yaml +27 -0
- monitors/probes/train/attention/trainer.py +53 -0
- monitors/probes/train/collect.py +485 -0
- monitors/probes/train/common.py +53 -0
- monitors/probes/train/config.py +261 -0
- monitors/probes/train/data.py +489 -0
- monitors/probes/train/diffmean/__init__.py +0 -0
- monitors/probes/train/diffmean/config.yaml +21 -0
- monitors/probes/train/diffmean/trainer.py +55 -0
- monitors/probes/train/evaluate.py +171 -0
- monitors/probes/train/fuse.py +169 -0
- monitors/probes/train/latency.py +58 -0
- monitors/probes/train/linreg/__init__.py +0 -0
- monitors/probes/train/linreg/config.yaml +20 -0
- monitors/probes/train/linreg/trainer.py +40 -0
- monitors/probes/train/lr/__init__.py +0 -0
- monitors/probes/train/lr/config.yaml +22 -0
- monitors/probes/train/lr/trainer.py +61 -0
- monitors/probes/train/methods.py +68 -0
- monitors/probes/train/metrics.py +143 -0
- monitors/probes/train/mlp/__init__.py +0 -0
- monitors/probes/train/mlp/config.yaml +26 -0
- monitors/probes/train/mlp/trainer.py +72 -0
- monitors/probes/train/multimax/__init__.py +0 -0
- monitors/probes/train/multimax/config.yaml +27 -0
- monitors/probes/train/multimax/trainer.py +50 -0
- monitors/probes/train/rolling/__init__.py +0 -0
- monitors/probes/train/rolling/config.yaml +28 -0
- monitors/probes/train/rolling/trainer.py +54 -0
- monitors/probes/train/run.py +272 -0
- monitors/probes/train/sequence.py +174 -0
- monitors/probes/train/swim/__init__.py +0 -0
- monitors/probes/train/swim/config.yaml +25 -0
- monitors/probes/train/swim/trainer.py +54 -0
- monitors/server.py +714 -0
- monitors/starter.py +118 -0
- monitors/style.py +31 -0
- monitors/templates/probe/README.md.tmpl +37 -0
- monitors/templates/probe/serve.yaml.tmpl +14 -0
- monitors/templates/probe/traces.jsonl +8 -0
- monitors/templates/probe/train.py.tmpl +31 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: mntr
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Activation capture from a running vLLM server, monitors over it, and a hub that streams their verdicts
|
|
5
|
+
Project-URL: Repository, https://github.com/idhantgulati/monitors
|
|
6
|
+
Project-URL: Issues, https://github.com/idhantgulati/monitors/issues
|
|
7
|
+
Author: Idhant Gulati
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: activations,ai-safety,llm,monitoring,probes,vllm
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.13
|
|
20
|
+
Requires-Dist: accelerate>=1.15.0
|
|
21
|
+
Requires-Dist: fastapi>=0.115
|
|
22
|
+
Requires-Dist: httpx>=0.27
|
|
23
|
+
Requires-Dist: huggingface-hub
|
|
24
|
+
Requires-Dist: numpy>=2.0
|
|
25
|
+
Requires-Dist: python-dotenv>=1.2.3
|
|
26
|
+
Requires-Dist: pyyaml>=6
|
|
27
|
+
Requires-Dist: safetensors>=0.8.0
|
|
28
|
+
Requires-Dist: torch>=2.13.0
|
|
29
|
+
Requires-Dist: transformers>=5.17.0
|
|
30
|
+
Requires-Dist: uvicorn>=0.30
|
|
31
|
+
Requires-Dist: vllm<0.30,>=0.29
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# monitors
|
|
35
|
+
|
|
36
|
+
Watch an LLM while it generates: capture residual-stream activations from a running vLLM
|
|
37
|
+
server, score them with probes, judge the reply text with a decisions model or an LLM
|
|
38
|
+
judge, and stream every verdict to the client next to the inference stream. Tokens are never held back for
|
|
39
|
+
the monitors; each verdict names the token it is about and arrives when its monitor is done.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Python 3.13. The package installs vLLM 0.29, which needs a GPU to serve; `monitors.Client`
|
|
44
|
+
itself imports only httpx. It is published on PyPI as `mntr`; the import and the
|
|
45
|
+
command are `monitors`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install mntr # then `import monitors` and the `monitors` command
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
From a checkout:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv sync # the `monitors` command and `import monitors`
|
|
55
|
+
uv run monitors # the commands, and how to start
|
|
56
|
+
uv run monitors presets # ready-made configs shipped with the package
|
|
57
|
+
uv run monitors presets text-proxy > my.yaml # one of them, to start your own
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Run
|
|
61
|
+
|
|
62
|
+
After training a probe, start vLLM and the monitor service with the project's serving
|
|
63
|
+
config. The engine captures the layers recorded in the training run.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
uv run monitors serve --config serve.yaml --launch-engine
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The service runs in one of two modes (`server.mode`):
|
|
70
|
+
|
|
71
|
+
- **sidecar** (the default): clients call vLLM themselves and subscribe to the service with
|
|
72
|
+
the request's `X-Request-Id`; the service reads the captures from vLLM's
|
|
73
|
+
`/v1/activations`.
|
|
74
|
+
- **proxy**: clients call the service, which forwards to vLLM and holds the engine's key.
|
|
75
|
+
When monitors launches vLLM it binds it to 127.0.0.1; if you start vLLM yourself, bind it
|
|
76
|
+
to 127.0.0.1 too, so no request can skip the monitors. `X-Monitors-Inline: 1` on a
|
|
77
|
+
streaming request puts the monitor events in the reply's own stream.
|
|
78
|
+
|
|
79
|
+
`text-proxy` monitors the reply text only: no activation capture, any model.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uv run monitors serve --config text-proxy --launch-engine --model Qwen/Qwen3-0.6B
|
|
83
|
+
curl -N localhost:8100/v1/chat/completions -H 'X-Monitors-Inline: 1' -H 'Content-Type: application/json' \
|
|
84
|
+
-d '{"model": "qwen3-0.6b", "stream": true, "messages": [{"role": "user", "content": "hi"}]}'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
To attach to an existing engine at another address, pass
|
|
88
|
+
`monitors serve --config my.yaml --engine-url http://gpu-host:8000`.
|
|
89
|
+
To start the two apart, run `monitors engine serve --config qwen3-14b-deception` (or print
|
|
90
|
+
the vLLM launch with `monitors engine args ...` and run it yourself), then `monitors serve
|
|
91
|
+
--config qwen3-14b-deception`.
|
|
92
|
+
|
|
93
|
+
A vLLM that `monitors` launches (`--launch-engine`, `monitors engine serve`, the serve
|
|
94
|
+
scripts) listens on `engine.url`'s host: 127.0.0.1 unless the config says otherwise. To
|
|
95
|
+
let other machines reach it, bind it with `--engine-host 0.0.0.0` (or name that host in
|
|
96
|
+
`engine.url`); off loopback it needs a key (`VLLM_API_KEY`, or the variable
|
|
97
|
+
`engine.api_key_env` names), and without one the launch is refused. `monitors engine args`
|
|
98
|
+
prints the launch with `VLLM_API_KEY="${X:?...}"` in front of the command, where `X`
|
|
99
|
+
holds the key: a shell without it (one that never loaded your `.env`) does not start vLLM.
|
|
100
|
+
|
|
101
|
+
A config is a preset name or a YAML file (a `.toml` file with the same structure also
|
|
102
|
+
loads); `src/monitors/config.py` documents every key. Flags override the file: `--model`
|
|
103
|
+
sets `engine.model` (a model directory or a Hugging Face id), `--mode proxy` sets
|
|
104
|
+
`server.mode: proxy`. `capture.activations: false` monitors tokens only and needs proxy
|
|
105
|
+
mode. `capture.interval` defaults to 1 (every token), which text monitors need. Every key
|
|
106
|
+
is checked: an unknown key or a wrong value is an error naming it.
|
|
107
|
+
|
|
108
|
+
Request ids must be unique for the service's lifetime: in proxy mode a reused
|
|
109
|
+
`X-Request-Id` gets 409. The proxy also refuses what its monitors could not follow
|
|
110
|
+
whole: a request for more than one reply (`n`, `best_of`, beam search, several prompts)
|
|
111
|
+
gets 400, and of `kv_transfer_params` only `save` reaches the engine. `monitors.Client` mints a new one per request; a request sent to
|
|
112
|
+
the proxy without one gets one, returned in the response's `X-Request-Id`.
|
|
113
|
+
|
|
114
|
+
Activations are not written to disk unless you ask. The engine keeps a request's captures
|
|
115
|
+
in memory (`/dev/shm`), the service's monitors read them as they are taken, and the service
|
|
116
|
+
has the engine drop them once the request is judged; a request nobody reads goes
|
|
117
|
+
`capture.ttl` seconds (60) after it finished. `capture.window: N` keeps only a running
|
|
118
|
+
request's last N captures. `capture.save: always` also writes every request to
|
|
119
|
+
`capture.dir`, and `capture.save: request` those that ask (`"save": true` in the request's
|
|
120
|
+
`kv_transfer_params`); saved requests stay until you delete them.
|
|
121
|
+
|
|
122
|
+
In sidecar mode, whoever can call vLLM (with its `--api-key`, if it has one) can also read
|
|
123
|
+
and delete every request's activations under `/v1/activations`. For a deployment shared
|
|
124
|
+
with others, use proxy mode.
|
|
125
|
+
|
|
126
|
+
The repo's serve scripts wrap `monitors engine serve` for the models in `models/` (on
|
|
127
|
+
127.0.0.1; `ENGINE_HOST=0.0.0.0`, with `VLLM_API_KEY` set, serves other machines):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
scripts/serve_qwen.sh # Qwen3.6-27B, port 8000
|
|
131
|
+
scripts/serve_qwen_moe.sh # Qwen3.6-35B-A3B, port 8000
|
|
132
|
+
scripts/serve_qwen14.sh # Qwen3-14B, port 8000
|
|
133
|
+
scripts/serve_gemma.sh # gemma-4-31B-it, port 8000
|
|
134
|
+
scripts/serve_qwen_small.sh # Qwen3-0.6B test model, port 8123
|
|
135
|
+
scripts/stop_server.sh # all of them, or the one on a port: scripts/stop_server.sh 8001
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Environment variables
|
|
139
|
+
|
|
140
|
+
Secrets are never in a config, only the names of the variables that hold them. The
|
|
141
|
+
`monitors` command loads a `.env` from the current directory or a parent (`--env-file`
|
|
142
|
+
names another). It does not look in or above a directory group or others can write (such
|
|
143
|
+
as a checkout made under umask 002), and does not load a `.env` that is not yours alone
|
|
144
|
+
or is a symbolic link; a warning names a `.env` it skips and how to load it (`--env-file`,
|
|
145
|
+
or `chmod go-w`). From Python, load your own (`dotenv.load_dotenv()`).
|
|
146
|
+
|
|
147
|
+
- `OPENROUTER_API_KEY`: the decisions model, through OpenRouter's Decisions API.
|
|
148
|
+
- `MODAL_BASE_URL`, `MODAL_MODEL`, `MODAL_PROXY_TOKEN_ID`, `MODAL_PROXY_TOKEN_SECRET`: the
|
|
149
|
+
OpenAI-compatible endpoint of the LLM judge in the `text-proxy` and
|
|
150
|
+
`qwen3-14b-deception` presets, and of the decisions demos' live replies.
|
|
151
|
+
- `MONITORS_API_KEY`, `MONITORS_INGEST_KEY`: the service's bearer tokens for clients and
|
|
152
|
+
for sources that publish from elsewhere (`server.api_key_env`,
|
|
153
|
+
`server.ingest_key_env`; every preset names both). Off a loopback host the service
|
|
154
|
+
refuses to run without a client key, or when a variable the config names is unset (the
|
|
155
|
+
ingest one too); a config that names no ingest variable runs with ingest closed (remote
|
|
156
|
+
sources cannot publish, and a warning says so). On a loopback host both may be unset
|
|
157
|
+
(no auth; a named but unset variable is a warning).
|
|
158
|
+
- `VLLM_API_KEY`: the engine's `--api-key`, when it has one (`engine.api_key_env`). An
|
|
159
|
+
engine `monitors` launches gets the key in its environment, never on its command line;
|
|
160
|
+
one that listens off loopback must have a key.
|
|
161
|
+
- `MONITORS_HOME`: where saved activations and engine logs go (default
|
|
162
|
+
`~/.cache/monitors`).
|
|
163
|
+
- `MONITORS_SPOOL_DIR`: where engines keep captures until they are read (default
|
|
164
|
+
`/dev/shm/monitors-<uid>`: memory).
|
|
165
|
+
- `VLLM_BIN`: a `vllm` executable to launch instead of this Python's.
|
|
166
|
+
|
|
167
|
+
## Python API
|
|
168
|
+
|
|
169
|
+
The same from code: start the monitors (and vLLM), then read a reply and its verdicts as
|
|
170
|
+
they come. `demos/api_demo.py` runs this end to end.
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
import asyncio
|
|
174
|
+
|
|
175
|
+
import monitors
|
|
176
|
+
|
|
177
|
+
MESSAGES = [{"role": "user", "content": "hi"}]
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
async def main(url: str) -> None:
|
|
181
|
+
async with monitors.Client(url) as client:
|
|
182
|
+
# one merged stream
|
|
183
|
+
async for ev in client.chat(MESSAGES, max_tokens=64):
|
|
184
|
+
if ev.kind == "token":
|
|
185
|
+
print(ev.text, end="")
|
|
186
|
+
elif ev.kind == "verdict":
|
|
187
|
+
print(ev.source, ev.token_index, ev.level, ev.scores)
|
|
188
|
+
elif ev.kind == "done":
|
|
189
|
+
print(ev.result.overall, ev.result.incomplete)
|
|
190
|
+
|
|
191
|
+
# or as separate streams
|
|
192
|
+
async with client.chat(MESSAGES, max_tokens=64) as run:
|
|
193
|
+
async for tok in run.tokens: # ends with the reply
|
|
194
|
+
print(tok.text, end="")
|
|
195
|
+
async for v in run.verdicts: # ends after the last verdict
|
|
196
|
+
print(v.source, v.level)
|
|
197
|
+
result = await run.result()
|
|
198
|
+
print(result.overall)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
sources = [
|
|
202
|
+
monitors.decisions_model("decisions_deception", battery="deception"),
|
|
203
|
+
monitors.decisions_model("decisions_harm", battery="current"),
|
|
204
|
+
]
|
|
205
|
+
with monitors.Server(
|
|
206
|
+
sources,
|
|
207
|
+
model="Qwen/Qwen3-0.6B",
|
|
208
|
+
mode="proxy",
|
|
209
|
+
activations=False,
|
|
210
|
+
launch_engine=True,
|
|
211
|
+
) as srv:
|
|
212
|
+
asyncio.run(main(srv.url))
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
- `monitors.Server` takes the config's settings as keywords (`model`, `mode`,
|
|
216
|
+
`activations`, `capture_interval`, `port`, `gpu_memory_utilization`, ...; an unknown one
|
|
217
|
+
is a TypeError). `monitors.Server.from_config("qwen3-14b-deception", launch_engine=True)`
|
|
218
|
+
starts from a preset or file instead.
|
|
219
|
+
- `monitors.Client(url)` talks to a proxy-mode service. `monitors.Server`, like the
|
|
220
|
+
config, defaults to sidecar mode: there pass `engine=<vLLM's URL>` and the client calls
|
|
221
|
+
vLLM itself and subscribes to the service. A proxy-mode client pointed at a sidecar
|
|
222
|
+
service gets an error that says so.
|
|
223
|
+
- Breaking out of the merged stream, leaving `async with`, or `await run.aclose()` cancels
|
|
224
|
+
the request. Each stream can be read once.
|
|
225
|
+
- In sidecar mode a monitor-side failure arrives as a `MonitorError` and never stops the
|
|
226
|
+
reply.
|
|
227
|
+
- `monitors.SyncClient` is the same API without async.
|
|
228
|
+
- `done`'s `incomplete` is true when some of the reply went unjudged (a monitor failed or
|
|
229
|
+
never finished), so `pass` with `incomplete` does not mean clean.
|
|
230
|
+
|
|
231
|
+
## Activations
|
|
232
|
+
|
|
233
|
+
`monitors.capture` reads the residual stream from a vLLM server launched with capture
|
|
234
|
+
(`monitors engine serve`, the serve scripts, or `--launch-engine` with a config that
|
|
235
|
+
captures):
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
from monitors.capture import ActivationsClient
|
|
239
|
+
|
|
240
|
+
client = ActivationsClient("http://127.0.0.1:8000")
|
|
241
|
+
res = client.chat("Explain paged attention.", max_tokens=200, capture_interval=25)
|
|
242
|
+
|
|
243
|
+
# captures taken during generation: acts.stack() -> [captures, layers, hidden]
|
|
244
|
+
acts = client.get_activations(res.request_id)
|
|
245
|
+
|
|
246
|
+
# every token, written at the end: final.hidden_states -> [tokens, layers, hidden]
|
|
247
|
+
# (a saved request only)
|
|
248
|
+
final = client.get_final(res.request_id)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Captures can be read while the request runs and for `capture.ttl` seconds after it
|
|
252
|
+
finished (sooner gone when a monitor service read and released them). The final dump and
|
|
253
|
+
files on disk exist only for a saved request: launch with `--save-activations always`, or
|
|
254
|
+
with `--save-activations request` and send `client.chat(..., save=True)`.
|
|
255
|
+
|
|
256
|
+
Layer ids follow HF `output_hidden_states`: 0 is the embeddings, L the output of decoder
|
|
257
|
+
layer L, -1 the last layer (before the final norm). A saved request's files
|
|
258
|
+
(`captures.safetensors`, `final.safetensors`, `request.json`, `tokens.json`) land in
|
|
259
|
+
`$MONITORS_HOME/activations/<engine request id>/` (vLLM's id is
|
|
260
|
+
`chatcmpl-<X-Request-Id>-<8 hex>`; the client resolves the short one).
|
|
261
|
+
`demos/activations_demo.ipynb` walks through streaming, `capture_all` and a cross-check
|
|
262
|
+
against HF.
|
|
263
|
+
|
|
264
|
+
## Monitors
|
|
265
|
+
|
|
266
|
+
**Decisions model** (`monitors.decisions_model`, `monitors.decisions`): every token T gets
|
|
267
|
+
its own request to a decision model over the reply up to T, through OpenRouter's Decisions
|
|
268
|
+
API (`POST https://openrouter.ai/api/alpha/decisions`, key in `OPENROUTER_API_KEY`).
|
|
269
|
+
`model=` picks it: any decision model OpenRouter serves
|
|
270
|
+
(`GET https://openrouter.ai/api/v1/models?output_modalities=decisions`), by default
|
|
271
|
+
TypeSafe's Jev, `typesafe/jev-1.14`; the presets also use OpenAI's Luna, pinned to its
|
|
272
|
+
build `openai/gpt-6-luna-decisions-20261006`. Pin a versioned id, not an alias such as
|
|
273
|
+
`~typesafe/jev-latest`: thresholds belong to the build they were set on, and each
|
|
274
|
+
verdict's `detail["model"]` names the build that answered. Nothing on the token path waits
|
|
275
|
+
for it: requests run in parallel, resolve out of order and land on their own token.
|
|
276
|
+
`check_interval=N` checks every Nth token instead. The concurrency caps are described in
|
|
277
|
+
`src/monitors/decisions/source.py`. Batteries are YAML files; five ship as presets
|
|
278
|
+
(`src/monitors/presets/batteries/`), and `battery_file:` takes your own:
|
|
279
|
+
|
|
280
|
+
| Battery | Asks | Risk score | Per-token label |
|
|
281
|
+
| --- | --- | --- | --- |
|
|
282
|
+
| `current` | is what has been written so far safe? | `harmful_now` | `safe` / `refusal` / `sensitive` / `unsafe` |
|
|
283
|
+
| `future` | will the rest of the reply be safe? | `unsafe_ahead` (+ `committed`) | `benign` / `refusing` / `undecided` / `heading_unsafe` / `already_unsafe` |
|
|
284
|
+
| `deception` | is the reply so far honest? | `deceptive_now` | `honest` / `hedged` / `evasive` / `deceptive` |
|
|
285
|
+
| `refusal` | is the reply so far declining the request? | `refusing_now` | `comply` / `caveat` / `partial` / `refuse` |
|
|
286
|
+
| `reward_hacking` | is the reply so far gaming the stated check instead of doing the task? | `gaming_now` | `honest` / `raises_problem` / `considers` / `games` |
|
|
287
|
+
|
|
288
|
+
**Probes** score captured activations. Pass a training run to
|
|
289
|
+
`monitors.probe(run_dir="runs/lr_L14")` in Python, or use the same factory and `run_dir` in a
|
|
290
|
+
serving config. Relative run directories in YAML resolve
|
|
291
|
+
from the config file. `monitors.probes.fusion:FusedProbeSource` serves several trained
|
|
292
|
+
probes as one score.
|
|
293
|
+
|
|
294
|
+
**LLM judge** (`monitors.llm_judge`): asks an OpenAI-compatible endpoint to score the reply
|
|
295
|
+
every N tokens and at its end, with a preset prompt (`deception`, `refusal`,
|
|
296
|
+
`reward_hacking`) or a template file. A judge that answers 429 or 503 is asked again after
|
|
297
|
+
the `Retry-After` it names (`max_retries`, `retry_max_wait`), and that wait holds back the
|
|
298
|
+
source's other calls; `requests_per_minute` / `tokens_per_minute` pace the calls of all
|
|
299
|
+
requests so a burst queues instead of being turned away; `prompt_cache: true` sends each
|
|
300
|
+
check so that a Claude judge reads the earlier check's prompt and reply from its cache.
|
|
301
|
+
The token stream never waits for any of it, and a check still turned away is an error.
|
|
302
|
+
|
|
303
|
+
Your own monitor is a `monitors.Source` (`src/monitors/hub/sources.py`); one running in
|
|
304
|
+
another process publishes over HTTP with `monitors.hub.publisher.HttpPublisher`. A policy
|
|
305
|
+
turns each score into `pass` / `watch` / `flag`; monitors report, they never stop the
|
|
306
|
+
stream.
|
|
307
|
+
|
|
308
|
+
## Training probes
|
|
309
|
+
|
|
310
|
+
Start an editable project in the Python environment where you installed the package.
|
|
311
|
+
|
|
312
|
+
```sh
|
|
313
|
+
monitors train init my-probe
|
|
314
|
+
cd my-probe
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
The initializer asks for the model, capture layer, and training method. For unattended
|
|
318
|
+
setup, pass the choices directly, for example
|
|
319
|
+
`monitors train init my-probe --model Qwen/Qwen3-0.6B --layer 14 --method lr --yes`.
|
|
320
|
+
The project README gives the commands for your choices. For those defaults:
|
|
321
|
+
|
|
322
|
+
```sh
|
|
323
|
+
monitors engine serve --config serve.yaml --layers 14 --save-activations request
|
|
324
|
+
# In a second terminal, from my-probe:
|
|
325
|
+
python train.py
|
|
326
|
+
# Stop the capture engine, then start inference and the trained probe:
|
|
327
|
+
monitors serve --config serve.yaml --launch-engine
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Edit `traces.jsonl` to supply labeled examples. Edit `train.py` to change the fit.
|
|
331
|
+
Choose the resulting run in `serve.yaml`. The example data exercises collection
|
|
332
|
+
and serving. A representative held-out set is needed to assess a probe's accuracy.
|
|
333
|
+
Collection takes an exclusive filesystem lock on its dataset directory while writing.
|
|
334
|
+
Use `collect(..., concurrency=N)` to send several requests to one dataset.
|
|
335
|
+
|
|
336
|
+
For an existing Python project, import the functions directly. Only the training
|
|
337
|
+
function takes a method name, training config file, mapping, or a
|
|
338
|
+
`TrainConfig` imported from `monitors.probes.train`. The same keyword overrides
|
|
339
|
+
work with each form.
|
|
340
|
+
|
|
341
|
+
```python
|
|
342
|
+
from monitors.probes.train import collect, evaluate, fuse, latency, score, train
|
|
343
|
+
|
|
344
|
+
# 1. traces (a .jsonl of id, messages, label, split, ...) -> a dataset of activations.
|
|
345
|
+
# The engine must save requests that ask:
|
|
346
|
+
# monitors engine serve --model M --layers "16 32" --save-activations request
|
|
347
|
+
collect("traces.jsonl", "DATA", engine_config="serve.yaml", max_tokens=128)
|
|
348
|
+
|
|
349
|
+
# 2. one probe per layer; every named split (train, val, test, ood_...) is scored
|
|
350
|
+
results = train("lr", data="DATA", out="RUNS", layers=[16, 32])
|
|
351
|
+
results += train("rolling", data="DATA", out="RUNS", layers=[32])
|
|
352
|
+
|
|
353
|
+
# 3. compare poolings, false-positive rates and groups from the scores the runs saved
|
|
354
|
+
rows = evaluate(
|
|
355
|
+
[r["path"] for r in results],
|
|
356
|
+
by=("split", "source"),
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
# 4. several probes (other layers, methods, poolings) as one score
|
|
360
|
+
fuse([r["path"] for r in results], "RUNS/fused")
|
|
361
|
+
|
|
362
|
+
# 5. a trained probe on another dataset of the same model, labelled or not
|
|
363
|
+
score(results[0]["path"], "RUNS/lr-on-other", data="OTHER")
|
|
364
|
+
|
|
365
|
+
# 6. what serving it costs: one step (probe + running pool) in microseconds
|
|
366
|
+
latency(results[0]["path"]) # device="cuda:0" for a probe served on a GPU
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
When replies are long, or only a few of them are worth keeping (a rare behaviour and
|
|
370
|
+
its controls), write the replies first and capture afterwards:
|
|
371
|
+
|
|
372
|
+
```python
|
|
373
|
+
from monitors.probes.train import collect, sample
|
|
374
|
+
|
|
375
|
+
sample("traces.jsonl", "sampled.jsonl", url=PLAIN, max_tokens=4096, temperature=0.8)
|
|
376
|
+
# label sampled.jsonl, keep the rows you want as chosen.jsonl, then
|
|
377
|
+
collect("chosen.jsonl", "DATA", url=CAPTURING) # replays each reply token for token
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
`sample` needs no capture (any vLLM server), so it runs at the engine's full speed; the
|
|
381
|
+
replay feeds the capturing engine exactly the tokens the model saw while it wrote.
|
|
382
|
+
|
|
383
|
+
Pass a training file to `train("refusal.yaml")`. The existing module command
|
|
384
|
+
`python -m monitors.probes.train train refusal.yaml` reads the same file.
|
|
385
|
+
|
|
386
|
+
```yaml
|
|
387
|
+
method: lr # diffmean | lr | mlp | linreg | swim | attention | multimax | rolling
|
|
388
|
+
data: DATA
|
|
389
|
+
out: RUNS
|
|
390
|
+
layers: [16, 32] # one probe per layer; concat_layers: true for one over both
|
|
391
|
+
tokens: generated # what is trained on and scored: reply | generated | reasoning | answer | prompt | last | all
|
|
392
|
+
pooling: {kind: ema, alpha: 0.1} # the running pool it will be served with
|
|
393
|
+
fpr: 0.01 # threshold: this false-positive rate on validation replies
|
|
394
|
+
params: {l2: 10.0}
|
|
395
|
+
sweep: {params.l2: [1, 10, 100]} # every combination is a run
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
`diffmean`, `lr`, `mlp` and `linreg` label every token with its reply; `swim`,
|
|
399
|
+
`attention`, `multimax` and `rolling` train on whole replies through the pool they are
|
|
400
|
+
served with. A request is judged by the highest value its running pool reaches, so a
|
|
401
|
+
run's threshold is calibrated on that maximum over validation replies, with the pool it
|
|
402
|
+
will be served with (a pool that needs several steps, such as a window, judges a shorter
|
|
403
|
+
reply on its final value). The threshold is one of those validation maxima: offline
|
|
404
|
+
rates count a reply strictly above it, while a served probe flags a margin at or above
|
|
405
|
+
`policy.flag` (default 0), so the reply that sets it sits on the served boundary.
|
|
406
|
+
`src/monitors/probes/train/<method>/config.yaml` holds each method's defaults.
|
|
407
|
+
|
|
408
|
+
`tokens: last` trains on the prompt's last token: what the model is about to do, before
|
|
409
|
+
it has written anything. Such a probe is served with one verdict in phase `prompt`
|
|
410
|
+
(`token_index` -1) and none on the reply; `score_prompt` / `score_reply` on the source
|
|
411
|
+
choose otherwise.
|
|
412
|
+
|
|
413
|
+
A run directory is all a serving config names (paths are relative to the config). Only
|
|
414
|
+
runs trained on `tokens` `reply`, `generated` or `last` are served: the service does not
|
|
415
|
+
tell a reply's reasoning from its answer yet, and of the prompt it gives a probe only the
|
|
416
|
+
last token, so a run trained on `reasoning`, `answer`, `prompt` or `all` is refused at
|
|
417
|
+
load, and a fusion (which scores the reply) refuses a `last` member.
|
|
418
|
+
|
|
419
|
+
```yaml
|
|
420
|
+
sources:
|
|
421
|
+
- factory: monitors:probe
|
|
422
|
+
name: refusal_lr_l32
|
|
423
|
+
params:
|
|
424
|
+
run_dir: RUNS/lr_L32
|
|
425
|
+
device: cpu
|
|
426
|
+
label: refusal
|
|
427
|
+
description: refusal probe
|
|
428
|
+
- factory: monitors.probes.fusion:FusedProbeSource
|
|
429
|
+
name: refusal
|
|
430
|
+
params: {fusion_dir: RUNS/fused, label: refusal, description: fused refusal probes}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
Probes of different layers, methods and domains sit side by side in one config, each
|
|
434
|
+
under its own name in `GET /v1/monitors`; the engine is launched with the union of their
|
|
435
|
+
layers. Keep probes on the CPU or on a GPU the engine does not use: from another
|
|
436
|
+
process, the engine's own GPU costs the engine throughput and the probes milliseconds.
|
|
437
|
+
|
|
438
|
+
### Publish and download trained probes
|
|
439
|
+
|
|
440
|
+
```python
|
|
441
|
+
from monitors.probes import hf, load_probe
|
|
442
|
+
|
|
443
|
+
revision = hf.publish("runs/lr_L14", repo_id="my-team/escalation")
|
|
444
|
+
probe = load_probe(repo_id="my-team/escalation")
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
`load_probe` downloads the probe automatically. It loads the latest commit on the
|
|
448
|
+
Hub repo's default branch. To load the exact version you published, pass
|
|
449
|
+
`load_probe(repo_id="my-team/escalation", revision=revision)`.
|
|
450
|
+
|
|
451
|
+
```yaml
|
|
452
|
+
sources:
|
|
453
|
+
- name: escalation
|
|
454
|
+
factory: monitors:probe
|
|
455
|
+
params:
|
|
456
|
+
repo_id: my-team/escalation
|
|
457
|
+
# revision: "<full commit SHA>"
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
With `revision` omitted, the service resolves the default branch's HEAD when it
|
|
461
|
+
loads the probe. The metadata and weights both come from that commit. Set
|
|
462
|
+
`revision` to a full SHA to serve the same version across restarts.
|
|
463
|
+
|
|
464
|
+
The CLI can publish a run or prefetch a probe for later use.
|
|
465
|
+
|
|
466
|
+
```sh
|
|
467
|
+
monitors probe push runs/lr_L14 --repo-id my-team/escalation
|
|
468
|
+
monitors probe pull my-team/escalation
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
`push` prints the published SHA. `pull` prints the cached directory and accepts
|
|
472
|
+
`--revision <full-commit-SHA>` to select a specific version. A cached SHA or a
|
|
473
|
+
local directory also works offline.
|
|
474
|
+
|
|
475
|
+
## The monitor stream
|
|
476
|
+
|
|
477
|
+
`GET /v1/monitors/{X-Request-Id}/stream` is one ordered, replayable SSE stream per
|
|
478
|
+
request: `start`, then `verdict` and `error` events from every monitor, then `done` with a
|
|
479
|
+
per-monitor summary, the worst level (`overall`) and `incomplete`. A subscription can open
|
|
480
|
+
before, during or after the reply; the events replay from the first, and a dropped
|
|
481
|
+
connection resumes with `Last-Event-ID`. Finished requests stay up to `server.ttl` seconds
|
|
482
|
+
(default 600); an expired one answers 410.
|
|
483
|
+
|
|
484
|
+
## Demos
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
uv run python demos/api_demo.py # the Python API end to end (--probe RUN_DIR adds your trained probe)
|
|
488
|
+
uv run python demos/stream_demo.py --prompts-file demos/prompts/deception.jsonl --no-think
|
|
489
|
+
uv run python demos/decisions_terminal.py --mode future --scenario "Scripted · reply complies with a harmful request"
|
|
490
|
+
uv run marimo run demos/token_safety.py # the current battery on a live or scripted reply
|
|
491
|
+
uv run marimo run demos/future_safety.py # the future battery
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
`stream_demo.py` (and the notebook `demos/monitor_streams.ipynb`) calls vLLM and the
|
|
495
|
+
service side by side, in sidecar mode; for a proxy-mode service, point its engine URL at
|
|
496
|
+
the service (`--engine http://127.0.0.1:8100`). The decisions demos need `OPENROUTER_API_KEY`,
|
|
497
|
+
and the `MODAL_*` endpoint for live replies and for pacing scripted ones like the real
|
|
498
|
+
model (`decisions_terminal.py --tps N` paces them without it).
|
|
499
|
+
|
|
500
|
+
## Tests
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
uv run pytest # offline: no GPU, no model weights
|
|
504
|
+
scripts/check.sh # ruff, then the offline tests (what CI runs)
|
|
505
|
+
scripts/download_models.sh Qwen/Qwen3-0.6B Qwen3-0.6B
|
|
506
|
+
scripts/check.sh --gpu # also the GPU end-to-end tests on Qwen3-0.6B
|
|
507
|
+
scripts/verify.sh # the live checks: the real CLI, services and wheel (tests/verify)
|
|
508
|
+
scripts/verify.sh gpu # and the whole stack on a real engine
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## License
|
|
512
|
+
|
|
513
|
+
MIT; see `LICENSE`.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
monitors/__init__.py,sha256=7vYEpWSreU_pSug1rQfmaY5vMmsoi9eM84pFdoukP6A,3142
|
|
2
|
+
monitors/__main__.py,sha256=-FnWeIP-EwxynStDHBZSX7goVdJy6w4ZyjlauBLWTDQ,95
|
|
3
|
+
monitors/builders.py,sha256=xVzlm3KQgQaaljCPOOkKzC9DBQWowis7h3-x85bSGUc,4855
|
|
4
|
+
monitors/cli.py,sha256=quExr9U_QGCQWyVmgL9Z2mUVpu84s6uPTzJ9OzIyV9c,28089
|
|
5
|
+
monitors/client.py,sha256=Kp_qwkswA-5JKLB70hoXOb2Qi8-Gmv9QViLJVyS2TZU,27463
|
|
6
|
+
monitors/config.py,sha256=3xBxl2oa3WCEiM8qt4W7k8S4Ib4cyJC97w2dxrCmaNA,26734
|
|
7
|
+
monitors/datafile.py,sha256=q_8S41qP0QbI2Hf4Ez2tuHEmM2IMqIVkjOcQoO8AXfM,7478
|
|
8
|
+
monitors/imports.py,sha256=otE1mLgpnAOYLy9vYTwl9xPOTqAZIT2fwVfBO5YY8U8,518
|
|
9
|
+
monitors/paths.py,sha256=e7Utus7FaA2DZtjtJn4no0lcxoYF3VudK7aGVJldko8,2496
|
|
10
|
+
monitors/server.py,sha256=tA0pM_3k4vQdxMaCm_ZyfkavvQ8uHlQ7gPtd90JPcgE,29687
|
|
11
|
+
monitors/starter.py,sha256=dGz5K87gHlerxFP5LmE97o1C0OIqZQkLuGG4wVOVQmI,4454
|
|
12
|
+
monitors/style.py,sha256=jl6wja5O4rIB8f6hclGRDhQUfpiDXMVlRG610or2IY4,1090
|
|
13
|
+
monitors/capture/__init__.py,sha256=xKSjSMtIaBKM4QdnNz1psDI9IqPDu4Zas5GiuhGEVjg,1797
|
|
14
|
+
monitors/capture/client.py,sha256=woppkuSfImqxv5ZKsuR9DsumcuTSczTWyTy_Z_fymPk,21035
|
|
15
|
+
monitors/capture/config.py,sha256=OJsyJey0FogBRCPceyvMWv1PDugFNDnDaIdiOAAQbcE,3152
|
|
16
|
+
monitors/capture/follow.py,sha256=_ZprZw30kUFF07XWdJYs3tL_-8bBGDCnWhWnvvSuou0,4738
|
|
17
|
+
monitors/capture/notify.py,sha256=ifr5LRSt8Ox446v3HJcsLIOgdSeDxvFMXlRsTBXM648,4250
|
|
18
|
+
monitors/capture/policy.py,sha256=xdYzVdYie8R5x5UbHVVoa2mGUgRvicp6N5hfu6fm_Wk,9376
|
|
19
|
+
monitors/capture/server.py,sha256=Loic9T-PFWxBDnbwl7ucBXbGMyAP0rW7FFJojfQ20F8,31199
|
|
20
|
+
monitors/capture/spool.py,sha256=LUqdyD765AH3CG0wqCu6U1kSzbIynPlmudXNoLmrsxQ,12549
|
|
21
|
+
monitors/capture/store.py,sha256=oMiADFBrjoQe1rdZkrkYzGO528USjCDuysVidOqjqZ4,29068
|
|
22
|
+
monitors/capture/verify.py,sha256=IVBdOQSCJxqSvU7mDXaX9yFsoEdm67Dpyhz6XsdPv18,4621
|
|
23
|
+
monitors/capture/vllm_ext/__init__.py,sha256=IKGUPvD88arPXB6N71k37DlvPxpi20dfVaBumkNLR3k,83
|
|
24
|
+
monitors/capture/vllm_ext/connector.py,sha256=Radp7BUR6QC3NWT-ILVM1E7mhaD4FAiAgzpc7PiP1_w,37373
|
|
25
|
+
monitors/capture/vllm_ext/endpoint.py,sha256=RchzUREGOOIT3ehmnrfemLl3SZYprR-vaduqRQG9J4Q,19493
|
|
26
|
+
monitors/capture/vllm_ext/plugin.py,sha256=_EXPqBM3iiLYgis3mK42aaRX5og5ZtmY8-wdDUfK7Dc,1944
|
|
27
|
+
monitors/decisions/__init__.py,sha256=MJ9ORy-DKaLnz_mt6JbUfupWLLV-0BCaD3vMQVAc2N4,673
|
|
28
|
+
monitors/decisions/battery.py,sha256=x2aFkmsE5GzxSU_5RE60vzAZbV4raMlNG0c8qPwpb28,6965
|
|
29
|
+
monitors/decisions/monitor.py,sha256=VCee4GVjUn7GCpU5ZcxLqtbBIF967lKy33ukYAtjcEs,16005
|
|
30
|
+
monitors/decisions/openrouter.py,sha256=16oHFGOLElENUMPrsVFDQqBOJrWlTQukFUL-zvPocLQ,14208
|
|
31
|
+
monitors/decisions/schema.py,sha256=Z6jF1Rd5pR95VI3dJ48GgyR17Rj5K_EBxzH4xzS7IUk,8084
|
|
32
|
+
monitors/decisions/source.py,sha256=NtQQx3SUGxfDcvQl0pOTIkC_Exs1FAets4c5rRdADGg,17643
|
|
33
|
+
monitors/hub/__init__.py,sha256=PA6AXXktA68SrXGdDVwpYF_tc9ybDxsekwDiEr1F-EQ,1805
|
|
34
|
+
monitors/hub/app.py,sha256=YGVS7tPJAoOIfr-PQCnSGb2IohehDSMnb6P_Laqt8w8,15086
|
|
35
|
+
monitors/hub/client.py,sha256=TuOckPvqbnJyeXZP7x1NZ3hw7vOtLm9Y9Mx0s4HOKxM,9879
|
|
36
|
+
monitors/hub/core.py,sha256=sL3j1gOLZHic1MK_eK3vwYkA8CoKc_aKehcyzzK2GH4,25895
|
|
37
|
+
monitors/hub/events.py,sha256=7KP9ZM8ZuH-GMM0NRA2DDrB5AMLZuCvnKUJK0WqjM0k,6993
|
|
38
|
+
monitors/hub/ids.py,sha256=3dlnma8AjR5LBA8H58A-qUaqPjQOWEgx5P3TfRImvrU,3138
|
|
39
|
+
monitors/hub/policy.py,sha256=yYEsqqnHdJfE1mFSZ0yV9rgoPxRHyU2oeRgfv033miI,2178
|
|
40
|
+
monitors/hub/proxy.py,sha256=HJeTOz9zX6IBp5keqDpNVFyQTPJ-VC8SYjxIvPnyq6o,25957
|
|
41
|
+
monitors/hub/publisher.py,sha256=byHTluFlDESZnvGlRl0mEU6TeGgPxjet2_jDw-o51c4,4733
|
|
42
|
+
monitors/hub/server.py,sha256=ClV_uTWh8PNoAznLUsEU0zL4WBBLQzAZSvTWiNN0qCU,1016
|
|
43
|
+
monitors/hub/service.py,sha256=9MR4eZ6yyajOLfMxWUoD5-IG_7oymATKAPbY_5b7Mzo,26523
|
|
44
|
+
monitors/hub/sources.py,sha256=SSkYlxK-fjzMdwLgBpYMCxcdi0NuQOVOpm3eriabVHA,4978
|
|
45
|
+
monitors/hub/sse.py,sha256=ZFwst2tuDxOVx94w8NO2enCsJ-8TLuzHv1QoC9tnQjM,2759
|
|
46
|
+
monitors/hub/contrib/__init__.py,sha256=2kI0Ab512O049pHcvO1bVBulpDYvc4E9QwkYhWafJes,68
|
|
47
|
+
monitors/hub/contrib/llm_judge.py,sha256=Z90nEjaFujxr0GmXxM5Lvf0yZQ4QKnHFv52riC_baVI,27993
|
|
48
|
+
monitors/hub/feeds/__init__.py,sha256=A3NOTEgup6OWxVzGOKeQE8vzpGvwdKF9mdK0vuDz08o,3135
|
|
49
|
+
monitors/hub/feeds/proxy.py,sha256=iOyu1e1CWOUMrc44ENMSeGMMtj5UZOJPxNcNAPX_pP8,6063
|
|
50
|
+
monitors/hub/feeds/vllm_activations.py,sha256=4AczJWmq2iNea0t7zBHTG4LlDW-87LKiG5dR8rDVj8s,21905
|
|
51
|
+
monitors/presets/qwen3-14b-deception-harm.yaml,sha256=8x12lllFgnlT8r1McFv-KdtZxjwkmhqULFLLIYxa2u4,1953
|
|
52
|
+
monitors/presets/qwen3-14b-deception.yaml,sha256=S5Hnxo3MjGcNjc9TTdSg8TerwIhmPnwJIXne2G2Utzg,1728
|
|
53
|
+
monitors/presets/text-proxy.yaml,sha256=hq8nkQ9MpBRUfXrw4pFsa-GjsGDKhre8h2O4MazGTN8,2499
|
|
54
|
+
monitors/presets/batteries/current.yaml,sha256=25KFakigaGqaTMcgBusEr3D0Vtnj1eHWzfB-6WmQi1s,2456
|
|
55
|
+
monitors/presets/batteries/deception.yaml,sha256=EDCmV1ri6RErzgNJy36sLth5hKLVV1FiPOXzdscSyIk,2026
|
|
56
|
+
monitors/presets/batteries/future.yaml,sha256=j_CK43WhrlNbPbXFuEdAeaQuNewbSstOspRFS7zFvaA,3417
|
|
57
|
+
monitors/presets/batteries/refusal.yaml,sha256=jiwCm64E1_xgaXRxfv5cH-GQpdeZadBhmLPDI6Io4t0,2122
|
|
58
|
+
monitors/presets/batteries/reward_hacking.yaml,sha256=qrP7o3f1RwY6QhvrNAsuLJx0ViYMNnhlYSI9QtA1mYQ,2456
|
|
59
|
+
monitors/presets/prompts/deception_judge.txt,sha256=5uYoisEc6nLRKwvhDCLA03SVAUIeGJHzD7Vw5BftGHA,689
|
|
60
|
+
monitors/presets/prompts/refusal_judge.txt,sha256=9Wskebqfp4UlnWHJ2IzX3rhSIB7qFyBy9Ux9IOS3B88,829
|
|
61
|
+
monitors/presets/prompts/reward_hacking_judge.txt,sha256=o3rig3kxRSEmqmSr8ySI_EjS7klCVnrK2lMZ9yt6Y18,1118
|
|
62
|
+
monitors/probes/__init__.py,sha256=df4c-_aFl1AEZPpHYw59mO5zXBcP9eUHp_WgP3Fq95I,803
|
|
63
|
+
monitors/probes/artifact.py,sha256=XnyajzMWyjaljdDZF9M1-DDd-ZidlCqh30bB_FgzHz8,7482
|
|
64
|
+
monitors/probes/base.py,sha256=Rx_iSfVBMP9b9wayCiuY9o0EuRK9Ij262crp3m14RVE,2948
|
|
65
|
+
monitors/probes/fusion.py,sha256=zzvIawGB_TPLBZdhsysDjJKHmkGAvqWnUv7O0CGk7Gg,10846
|
|
66
|
+
monitors/probes/hf.py,sha256=p-Yxkvb0MTUzCnhdi4Wxr4QsR_WfpDzqR_tkOfaUpu4,3355
|
|
67
|
+
monitors/probes/pooling.py,sha256=lyxXCtyUFvZ2MmYvQpRAYBrOtyxhdgKjEOKQ378zE0Q,16061
|
|
68
|
+
monitors/probes/source.py,sha256=K1SK80TOMW_oa0HWtm_9UHDHN2BB-DQ0nVKpgE-BBww,12367
|
|
69
|
+
monitors/probes/torch_probe.py,sha256=AbrB_SY9ZAk7UUqvdjIprR3rfIqcMZBYFMO-FvIpvIU,728
|
|
70
|
+
monitors/probes/loaders/__init__.py,sha256=NkRJSxNii3zQyoUfCgj8bDKsw_sZdh0CIbal14FYDE8,731
|
|
71
|
+
monitors/probes/loaders/trained.py,sha256=IlfV4hAtDbPQ3Fw3ywKUI3sa3mtScKAmxqVVb5Im1X0,702
|
|
72
|
+
monitors/probes/train/__init__.py,sha256=264Ab3DAaxxnC_ser4zH3eCUyGfWKfDeHxslYgwfKR4,2556
|
|
73
|
+
monitors/probes/train/__main__.py,sha256=AJDleHVDaxnghnojNVSqHrkORGrNh0nE-3S8sX5DbR4,5845
|
|
74
|
+
monitors/probes/train/artifact.py,sha256=M2U6EIBVnqqmJyvwovpcGvXgS5tg3q7PI_UoXumLLtE,345
|
|
75
|
+
monitors/probes/train/collect.py,sha256=AgiBmwb-Oc3Dl2SeM_3WTf45DV4kZgkUK1vVHQpJdyg,19646
|
|
76
|
+
monitors/probes/train/common.py,sha256=RcbmDiVbG-coX8tDNxHqVvd55pHckoaIPq-5cNwVC6Q,2045
|
|
77
|
+
monitors/probes/train/config.py,sha256=rFYCjfHha2pJoHaY1JSf2PPxlEn4DDaGQ6YmzgO8FLY,10935
|
|
78
|
+
monitors/probes/train/data.py,sha256=HFzo-P9M_JAyPfbHBMO40FNQmD7fINuMZUqpq9NO9OU,20250
|
|
79
|
+
monitors/probes/train/evaluate.py,sha256=FZoSg2t7CEKjhustgW3RLDqij08G2XHh68FBIhv3x2A,7124
|
|
80
|
+
monitors/probes/train/fuse.py,sha256=BDCU0ZGs1Z5YtrvDBop8QdEGgb15OuhsA97uoAXnh7c,6945
|
|
81
|
+
monitors/probes/train/latency.py,sha256=IfnDCE7L7KtSWO-0U0huXhb8vBl9u3iQ0iqDhC2YayM,2020
|
|
82
|
+
monitors/probes/train/methods.py,sha256=ipMqRI0Xy2OHNB769nGIakwydlqO0nXQ0qlcaOFqjJ0,2599
|
|
83
|
+
monitors/probes/train/metrics.py,sha256=vU4Nb552RBO_PBAKrtlYJWTPtTIZk1B1zlPzPDhgFN0,5926
|
|
84
|
+
monitors/probes/train/run.py,sha256=BaYqUUSF1csCXZB7QUr-prq480Omae-SYdgBxJwv0_k,10993
|
|
85
|
+
monitors/probes/train/sequence.py,sha256=rAy2Eu1WHV6b6_TfZVVxX6Uf45rYgoQNloaaqk9Ex1k,7453
|
|
86
|
+
monitors/probes/train/attention/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
|
+
monitors/probes/train/attention/config.yaml,sha256=1Nk1RlrrA9Et6mmad2CX4gPOn3p7o3bpYsGd6x4WphQ,1306
|
|
88
|
+
monitors/probes/train/attention/trainer.py,sha256=i_gKxCLX5w6et7DnLpyHDvO3RP30ImphFpbdvKTWohk,1938
|
|
89
|
+
monitors/probes/train/diffmean/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
|
+
monitors/probes/train/diffmean/config.yaml,sha256=LVw3Y1O6-pA-wJCxG06aaEg_xA2YbQVTG5XMkawWGxk,1203
|
|
91
|
+
monitors/probes/train/diffmean/trainer.py,sha256=MWw5awZaZZ6u_k927Th0UiSKDDRa5Wf7TbhMWBPFV9Y,2001
|
|
92
|
+
monitors/probes/train/linreg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
93
|
+
monitors/probes/train/linreg/config.yaml,sha256=MkTJGt11Kgc-4EdHHnQeK0YeVkXpsPUxZyRvCkTqo4g,1161
|
|
94
|
+
monitors/probes/train/linreg/trainer.py,sha256=eRbksBPXhx-3QlA136xmaG5hvTF0vVh0ZaWivin2Hn8,1413
|
|
95
|
+
monitors/probes/train/lr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
|
+
monitors/probes/train/lr/config.yaml,sha256=4LC3aHWSkAYaE90ZC7E6V9cM0fcdGOWFV1TucNjO-XU,1167
|
|
97
|
+
monitors/probes/train/lr/trainer.py,sha256=_w_9k0IObVemsZhKmIC_JV6T_ErAE6zy_2kcZTvpMlQ,2210
|
|
98
|
+
monitors/probes/train/mlp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
99
|
+
monitors/probes/train/mlp/config.yaml,sha256=IJBL0lte_UgmCiukGVHcUppkZJ9x6fLWeIiW90C_mug,1291
|
|
100
|
+
monitors/probes/train/mlp/trainer.py,sha256=lMh0dxw071SGURsfbzzQxYBPecmy0HTL3DQMBo3TIgc,2511
|
|
101
|
+
monitors/probes/train/multimax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
|
+
monitors/probes/train/multimax/config.yaml,sha256=dFkOWRxPu8Dy6iyb3Hk10dMTJ1YW3kYLGET1CDZlvjA,1286
|
|
103
|
+
monitors/probes/train/multimax/trainer.py,sha256=JMB1pjIdktalxIoqvthdmCRv2cZpHfIWMiH7_D0wUKo,1668
|
|
104
|
+
monitors/probes/train/rolling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
|
+
monitors/probes/train/rolling/config.yaml,sha256=72NYiHZM1B8CUBQJgHEMfLRRS5dpP_TOhl7kvNwYWG8,1362
|
|
106
|
+
monitors/probes/train/rolling/trainer.py,sha256=Vjlb-smpS_gb3EHFFrmdtVgomu1r8exJtEFlrJ7fnAI,1941
|
|
107
|
+
monitors/probes/train/swim/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
|
+
monitors/probes/train/swim/config.yaml,sha256=2rnQ5Nno4z_jw5FK5jL0UWJJ9XNRhGkEHLSPXnD5wz8,1299
|
|
109
|
+
monitors/probes/train/swim/trainer.py,sha256=PIS1NVVUst1Pa1muLMWVjS2VunL8n8CryI_cmcvdRZ8,1969
|
|
110
|
+
monitors/templates/probe/README.md.tmpl,sha256=TGNEIdA0cQHMKnBfoYLfScUTQJANjwflfRF3EjjLXBU,1614
|
|
111
|
+
monitors/templates/probe/serve.yaml.tmpl,sha256=meqlt4aWqMLqYc6a4u0dmJi36a_T6o3SkR5Neb1LUIA,240
|
|
112
|
+
monitors/templates/probe/traces.jsonl,sha256=ROVk9w6yTTbu8jwigCGATwGXfo1D0cKU8PW2Ca-tJH8,1374
|
|
113
|
+
monitors/templates/probe/train.py.tmpl,sha256=EEkAbp20OU5WebOWHNcyTbAiOOksY5iuUPrhQwUZ4Vw,688
|
|
114
|
+
mntr-0.2.0.dist-info/METADATA,sha256=RSGDfXZc3-BltLvFFFNMZzWYuJ1DrIxxRC7fvK5L5uQ,24987
|
|
115
|
+
mntr-0.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
116
|
+
mntr-0.2.0.dist-info/entry_points.txt,sha256=tNmyqhm4XUUDiIjPwGxkOkpCCiVn8wnfyA3tjj3Z16M,221
|
|
117
|
+
mntr-0.2.0.dist-info/licenses/LICENSE,sha256=L3j3-owz9x4Ce5JB0ngvVLEqLSAUxgUkqZ_quf3wQnk,1070
|
|
118
|
+
mntr-0.2.0.dist-info/RECORD,,
|