duck-duck-go-reworked-v2

Public

722 Downloads

3 stars

README

DuckDuckGo Reworked v2 for LM Studio

DuckDuckGo Reworked v2 is an LM Studio plugin that gives local assistants practical web search, image search, and page-reading tools without requiring API keys.

It uses DuckDuckGo's public HTML and image endpoints, improves request resilience, returns cleaner structured results, and downloads image results into the local working directory so they can be rendered directly in chat.

Tools

Searches DuckDuckGo web results and returns structured entries:

  • title: normalized result title
  • url: decoded destination URL, with DuckDuckGo redirect links resolved
  • snippet: page description from DuckDuckGo result text

This makes it easier for the model to choose which result to read before fetching a page.

Fetch Page

Fetches a web page by URL and returns plain text extracted from the page HTML.

Use this after Web Search when the assistant needs to read a specific result before answering.

Searches DuckDuckGo Images, downloads matching images locally, creates thumbnails when possible, and returns Markdown that can be embedded directly in the conversation.

If DuckDuckGo's image endpoint is blocked or unstable, the tool falls back to web-result pages, extracts image candidates from those pages, validates them by content type, and downloads the usable images.

Configuration

  • Search Results Per Page: default result count for search tools. 0 means auto.
  • Safe Search: strict, moderate, off, or auto.
  • Search Region: region/language ranking preference. Defaults to Global.

Available regions:

  • Global (wt-wt)
  • English, US (us-en)
  • Russian (ru-ru)
  • German (de-de)
  • French (fr-fr)
  • Chinese Simplified (zh-cn)
  • Japanese (ja-jp)

Improvements in v1.2.0

  • Web search results now include page snippets.
  • Added the Fetch Page tool for the full search → fetch → answer workflow.
  • Added a region/language setting for non-English search results.
  • Added in-memory LRU caching for web and image results.
  • Cache settings: 5 minute TTL, up to 50 entries per tool per plugin session.
  • Replaced burst image downloads with batched downloads: 3 concurrent requests per batch.
  • Updated the spoofed User-Agent pool to modern Chrome 124, Firefox 125, and Safari 17 strings.
  • Replaced fragile web-result extraction with HTML parsing via node-html-parser.

Reliability Features

  • Decodes DuckDuckGo uddg redirect URLs into real destination URLs.
  • Filters DuckDuckGo internal links from web search output.
  • Normalizes title and snippet whitespace.
  • Retries transient failures for DuckDuckGo and image-host requests.
  • Uses browser-like request headers for document, JSON, and image requests.
  • Validates downloaded images using content-type: image/*.
  • Provides structured diagnostics when the image endpoint appears blocked.
  • Preserves pagination and Safe Search behavior.

Installation

Install from LM Studio Hub:

Then click Run in LM Studio.

Local Development

From the plugin directory:

npm.cmd install
npm.cmd run dev

Use npm.cmd on Windows PowerShell if script execution policy blocks npm.ps1.

Publish

From the plugin directory:

npm.cmd run push

The script runs:

lms push

Example Prompts

Use Web Search to find current LM Studio plugin documentation. Return the raw search result.
Search the web for "LM Studio plugins", fetch the most relevant result, and summarize it.
Use Image Search for "modern electric car interior" with pageSize 4 and show the returned images.

Notes

This plugin uses public DuckDuckGo endpoints and page scraping. Result availability can vary depending on network conditions, DuckDuckGo rate limits, and individual source websites. The plugin includes retries, caching, fallback image discovery, and batched downloads to reduce failures, but it cannot guarantee that every external site will allow fetching or image downloads.