Skip to content

v0.10.0 - Smart Routing, Benchmark-Ranked Defaults & Search Options

Choose a tag to compare

@ilchemla ilchemla released this 09 Nov 12:44
fc1d906

Every prompt goes to the right tool and service, within your budget of time and money, and the default order is now the one that scored best on public benchmarks.

🚀 What's New

Smart routing (#102)

  • Send each prompt to the right tool and the best service for it, within the time and money you allow, instead of one fixed order for everything
  • Plug in any router that decides where a prompt goes. WebRouter gives it every service that could answer, with its estimated price and latency, runs its pick and falls back to the next one if it fails. Four examples to start from: plain rules (no model, no key), a scikit-learn classifier you train on your own prompts, any OpenAI-compatible LLM, and TypeSafe's Jev, which scores each candidate with a probability
  • plan() previews a prompt, run() runs it, and a Budget caps estimated cost and time. Agents get it through the MCP server's web_run
from web_router import Budget, RouteDecision, RouteRequest, WebRouter


def route(req: RouteRequest) -> RouteDecision:
    if req.urls:  # the http(s) URLs in the prompt
        return RouteDecision(tools=["extract"])
    return RouteDecision()  # no opinion: the default order runs


wr = WebRouter(router=route)
response = wr.run("read https://example.com/pricing", budget=Budget(max_cost_usd=0.05))

Defaults ranked by benchmark (#74)

  • With no router, auto now tries services in the order that answered best on public question sets: SealQA (hard) for search and SimpleQA for answers. When two services score within the noise, the cheaper one goes first
  • The order follows the results, not habit: with Brave and Exa keys, Exa now goes first, at a higher price. Set your own order in provider_config

Search: recency and effort (#108)

  • recency keeps results from the last day, week, month or year; effort picks a faster or more thorough tier, and higher costs more
  • search_depth now means a size: lite about 500 characters, fast a few thousand, deep the whole page

Logged-in pages without a browser (#98)

  • The login you save in a browser session (since v0.6.0) now also works for extract(): pass the same profile id with provider="browserbase" and read pages as that user, with no browser session to start or release

Also new: WebRouter is now licensed under the Apache License 2.0 (#111).

🐛 Fixes

  • The MCP server refuses unknown arguments and private URLs instead of dropping or sending them (#109)
  • extract() counts an error page with no text as a failure, so auto tries the next service (#109)

🔄 Behaviour Change

  • auto's default search and answer orders changed (see above), so with some keys a different service serves first (#74)
  • The decider proof of concept (decider=, classify(), execute()) is removed; routers replace it. Pin web-router==0.9.0 to keep it (#102)
  • Search refuses a value a service cannot serve before sending it, and Parallel moved to its v1 API, which refuses the beta processor and excerpts options (#108)
  • The mcp extra now needs mcp 2.2 or later (#109)

Full Changelog: v0.9.0...v0.10.0