Up to 7.2× the speed of standard llama.cpp Runs 100% on your PC
Free for personal use
Download free

Web search

POST/v1/web/search
Counts as a Local API promptBase URL http://localhost:1234/v1
Local API Guide contents

Overview

Runs the app's web search on its own and returns what it found, so you can build your own prompts or show sources. The loaded model plans the searches, so a model must be loaded and the request counts as one Local API prompt. Unlike web_search on chat completions, this endpoint always searches.

Request body

ParameterDescription
querystringrequiredWhat to search for: a question or keywords.
depthstringquick (a few seconds), balanced or deep (most thorough). Default: the app's setting (Balanced).
Authorization headerAuthorization: Bearer <key>, only when Require API key is on in the app.

Response

FieldDescription
objectstringweb.search
querystringYour query.
searchedbooleanAlways true here.
depthstringThe depth used.
queriesstring[]The searches the model ran.
pages_readintegerPages read in full.
secondsnumberHow long it took.
notestring | nullA remark, e.g. when nothing usable was found.
sourcesarrayindex, type (web), title, url, site, snippet.
contextstring | nullThe numbered passages, ready to put in your own prompt; null when nothing usable was found.

Example

curl http://localhost:1234/v1/web/search \
  -H "Content-Type: application/json" \
  -d '{"query": "NVIDIA GeForce RTX 5090 memory size", "depth": "quick"}'
Response
{
  "object": "web.search",
  "query": "NVIDIA GeForce RTX 5090 memory size",
  "searched": true,
  "depth": "quick",
  "queries": ["NVIDIA GeForce RTX 5090 memory size specs", "NVIDIA GeForce RTX 5090 memory size"],
  "pages_read": 5,
  "seconds": 6.8,
  "note": null,
  "sources": [
    { "index": 1, "type": "web", "title": "GeForce RTX 5090 Graphics Cards | NVIDIA",
      "url": "https://www.nvidia.com/…", "site": "nvidia.com", "snippet": "32 GB GDDR7 …" }
  ],
  "context": "[1] GeForce RTX 5090 Graphics Cards | NVIDIA / nvidia.com / https://www.nvidia.com/…\n…"
}

Errors

StatusCodeWhen
401invalid_api_keyRequire API key is on and the key is missing or wrong.
400invalid_requestquery is missing or empty, or depth is not quick, balanced or deep.
402trial_exhaustedToday's Local API allowance is used up.
503model_not_loadedNo model is loaded (the model plans the search).
502web_search_failedThe search failed, for example without an internet connection.

Web searches send your query to search engines (Bing, DuckDuckGo, Brave, Google, Wikipedia) and visit the pages found; everything else stays on your PC.