npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

duckduckgo-chat-interface

v1.1.5

Published

A powerful Node.js interface for DuckDuckGo AI Chat with advanced configuration, rate limiting, and image support

Downloads

333

Readme

🦆 DuckDuckGo AI Chat Interface


✨ Key Features

🧠 5 Advanced AI Models

  • GPT-4o mini - Versatile + WebSearch + Image Support
  • Claude 3 Haiku - Excellent for creative writing
  • Llama 3.3 70B - Optimized for programming
  • Mistral Small - Advanced analysis and reasoning
  • o4-mini - Ultra-fast for quick responses

🔧 Advanced Configuration

  • Intelligent rate limiting - Automatic protection
  • Configurable tools - WebSearch, news, weather, local search
  • Logging system - Debugging and monitoring
  • Automatic retry - Robust error recovery
  • Optimized presets - Ready-to-use configurations

📱 Flexible Interfaces

  • Simple messages - Intuitive API
  • Real-time streaming - Progressive responses
  • Multimodal support - Images with GPT-4o mini
  • Persistent sessions - Conversation history
  • Complete TypeScript - IntelliSense and validation

📦 Installation

npm install duckduckgo-chat-interface

🚀 Quick Usage

Basic Example

import { DuckDuckGoChat, Models } from 'duckduckgo-chat-interface';

const chat = new DuckDuckGoChat(Models.GPT4Mini);
await chat.initialize();

const response = await chat.sendMessage("Hello, how are you?");
console.log(response);

With WebSearch (GPT-4o mini)

import { DuckDuckGoChat, ChatConfig, Models } from 'duckduckgo-chat-interface';

const config = ChatConfig.webSearchMode();
const chat = new DuckDuckGoChat(Models.GPT4Mini, config);
await chat.initialize();

chat.enableWebSearch();
const response = await chat.sendMessage("Latest AI news?");
console.log(response);

Image Support

const images = [{
  base64: imageBase64String,
  mimeType: 'image/jpeg'
}];

const response = await chat.sendMessage("Describe this image", images);
console.log(response);

Real-time Streaming

const response = await chat.sendMessageStream(
  "Tell me a story",
  (chunk) => process.stdout.write(chunk)
);

📚 Documentation


📊 Models and Capabilities

| Model | WebSearch | Images | Strength | Recommended Usage | |--------|:---------:|:------:|-------|------------------| | GPT-4o mini | ✅ | ✅ | Versatile | General questions, search | | Claude 3 Haiku | ❌ | ❌ | Creativity | Writing, explanations | | Llama 3.3 70B | ❌ | ❌ | Technical | Code, programming | | Mistral Small | ❌ | ❌ | Logic | Analysis, reasoning | | o4-mini | ❌ | ❌ | Speed | Quick responses |


🔧 Configuration Presets

// WebSearch mode (GPT-4o mini)
const config = ChatConfig.webSearchMode();

// News mode
const config = ChatConfig.newsMode();

// Local mode (weather + local search)
const config = ChatConfig.localMode();

// High performance mode
const config = ChatConfig.highVolumeMode();

📈 Examples

Explore detailed examples in the examples/ folder:


🛡️ Compatibility

  • Node.js : >= 14.0.0
  • TypeScript : Full support with types
  • ES Modules : Native ESM format
  • Backward compatibility : 100% with 1.x versions

🚨 Important Notes

  • WebSearch and images only with GPT-4o mini
  • Rate limiting enabled by default to protect API
  • initialize() required before sending messages
  • Automatic retry on temporary errors

📞 Support and Community


📜 License

MIT License - see LICENSE for details.