deepseek4free  by xtekky

Python SDK for DeepSeek AI chat API

Created 1 year ago
258 stars

Top 98.1% on SourcePulse

GitHubView on GitHub
Project Summary

This Python package, xtekky/deepseek4free, offers an interface to the DeepSeek AI chat API, enabling developers to integrate advanced chat functionalities. It targets users needing real-time streaming, AI reasoning visibility, and web search, while also providing insights into reverse-engineering private APIs.

How It Works

The library interacts with DeepSeek's private API, managing authentication and Cloudflare challenges. Key features include token-by-token streaming, an optional "thinking process" mode to expose model reasoning, and integrated web search. A notable technical aspect is its efficient, WebAssembly-based proof-of-work solver for API access, complemented by robust error handling and threaded conversation support.

Quick Start & Requirements

Installation requires cloning the repository and using pip:

git clone https://github.com/xtekky/deepseek4free.git
cd deepseek4free
pip install -r requirements.txt

Authentication involves obtaining a DeepSeek auth token from browser Local Storage or network requests. Cloudflare challenges are addressed by running python -m dsk.bypass to capture a cf_clearance cookie. No specific hardware or OS prerequisites are detailed.

Highlighted Details

  • Reverse-engineered WebAssembly PoW solver for API access.
  • Optional visibility into the model's reasoning ("thinking process").
  • Integrated web search for current information retrieval.
  • Support for streaming responses, session management, and threaded conversations.
  • Custom exceptions for detailed error handling.

Maintenance & Community

The README provides no specific details on maintainers, community channels, sponsorships, or a roadmap. Updates are released to maintain compatibility with the frequently changing DeepSeek API.

Licensing & Compatibility

No software license is specified in the README. Users should verify usage restrictions, particularly for commercial applications, until a license is clarified.

Limitations & Caveats

The DeepSeek API is reportedly under high load, causing intermittent errors. The library requires manual management of authentication tokens and Cloudflare bypass, which can be complex. Frequent API changes necessitate keeping the library updated for compatibility.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
20 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.