Skip to main content

duckduckgo-ai-chat

PyPI Changelog Tests License

CLI to use DuckDuckGo AI Chat service from terminal

Based on the ideas of duckduckGO-chat-cli

Usage

Duckduck-aichat

For help, run:

duckchat --help

You can also use:

python -m duckchat --help

This produces.

usage: duckchat [-h] [-m {1,2,3,4,5}] [-y] [-q QUERY]

CLI to use DuckDuckGo AI Chat service from terminal

optional arguments:
  -h, --help            show this help message and exit
  -m {1,2,3,4,5}, --model {1,2,3,4,5}
                        Select a model by key:
                         1: gpt-4o-mini
                         2: claude-3-haiku-20240307
                         3: meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
                         4: mistralai/Mistral-Small-24B-Instruct-2501
                         5: o3-mini
  -y, --yes             If provided, means user accept terms of service.
  -q QUERY, --query QUERY
                        First query to submit to the model

Using duckchat with initial Query

Now we can pass initial context when invoking a model with duckchat

cat app.py | duckchat --yes --model 4 --query "Explain this code" 

or launch a model with an initial query

duckchat -y -m 4 -q "How to use pytest-vcr?" 

query demo

Using Duckchat with uv

Use duckchat without installing with uv

uv run --with duckduckgo-ai-chat duckchat

Saving conversations in duckchat

Now user can save their conversaions using the /save command within the duckchat interface.

Save demo

And the saved file looks like this

Saved example

Available Models

Model Name Actual Model Performance Recommended Usage Characteristics
GPT-4o mini gpt-4o-mini Fast Quick, simple tasks Default model, Versatile
Claude 3 Haiku claude-3-haiku-20240307 Balanced Technical discussions Good context handling, Structured responses
Llama 3.3 70B meta-llama/Llama-3.3-70B-Instruct-Turbo Code optimized Programming tasks Documentation analysis, Code generation
Mistral Small 3 mistralai/Mistral-Small-24B-Instruct-2501 Knowledge focused Complex topics Detailed explanations, In-depth analysis
o3-mini o3-mini Very fast Simple queries Lightweight, Quick responses

Installation

Install this tool using pip:

pip install duckduckgo-ai-chat

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd duckduckgo-ai-chat
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

python -m pytest

Disclaimer

By using this client you accept DuckDuckGo AI Chat ToS

Metadata

Release files for duckduckgo-ai-chat 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duckduckgo-ai-chat 0.0.8
File Size Uploaded Provenance
duckduckgo_ai_chat-0.0.8.tar.gz 11.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for duckduckgo-ai-chat 0.0.8
File Interpreter ABI Platform
duckduckgo_ai_chat-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / duckduckgo_ai_chat-0.0.8.tar.gz

Download URL duckduckgo_ai_chat-0.0.8.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cbb799bf1a565b7e8c850aed8edade7936ed62e38a4a0051a4ffed72ca03c937
BLAKE2b-256 checksum
How to use checksums
a3b928c9574487b774a7c7b45b74bea037fe9fedcf08e3ecee4888b87909bdf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2025.

Transparency log

Release files / duckduckgo_ai_chat-0.0.8-py3-none-any.whl

Download URL duckduckgo_ai_chat-0.0.8-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6104fba5932d964c1208ef8d5084bba4d7d732a3b98c0afd090f9e14a7678ba4
BLAKE2b-256 checksum
How to use checksums
2df83cb847c6f8777881e694942246c23bcd920d60afe2543107d6ce5d13b49f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2025.

Transparency log

Security for duckduckgo-ai-chat 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for duckduckgo_ai_chat-0.0.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page