Webwright
Webwright copied to clipboard
feat(models): add Ollama backend with localhost support
Summary
Adds a new model backend for Ollama (local + cloud-hosted) via /v1/chat/completions.
Why
Enables running Webwright with self-hosted models — no API keys needed for local Ollama instances.
Changes
New files
src/webwright/models/ollama_model.py— auto-skips API key on localhost,ollama_extra_bodyfor arbitrary paramssrc/webwright/models/_chat_utils.py— shared serialization helpers (deduplicated from openrouter_model.py)src/webwright/config/model_ollama.yamlsrc/webwright/config/model_ollama_fast.yaml(reasoning_effort=none)src/webwright/config/model_ollama_reason.yaml(reasoning_effort=high)src/webwright/config/model_ollama_qwen.yaml(Qwen3-Coder 80B example)
Modified
src/webwright/models/__init__.py— +1 line registering ollama in MODEL_MAPPING
Usage
python -m webwright.run.cli -c base.yaml -c model_ollama.yaml -t "web task" --start-url https://example.com
Tested
Kali WSL2 with Ollama cloud models — imports, configs, and end-to-end flow.
@microsoft-github-policy-service agree