Instructions to use sodan/laya-cua with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use sodan/laya-cua with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- laya-cua
- What it does NOT do
- Input and output
- Usage
- Training
- Held-out results (n=334, single run each)
- Results log
- Function calling checkpoint (
function_calling/) - Live check on unseen AgentNet steps (Colab T4, one run)
- Negative result: Mind2Web zero-shot
- Limits
- Mind2Web fine-tune rerun on CPU (negative result)
- More Mind2Web runs: all three fine-tunes collapse to click (negative result)
- Positive result with an oracle target: Mind2Web operation type, target element given
- Grounding check: ShowUI-2B on ScreenSpot (reference model, Laya not involved)
- Small pipeline test: ShowUI-2B picks the target, Laya decides the operation (n=100, single run)
- What it does NOT do
laya-cua
One repo, two Laya checkpoints. Root = computer-use action type (AgentNet). function_calling/ = call or no-call and which function (Glaive). Both are decision layers: they do not write text, coordinates or arguments, and they do not read screenshots.
A small (421M) model for computer-use agents. Given a task, a text description of the current screen and the last few steps, it answers two questions in one forward pass:
- What kind of action comes next? One of: click, type, key, scroll, move, wait, drag, done.
- Is the task already finished? (yes/no probability)
What it does NOT do
- It does not generate text, so it cannot write the string to type.
- It does not output click coordinates or element IDs.
- It does not read screenshots. The input is text (see format below).
- It is not a full agent. Use it as a fast router or sanity check next to whatever picks the target and the text (an LLM, a grounding model, a script).
Input and output
Input: a dict with task (instruction), screen (text description or accessibility tree of the current screen, trained on up to 1,800 characters) and history (up to the last 4 steps as short strings).
Output: answers["action_type"]["choice"] is one action name, answers["task_done"]["noul"] is the probability the task is done. The result also carries confidence values.
Usage
pip install laya huggingface_hub
import laya
from huggingface_hub import snapshot_download
ACTIONS = {
"click": "click or tap a UI element", "type": "type text into a focused field",
"key": "press a key or shortcut", "scroll": "scroll the view",
"navigate": "open a URL or switch app or tab", "move": "move the mouse without clicking (hover)",
"wait": "wait for the page or app to load", "drag": "drag and drop or select by dragging",
"done": "the task is already complete, stop",
}
QUESTIONS = {
"action_type": {"type": "choice", "instructions": "Which action type should the agent take next?", "criteria": ACTIONS},
"task_done": {"type": "noul", "instructions": "Is the task already fully complete on screen?"},
}
agent = laya.Agent(snapshot_download("sodan/laya-cua"), device="cuda") # or "cpu"
state = {"task": "Open the settings app and turn on dark mode",
"screen": "Settings window. Sidebar: Network, Display, Sound. Display page shows Theme: Light.",
"history": ["opened Settings"]}
res = agent.predict(state, QUESTIONS)
print(res["answers"]["action_type"]["choice"], res["answers"]["task_done"]["noul"])
The calls (laya.Agent, predict, answers[...]) are the same ones used for the evaluation below, and loading this repo from the Hub was run and worked. The exact snippet above is being re-run end to end and this line will be updated once it has.
Training
- Base: convaiinnovations/laya (ModernBERT-large encoder plus a typed decision head). Method: the official
laya.trainRLCD loop on one free Colab T4. - Data: OpenCUA AgentNet (xlangai/AgentNet, MIT), 400 tasks, one row per step: 5,822 train rows. Held-out: the same 334 rows (from 200 other tasks, whole tasks held out) used for every version. Labels come from the recorded action.
needs_humanhas no label and was not trained. - 2 epochs, same recipe as v0. The only change between v0 and v1 is more training tasks.
Held-out results (n=334, single run each)
| metric | v1 (current) | v0 (200 tasks) | base Laya | always "click" |
|---|---|---|---|---|
| action_type accuracy | 0.8084 | 0.7665 | 0.1856 | 0.7156 |
| task_done accuracy | 0.9611 | 0.9581 | 0.7066 | not computed |
Results log
| version | change | action_type | task_done | status |
|---|---|---|---|---|
| v0 | 200 tasks, 2 epochs | 0.7665 | 0.9581 | replaced |
| v1 | 400 tasks, 2 epochs | 0.8084 | 0.9611 | current (re-downloaded from this repo and re-evaluated: same numbers) |
Function calling checkpoint (function_calling/)
convaiinnovations/laya fine-tuned on glaiveai/glaive-function-calling-v2 to decide (1) whether to call a function now and (2) which listed function. It does not write function arguments. Load it the same way as the main model, pointing laya.Agent at the function_calling folder after snapshot_download("sodan/laya-cua") (this exact path was not re-run after the move from a separate repo; the files are byte-identical copies).
Split by conversation: train 4500 rows, dev 1454, test 2574. 2 epochs, free Colab T4, one run, one seed.
| Test metric | Base Laya | Fine-tuned | Always no-call | Random pick |
|---|---|---|---|---|
| tool_call accuracy (n=2574) | 0.3042 | 0.9573 | 0.648 | n/a |
| tool_choice accuracy (n=906) | 0.9989 | 1.0 | n/a | 0.8786 |
Dev: tool_call 0.2978 (base) vs 0.9519 (fine-tuned). The gain is the call/no-call decision; tool_choice is near the ceiling for base Laya because most prompts list one or two functions. Single run, no confidence intervals. An earlier run on laya 0.4.37 gave test tool_call 0.9545.
Live check on unseen AgentNet steps (Colab T4, one run)
Streamed AgentNet tasks far past the 400 used for training and eval (469 steps from 30 tasks). action_type accuracy 0.859 vs 0.744 for always-click. Small sample, steps are clustered by task, and the task mix differs from the n=334 eval above, so do not compare the two numbers as a trend. In 8 randomly shown examples 6 matched; the misses were VS Code steps (predicted click, recorded move or key). Rare actions (move, key) are mostly missed.
Negative result: Mind2Web zero-shot
osunlp/Mind2Web (CC-BY-4.0) train split, 80 tasks, 628 steps, never seen by Laya. Screen = tags stripped from cleaned_html, first 1500 characters (far from the prose descriptions Laya trained on). Task: CLICK / TYPE / SELECT.
| model | op accuracy |
|---|---|
| always CLICK | 0.8376 |
| laya-cua v1 | 0.8041 (TYPE recall 2/86) |
| base Laya | 0.1513 |
v1 does not beat always-CLICK here and does not transfer to raw web text. Laya has no SELECT class, so 16 SELECT steps can never match. Single run.
Limits
- Small test set (334 rows), a single run per version, only 400 tasks of training data.
- v1 is about 9 points above always predicting "click" (0.8084 vs 0.7156). That is a measured gap on this one split, not a guarantee elsewhere.
- About 94% of held-out rows are "not done", so task_done accuracy is close to a trivial baseline.
- Trained on AgentNet text descriptions (mostly Ubuntu-style desktop tasks). Behavior on other screen formats, apps or phone UIs is untested.
- Besides the Mind2Web zero-shot test above, no other benchmarks were run. Laya is a decision layer, not an end-to-end computer-use agent.
License: Apache-2.0 (as the base). Data: AgentNet, MIT.
Mind2Web fine-tune rerun on CPU (negative result)
Free GitHub Actions CPU runner, $0: https://github.com/somdipto/laya-cua/actions/runs/44786704167. Code and raw numbers: https://github.com/somdipto/laya-cua (m2w_cpu_finetune.py, results/). Also in this repo: mind2web_cpu_results.json.
Next action type on Mind2Web (osunlp/Mind2Web, CC-BY-4.0), cleaned HTML text only, whole tasks held out, 1634 eval steps.
| Model | Accuracy | Type recall |
|---|---|---|
| always-click | 0.8286 | n/a |
| laya-cua v1, zero-shot | 0.7809 | 2/211 |
| fine-tuned, 1 epoch, 900 train rows, CPU | 0.8286 | 0/211 |
The fine-tuned model predicts "click" on every step, so it ties always-click and adds nothing. Single run, one seed, 900 of 6141 train rows, 512-token inputs, one epoch, because of the free CPU limit. The full-data GPU run below was run afterwards.
More Mind2Web runs: all three fine-tunes collapse to click (negative result)
Same eval for every row: 1634 held-out-task steps, always-click 0.8286, laya-cua v1 zero-shot 0.7809 (TYPE recall 2/211). Each fine-tune is a single run, single seed.
| Run | Train rows | Accuracy | TYPE recall | Predicts |
|---|---|---|---|---|
| CPU, GitHub Actions, 1 epoch | 900 | 0.8286 | 0/211 | click on every step |
| CPU, class-balanced, 1 epoch (https://github.com/somdipto/laya-cua/actions/runs/44835333968) | 900 | 0.8286 | 0/211 | click on every step |
| GPU, free Colab T4, 1 epoch, train loss 2.43 | 6141 | 0.8286 | 0/211 | click on every step |
Check on the GPU checkpoint: with max_len 512 or 1024 and with the fitted or neutral temperature, it still predicts click for all of 100 TRAIN rows it saw (47 type, 13 select, 40 click; accuracy 0.40, the click share) and for 300 held-out rows (0.763). So the collapse is not an eval-config artifact.
Likely cause (hypothesis, not tested): the input is the task, the first 1500 characters of page text and recent steps. On Mind2Web the operation depends on which element is the target, and the target is not in the input, so predicting the majority class is the best the model can do here. The next experiment adds the target element's tag and attributes to the input. This does not say Laya cannot work as a decision layer; it says this recipe on this input does not.
Positive result with an oracle target: Mind2Web operation type, target element given
Same 1634 held-out-task steps. The input now also has the recorded GROUND-TRUTH target element (tag and a few attributes) for the step. No model picks that element, so this is not end-to-end. It tests one thing: given a target, can Laya choose click, type or select. Free GitHub Actions CPU runner, 900 class-balanced train rows (450 click, 300 type, 150 select), 1 epoch, train loss 0.88, single run, one seed. Run: https://github.com/somdipto/laya-cua/actions/runs/44865069411 . Raw numbers: https://github.com/somdipto/laya-cua/blob/main/results/m2w_target_results_target900.json
| Model | Accuracy | TYPE recall |
|---|---|---|
| always-click | 0.8286 | n/a |
| laya-cua v1 zero-shot (no target in input) | 0.7809 | 2/211 |
| fine-tuned, no target in input (3 runs above) | 0.8286 | 0/211 |
| fine-tuned, oracle target in input | 0.9119 | 197/211 |
Predicted mix: 1250 click, 316 type, 68 select. This is 8 points above always-click and the first fine-tune here that is not all-click, which supports the hypothesis that the missing target element was the cause. Caveats: single run, the target is the ground-truth element, only 900 of 6141 train rows were used, and the 8-point gap is on one split with no confidence interval. A real agent would need a separate model to choose the target.
Grounding check: ShowUI-2B on ScreenSpot (reference model, Laya not involved)
This measures a separate grounding model (showlab/ShowUI-2B, MIT), not Laya. It is the kind of model that would pick the target for Laya's decision. Metric: the predicted click point falls inside the target box. Random 200-sample subset of ScreenSpot (rootsautomation/ScreenSpot, apache-2.0, 1272 total), single run, free GitHub Actions CPU in float32, image resolution cut to at most 4002828 pixels for speed. Run: https://github.com/somdipto/laya-cua/actions/runs/44886978790 . Raw numbers: https://github.com/somdipto/laya-cua/blob/main/results/screenspot_results_ss.json
| click-in-box accuracy (n=200) | |
|---|---|
| centre-of-screen point | 0.020 |
| random point | 0.010 |
| ShowUI-2B (reduced resolution, CPU) | 0.400 |
By type: text 0.378 (n=111), icon 0.427 (n=89). By source: android 0.71 (31), ios 0.52 (46), windows 0.45 (29), forum 0.30 (20), macos 0.27 (26), shop 0.21 (19), gitlab 0.17 (12), tool 0.12 (17). Small per-source counts.
Caveat: 0.40 is far below what the ShowUI authors report for the full benchmark at full resolution. I did not find the cause. The cut in image resolution is the most likely factor, but that is a guess, not tested. Do not compare this number with published ones. It only shows a small grounding model gets the target right clearly more often than chance on a subset. No end-to-end pipeline (Laya plus a grounding model on the same steps) has been run or measured.
Small pipeline test: ShowUI-2B picks the target, Laya decides the operation (n=100, single run)
Two models on the same 100 steps from the Multimodal-Mind2Web test_task split (osunlp/Multimodal-Mind2Web, OpenRAIL licence). ShowUI-2B (MIT) gets a screenshot and the element's name text and returns a click point. The point is mapped to the smallest candidate element box that contains it. Laya (re-trained for this run on 900 class-balanced Mind2Web text rows, 1 epoch, train loss 1.22) gets that element's tag and attributes plus the task and page text and picks click, type or select. Free GitHub Actions CPU, about 3.6 hours. Run: https://github.com/somdipto/laya-cua/actions/runs/44900747967 . Raw numbers: https://github.com/somdipto/laya-cua/blob/main/results/pipeline_results_pipe.json.
| Setup | Operation accuracy (n=100) | TYPE recall (n=23) |
|---|---|---|
| always-click (76 click, 23 type, 1 select) | 0.76 | 0/23 |
| Laya + ground-truth target element | 0.87 | 21/23 |
| Laya + ShowUI-2B's target | 0.80 | 11/23 |
ShowUI's click point fell inside the true target box on 43 of 100 steps, and it selected the exact right element on 38 of 100. Laya's operation accuracy dropped from 0.87 to 0.80 when it was given ShowUI's element instead of the true one. It stays 4 points above always-click, which is within what 100 steps can resolve (about +-8 points), so treat this as a hint, not a confirmed gain.
Caveats: 100 steps, one run, one seed. Only steps whose target sits in the top 1280x720 of the page were used, because ShowUI expects a viewport screenshot (285 rows scanned to find 100). ShowUI was given the element's name from the annotation, which makes grounding easier than with a task alone. Screenshots were resized to 1008x560. Past steps in the history use the dataset's role names, while training used HTML tags. Only 1 of the 100 steps was a select. Not comparable with published Mind2Web numbers. Laya still does not output coordinates or text.
- Downloads last month
- 125
Model tree for sodan/laya-cua
Base model
convaiinnovations/laya



