Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ MODEL_NAME=google/gemini-2.5-flash
# OMNIJEV_BASE=Qwen/Qwen3.5-0.8B # the Qwen3.5 backbone of the same size
# OMNIJEV_PROMPT=full # full: text state + goal + rules; short: goal + ask over the screenshot

# ---- Clef / Clef-flash (behind --model clef; Workers AI or a local /v1/systemone server, no extra needed) ----
# CLEF_URL=http://127.0.0.1:30000 # local SGLang (lmsysorg/sglang:dev-clef); wins over Workers AI when set
# CLOUDFLARE_ACCOUNT_ID= # Workers AI, used only when CLEF_URL is unset
# CLOUDFLARE_AUTH_TOKEN= # official Clef-docs name; CLOUDFLARE_API_TOKEN is accepted as an alias
# CLEF_MODEL=clef-flash # or clef (27B). Default clef-flash (9B) for latency
# CLEF_API_KEY= # when a local server expects a bearer token
# CLEF_TIMEOUT_S=30 # per decision, the one refused-connection / 502 / 504 retry included

# ---- Optional Cua-S1 4B ----
# uv sync --extra cua-four-b (separate from the Laya demo).
# CUA_S1_VARIANT=4b
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); ver

## Unreleased

### Added

- `--model clef`: [Clef](https://huggingface.co/Cloudflare/clef) / [Clef-flash](https://huggingface.co/Cloudflare/clef-flash)
(Apache-2.0) as a **served** multimodal System One client against Cloudflare Workers AI or a local
`/v1/systemone` server (`CLEF_URL`, or `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_AUTH_TOKEN`; `CLEF_MODEL=clef|clef-flash`,
default `clef-flash`). Posts choice/noul with Clef's `images` array (PNG/JPEG/WebP data URLs, max 4) when the
observation has screenshots; a text observation still runs. `score` questions and `videos` are unsupported on
our interface (Workers AI Clef / Clef-flash also has no `videos` field). Contract tests use a fake HTTP server;
live Workers AI / GPU qualification is not claimed (#126).

## 0.4.0 - 2026-11-13

### Added
Expand Down
2 changes: 2 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ This product includes software developed by third parties:
Beurer-Kellner, Marc Fischer, and Florian Tramèr). Full license text: THIRD_PARTY_LICENSES.md
- s1a/decision_models/onejev.py: HTTP client for OneJev / qev (OmniJev/OneJev), Apache-2.0;
the weights and server are not vendored. Details: THIRD_PARTY_LICENSES.md
- s1a/decision_models/clef.py: HTTP client for Cloudflare Clef / Clef-flash, Apache-2.0;
the weights and serving image are not vendored. Details: THIRD_PARTY_LICENSES.md
8 changes: 8 additions & 0 deletions THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,11 @@ OneJev and its serving code are Apache License 2.0 (Copyright OmniJev Team). Thi
vendor OneJev weights, training code, or the `qev`/`flide` packages; install and run them separately
per the model card. The unrelated PyPI package named `qev` is not the OneJev server — install from the
OneJev GitHub repository as the model card instructs.

The `--model clef` adapter (`s1a/decision_models/clef.py`) talks to Cloudflare Clef or Clef-flash
through Workers AI or a local SGLang `/v1/systemone` server. Clef / Clef-flash weights and the
model card are Apache License 2.0 (Copyright Cloudflare). This repository does not vendor the
weights, `joint_schema_model.py`, or the `lmsysorg/sglang:dev-clef` serving image; use Workers AI
or install and run them separately per
https://huggingface.co/Cloudflare/clef and
https://developers.cloudflare.com/workers-ai/models/clef/.
6 changes: 3 additions & 3 deletions docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ hook of a running agent. The injection guard rail fails closed: a decision error
| `blackjack` | tool | payoff per hand (RLCard) | `s1a run blackjack --model jev --rethink off --episodes 100` |
| `injection_guard` | rail | precision and recall on a labelled injection set | `s1a run injection_guard` |

Every tool agent takes `--model jev|clm|laya|laya-served|cua|llm|random|rule`, `--rethink on|off`, `--episodes N`, `--seed S`,
Every tool agent takes `--model jev|clm|laya|laya-served|cua|clef|llm|random|rule`, `--rethink on|off`, `--episodes N`, `--seed S`,
`--max-steps` and `--timeout`, and writes a Harbor-shaped job folder under `evals/results/<agent>/`. A browser agent
takes `--model jev|clm|laya|laya-served|cua|omnijev|onejev|llm`, `--goal` and the same `--rethink` flag.
takes `--model jev|clm|laya|laya-served|cua|omnijev|onejev|clef|llm`, `--goal` and the same `--rethink` flag.
The desktop agent adds `--rethink-attempts` and `--rethink-timeout` and stalls after 3 actions without observed
progress. The browser front takes the same three names; `docs/browser-front.md` decision 19 describes its branch. A rail takes
`--model jev|clm|laya|laya-served`, the models that answer `noul`.
`--model jev|clm|laya|laya-served|clef`, the models that answer `noul`.
`uv run python -m evals.table evals/results` aggregates every job folder per eval and model into one table.

Every `run` prints one JSON object on stdout and nothing else there; `s1a-mcp` serves the same agents over stdio
Expand Down
7 changes: 4 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ validation; `docs/decision-models.md`), `s1a/decision_models/wire.py` (the HTTP
| `cua` | [Cua-S1 Nano](https://huggingface.co/cua-ai/cua-s1-nano-0.1) (`cua-ai/cua-s1-nano-0.1`, 855K) | in process, `uv sync --extra cua`; no key | a 256-byte context (header, goal, state, then rules), 96 bytes per option |
| `omnijev` | [OmniJev](https://github.com/tinnel123666888/OmniJev) (Qwen3.5 VL, 0.8B by default, 2B or 4B) | in process, browser agents only, `uv sync --extra omnijev` and a clone named by `OMNIJEV_REPO`; no key; a GPU for useful speed | a viewport screenshot per tick, plus the text state (recent actions first, page text capped at 2,000 characters) |
| `onejev` | [OneJev](https://github.com/OmniJev/OneJev) (0.8B–27B, Apache-2.0) via `qev`/`flide` | served HTTP, browser agents only; `ONEJEV_URL`; no cloud key | a viewport screenshot per tick as `media` with `<image:N>` in state |
| `clef` | [Clef](https://huggingface.co/Cloudflare/clef) / Clef-flash (Apache-2.0) | served HTTP: `CLEF_URL` (local `/v1/systemone`) or Workers AI (`CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_AUTH_TOKEN`); `CLEF_MODEL` selects `clef` or `clef-flash` | text state; optional screenshots as Clef `images` (max 4). No `score` questions or `videos` on our interface |
| `random`, `rule` | the tool front's two baselines | in process | the candidates |
| `llm` | the chat model | for the comparison columns | the transcript |

`decision_models.build_model(model_name)` builds the first six; `llm` is not a decision model.
`decision_models.build_model(model_name)` builds every `--model` name except `llm`, which is not a decision model.

## Entry points

Expand All @@ -64,7 +65,7 @@ the first import of both, routes the harness logs to files under `runs/logs` bef
MCP stdio protocol only.

Every `run` prints one JSON object on stdout: a tool agent's series summary with its `job_dir`, a browser agent's
answer, a rail's evaluation. A browser agent takes `--model jev|laya|cua|omnijev|onejev|llm`; its policy switches are run-time flags:
answer, a rail's evaluation. A browser agent takes `--model jev|laya|cua|omnijev|onejev|clef|llm`; its policy switches are run-time flags:
`--batch on|off`, `--prefetch on|off`, `--goal-values on|off`. `s1a-mcp` serves the same agents to an MCP host over stdio,
one Runner for the server's lifetime and one run at a time. `uv run python -m evals.table evals/results`
aggregates every job folder per eval and model into one table. `scripts/showcase.sh` plays one visual episode per
Expand All @@ -73,7 +74,7 @@ eval and model outside the matrix and `python -m evals.replay` renders a pair si

Every tool agent, `desktop` included, takes `--model jev|laya|cua|llm|random|rule`, `--rethink on|off`,
`--episodes N`, `--seed S`, `--max-steps`, `--timeout` and `--headed`, and writes a Harbor-shaped job folder under
`evals/results/<agent>/`. Every browser agent takes `--model jev|laya|cua|omnijev|onejev|llm` and `--goal`. A rail takes
`evals/results/<agent>/`. Every browser agent takes `--model jev|laya|cua|omnijev|onejev|clef|llm` and `--goal`. A rail takes
`--model jev|laya`, the two models that answer `noul`. `decide` and `probe` take `--model jev|laya|cua`. On a browser
agent `laya` needs `LAYA_MAX_LEN` raised to the page's size; `cua` reads a 256-byte context (header, goal, state,
then rules) and 96 bytes per option, a baseline on any page. Exit codes: 0 for a finished run, including one whose
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For issue trackers and serving support, see [System1-Omni model tracker #83](htt
| LAYA (`--model laya-served`; served checkpoint/revision is reported by the endpoint) | Text | `choice`, `noul` | Tool, browser, rails, `decide`/`probe`, MCP | Agents HTTP client can connect directly to a Laya worker or through System1-Omni `omni-jev` at `/v1/systemone` | Historical direct-worker and Omni-front MPS ticket-router measurements are recorded below (90 decisions/configuration, 63 correct each); historical CPU served request replay is separate and is not task-success evidence. Other hardware/checkpoints unverified. |
| OmniJev (`--model omnijev`; default `tinnel123/OmniJev-0.8B@v1.1` on `Qwen/Qwen3.5-0.8B`; configurable 2B/4B) | Screenshot plus text state/context | `choice`, `noul` | Browser front via `s1a run` and MCP `run_agent`; direct `build_model()` factory path. Not registered in tool/rails, CLI `decide`/`probe`, or MCP `decide` | In-process OmniJev clone via `MSO1.system_one`; no System1-Omni served vision path | Historical A100 80 GB 4B runs, Windows 11 CPU 0.8B runs, and A40 46 GB 4B runs are detailed below. They do not establish broad task success; current-main reproduction unverified. |
| OneJev (`--model onejev`; default request id `OmniJev/OneJev1.6-4B`; set `ONEJEV_MODEL`) | Screenshot(s) plus text state/context via TypeSafe `media` / `<image:N>` | `choice`, `noul` | Browser front via `s1a run` and MCP `run_agent`; direct `build_model()` factory path. Not registered in tool/rails, CLI `decide`/`probe`, or MCP `decide` | HTTP client to `qev`/`flide` at `ONEJEV_URL` (`POST /v1/systemone` + `media`) | Contract tests use a fake HTTP server. Live GPU / GGUF hardware validation **not recorded in this checkout** (#88). |
| Clef / Clef-flash (`--model clef`; variant via `CLEF_MODEL`, default `clef-flash`) | Text state, plus up to 4 PNG/JPEG/WebP screenshots in Clef's `images` array when present; an observation without an image still runs as text. `videos` are unsupported on our interface (the Workers AI Clef / Clef-flash input schema also has no `videos` field; that extension is documented on Clef-omni). | `choice`, `noul`. Clef's protocol also defines `score`, but Agents has no corresponding question type and this adapter does not send `score` questions. | Tool, browser, rails, CLI `decide`/`probe`, MCP `decide`, and `build_model()`. | HTTP to a local SGLang `/v1/systemone` server at `CLEF_URL`, or to Cloudflare Workers AI (`CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_AUTH_TOKEN`) at `POST /client/v4/accounts/$ACCOUNT_ID/ai/run/@cf/cloudflare/clef` or `clef-flash`. | **Adapter wired.** Contract tests use a fake HTTP server (local body and the Workers AI REST envelope). Live Workers AI or local-GPU qualification on a named checkpoint and path is **not recorded in this checkout** (#126). Cloudflare Decision Index and workflow-eval numbers are not Agents results and are not copied here. |
| Cua-S1 Nano (`cua-ai/cua-s1-nano-0.1/text`, `--model cua`, default variant) | Text | `choice` only | Tool/browser paths where registered; no screenshot input | In-process `cua_s1.nano.NanoScorer` | No real Nano inference artifact found in this checkout. **CPU/GPU/MPS unverified here.** |
| Cua-S1 4B 0.2 text adapter (`Qwen/Qwen3.5-4B` + `cua-ai/cua-s1-4b-0.2/text`, `CUA_S1_VARIANT=4b`, `CUA_S1_MODALITY=text`) | Text | `choice` only | Tool decisions and text-only client paths; desktop option grounding is implemented | In-process Transformers/PEFT scorer | Contract tests use a fake scorer; real checkpoint/device validation **not present in this checkout**. |
| Cua-S1 4B 0.2 multimodal adapter (`Qwen/Qwen3.5-4B` + `cua-ai/cua-s1-4b-0.2/multimodal`, variant `4b`) | One current screenshot plus text task/context | `choice` only; maximum 26 options in text and multimodal modes; multimodal requires exactly one screenshot | Screenshot-dependent desktop decision adapter; this does not itself complete the Omni capture/execute bridge | In-process Transformers/PEFT scorer with screenshot passed as a temporary file | Contract tests use a fake scorer; separate historical external evidence reports a bounded MPS fixture run (see below). Current-main reproduction and CUDA validation remain unverified. |
Expand Down
6 changes: 6 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ Variables can be exported in your shell or placed in a `.env` file at the root o
| `ONEJEV_MODEL` | `onejev` model | `OmniJev/OneJev1.6-4B` | Model id sent in the `/v1/systemone` body (checkpoint the server loaded, e.g. `OmniJev/OneJev1.6-0.8B`). |
| `ONEJEV_API_KEY` | `onejev` model | *(unset)* | Bearer token when the server expects one; loopback `qev`/`flide` usually needs none. |
| `ONEJEV_TIMEOUT_S` | `onejev` model | `30` | Deadline per decision in seconds, the one refused-connection / 502 / 504 retry included. A finite number above 0. Raise for large checkpoints or a cold load. |
| `CLEF_URL` | `clef` model | *(unset)* | Base URL of a local Clef / Clef-flash server, e.g. `http://127.0.0.1:30000`. Posts to `{CLEF_URL}/v1/systemone`. When set, this wins over Workers AI credentials. Required unless `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_AUTH_TOKEN` are set. |
| `CLOUDFLARE_ACCOUNT_ID` | `clef` model | *(unset)* | Cloudflare account id for Workers AI (`POST /client/v4/accounts/$ACCOUNT_ID/ai/run/@cf/cloudflare/clef` or `clef-flash`). Used only when `CLEF_URL` is unset. |
| `CLOUDFLARE_AUTH_TOKEN` | `clef` model | *(unset)* | Bearer token with Workers AI permission, as in the official Clef docs. `CLOUDFLARE_API_TOKEN` is accepted as an alias. Used only when `CLEF_URL` is unset. |
| `CLEF_MODEL` | `clef` model | `clef-flash` | Variant sent in the request body and, on Workers AI, selected in the run URL: `clef` (27B) or `clef-flash` (9B, default for latency). Other values are a configuration error. |
| `CLEF_API_KEY` | `clef` model | *(unset)* | Bearer token for a local `/v1/systemone` server when it expects one; loopback SGLang usually needs none. |
| `CLEF_TIMEOUT_S` | `clef` model | `30` | Deadline per decision in seconds, the one refused-connection / 502 / 504 retry included. A finite number above 0. |
| `CUA_DRIVER_BIN` | `desktop` agent | `cua-driver` | Path to the `cua-driver` executable on Windows or macOS when not located on `PATH`. |
| `CUA_DRIVER_PERMISSION_MODE` | `desktop` agent | `standard` | Permission mode passed to `cua-driver mcp` (`standard`, or `bounded` for restricted capability manifests). |
| `HF_HOME` | Hugging Face runtime | `~/.cache/huggingface` | Cache directory where Laya and Cua-S1 checkpoints are downloaded on first run. |
Expand Down
Loading