"""laya-browser: use the fine-tuned browser decision model straight from the Hugging Face Hub. pip install laya # the upstream laya package is the only dependency python laya_browser.py serve --port 8791 # TypeSafe-compatible /v1/systemone for browser-use/jev-ultrafast from laya_browser import LayaBrowser lb = LayaBrowser.from_pretrained("cklxx/laya-browser") d = lb.decide(page, goal="Search for 'vim' and open the package 'vim-common'.", history=[]) d["operation"], d["action"] # e.g. "CLICK", {"id": "e12", "label": "vim-common", ...} The model was trained on requests in a fixed format (this file reproduces it exactly: the operation / target questions, their instructions, the compact option strings, the form-field summary, the 1200-char page text and the coarse-to-fine split of wide choices). `laya.load("cklxx/laya-browser")` alone gives the raw model; call it through this file, or through `serve`, so the inputs match training. A page is jev-ultrafast's observation: {"url", "title", "text", "actions": [...]} where each action is {"id": "e3", "kind": "click" | "fill" | "select", "node": , "label": "Search", "role": "button", ...} (select actions carry "value" and "current_value"; page-level controls are {"id": "scroll_down", "kind": "scroll", "label": "Scroll down"} or {"id": "press_enter", "kind": "key", "label": ...}). History entries are {"action":