Skip to main content

LLM plugin: SearXNG search tool returning LLM-friendly markdown output

Project description

llm-tools-searxng-md

An llm plugin that exposes a searxng_search_md tool backed by a self-hosted SearXNG instance.

Why markdown output

LLMs work best with markdown. JSON-formatted search results waste tokens on syntax characters and require the model to mentally parse structure before it can reason about content. This plugin returns clean numbered lists — title, URL, and snippet — directly consumable by the model. Fewer tokens, less noise, faster answers.

It also uses llm keys set for URL management (no environment variable juggling required) and defaults to POST for better compatibility with most SearXNG instances.

Installation

llm install llm-tools-searxng-md

Or in editable mode from source:

llm install -e /path/to/llm-tools-searxng-md

Configuration

Recommended: llm keys

llm keys set searxng_url
# paste your SearXNG instance URL when prompted

Alternative: environment variable

export SEARXNG_URL=https://your-searxng.example.com

The URL is resolved in order: llm keys set searxng_urlSEARXNG_URL env var. One of these is required — there is no default.

The endpoint used is $SEARXNG_URL/search with format=json — your instance must have the JSON output format enabled in its settings.

HTTP method

By default the plugin uses POST (better compatibility with most SearXNG instances). To force GET:

export SEARXNG_METHOD=GET

Public SearXNG instances

If you don't run your own instance, several public ones are available. Check the SearXNG instance list for uptime and privacy policies before using one. A few commonly cited options:

  • https://paulgo.io
  • https://search.brave4u.com
  • https://searx.be

Note: public instances may rate-limit or restrict the JSON API. Self-hosting is recommended for reliable tool use.

Usage

After installing, the tool is automatically available to any model that supports tool calling:

llm prompt -T searxng_search_md "what is searxng"

Specify a model explicitly if your default does not support tools:

llm prompt -m gpt-4o -T searxng_search_md "latest news on llm tool plugins"

Verify the tool is registered:

llm tools
# should list: searxng_search_md

Tool signature

def searxng_search_md(query: str, max_results: int = 8) -> str

Returns the top max_results results as a numbered markdown list with title, URL, and snippet for each result.

Running tests

pip install -e '.[test]'
pytest tests/

Publishing to PyPI

Build and publish with uv:

uv build
uv publish

Or with the standard toolchain:

pip install build twine
python -m build
twine upload dist/*

Bump version in pyproject.toml before each release.

Related

  • SearXNG — the self-hosted metasearch engine this plugin connects to
  • llm — the CLI and Python library this plugin extends

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_tools_searxng_md-0.2.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_tools_searxng_md-0.2.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_tools_searxng_md-0.2.1.tar.gz.

File metadata

  • Download URL: llm_tools_searxng_md-0.2.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llm_tools_searxng_md-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e54e0fcba2e9d6527e4714fc106d5d27d93fe110dd2e8e791636d215346c9cfe
MD5 b4151dd73ff32982f934527a8b1e1118
BLAKE2b-256 9a1ee764f0fbf48856fe27eafce3d89dbc29796a763a45e15d50bbd69b499849

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_searxng_md-0.2.1.tar.gz:

Publisher: publish.yml on stochastic-sisyphus/llm-tools-searxng-md

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_tools_searxng_md-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_tools_searxng_md-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fd544b60c7f70b67324dacccd59fe598c6772ac54d3661058afe6e4429b4dad
MD5 8fc79f793ae06dcce5ad3f02b5f34523
BLAKE2b-256 b9f2ba9020eceacd2f9e447123e8ee72f7be05578a655a7820076d78288edd70

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_searxng_md-0.2.1-py3-none-any.whl:

Publisher: publish.yml on stochastic-sisyphus/llm-tools-searxng-md

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page