SLM Web Agent
Autonomous browser navigation agent powered by Playwright and local small language models for headless form filling and data extraction.
๐ Overview & Capabilities
Autonomous browser navigation agent powered by Playwright and local small language models for headless form filling and data extraction.
Key Features
- Headless browser interaction via Playwright
- Automated form navigation and locator selection
- DOM snapshot reduction for small model context windows
- Zero external API calls
๐ป Installation
Install the local package using pip:
๐ Checkout from GitHub
Clone only this agent's folder from the monorepo using Git sparse-checkout โ no need to download the full repository:
Option 1 โ Sparse Checkout (Recommended)
Option 2 โ Full Repository Clone
๐ก Tip: After checkout, install the package locally with pip install -e ./slm_web_agent to run in editable mode without publishing to PyPI.
โ๏ธ Configuration API
Constructor Parameters
Instantiate SLMWebAgent with performance and runtime options:
| Parameter | Type / Default | Description |
|---|---|---|
headless | bool | True | Run browser in headless background mode. Default: True. |
temperature | float | 0.0 | Action planning temperature. Default: 0.0. |
top_p | float | 0.9 | Nucleus sampling cutoff. Default: 0.9. |
max_tokens | int | 256 | Max token output limit. Default: 256. |
n_threads | int | 4 | CPU threads for model execution. Default: 4. |
Methods
| Method Signature | Return Type | Description |
|---|---|---|
browse(goal, start_url, ...) | dict | Executes multi-step Playwright web browsing tasks autonomously. |
Execution Parameters
Complete list of execution parameters accepted by the primary agent method:
| Parameter | Type / Default | Description |
|---|---|---|
goal | str | Target browser automation goal description. |
start_url | str | Initial Web URL to navigate to. |
system_prompt | str | None | Custom system instruction prompt override. Default: None. |
user_input | str | None | Optional additional user form fill values. Default: None. |
temperature | float | 0.0 | Sampling temperature. Default: 0.0. |
top_p | float | 0.9 | Nucleus sampling probability. Default: 0.9. |
max_tokens | int | 256 | Maximum token limit. Default: 256. |
Quick Start
๐ Verified Output Logs
Diagnostic execution console output running locally on CPU: