deepseek2api  by iidamie

DeepSeek API for local inference

Created 7 months ago
256 stars

Top 98.7% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a reverse-engineered API for DeepSeek models, enabling users to interact with advanced AI capabilities through a familiar OpenAI-compatible interface. It is designed for researchers and developers who want to leverage DeepSeek's models, including those with advanced reasoning and web-searching features, without direct integration with the official DeepSeek platform. The primary benefit is offering a flexible and accessible way to utilize these powerful models.

How It Works

The project acts as a proxy, intercepting requests and forwarding them to DeepSeek's services. It supports multiple DeepSeek accounts to circumvent rate limits and manage access. The API is designed to be fully compatible with the OpenAI API specification, allowing seamless integration with existing tools and workflows. It supports features like high-speed streaming output, multi-turn conversations, and DeepSeek's R1 "deep thinking" capability.

Quick Start & Requirements

  • Installation: Docker, Docker-compose, Vercel, or native Python deployment are supported.
  • Requirements: One or more DeepSeek accounts are necessary. For Docker/Docker-compose, a server with a public IP and port 5001 open is required. For native deployment, Python environment and dependencies installed via pip install -r requirements.txt are needed.
  • Configuration: A config.json file is used to manage API keys and DeepSeek account credentials (email/password or mobile/password).
  • Resources: No specific hardware requirements are mentioned beyond a server for deployment. Setup is generally quick, depending on the chosen deployment method.
  • Links: DeepSeek Official

Highlighted Details

  • Fully compatible with OpenAI API endpoints, including /v1/chat/completions.
  • Supports multiple DeepSeek models: deepseek-chat, deepseek-reasoner, deepseek-chat-search, deepseek-reasoner-search.
  • Enables multi-account rotation to avoid single-account limitations.
  • Offers streaming output and multi-turn conversation support.

Maintenance & Community

The project is available on GitHub. No specific community channels (like Discord or Slack) or active maintainer information are detailed in the README.

Licensing & Compatibility

The README does not explicitly state a license. However, it includes a strong disclaimer stating the API is for research and learning purposes only, and prohibits commercial use or providing services to others due to potential risks and to avoid placing a burden on the official DeepSeek service.

Limitations & Caveats

This is a reverse-engineered API, which inherently carries the risk of instability and being blocked by DeepSeek. The README explicitly warns against relying on it for critical applications and recommends using the official DeepSeek API. Vercel deployment may encounter 504 timeouts due to the 10-second response limit on free accounts. Multi-turn conversations are implemented via message merging, which may degrade performance and is subject to single-turn token limits.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
17 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.