ds2api
by
CJackHwang

Description: DeepSeek-Compatible Middleware Interface: A technical exploration project in Go, focusing on high-concurrency protocol adaptation. It serves as a reference implementation for converting diverse web protocols into standardized formats.

View CJackHwang/ds2api on GitHub ↗

Summary Information

Updated 48 minutes ago
Added to GitGenius on May 5th, 2026
Created on January 21st, 2026
Open Issues & Pull Requests: 25 (+0)
Number of forks: 1,283
Total Stargazers: 4,233 (+1)
Total Subscribers: 16 (+1)

Issue Activity (beta)

Open issues: 19
New in 7 days: 34
Closed in 7 days: 28
Avg open age: 11 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 30
Closed in 7 days: 24
Comments in 7 days: 93
Events in 7 days: 192

Top labels

  • bug (89)
  • enhancement (47)
  • 公告 (3)
  • codex (2)
  • good first issue (2)
  • invalid (2)
  • question (2)
  • help wanted (1)

Detailed Description

The cjackhwang/ds2api repository is a technical exploration project written primarily in Go, designed to act as a high-concurrency middleware interface that adapts DeepSeek Web conversational capabilities into APIs compatible with OpenAI, Claude, and Gemini. Its main purpose is to provide a reference implementation for converting diverse web protocols into standardized formats, enabling developers and organizations to integrate DeepSeek’s advanced conversational models into their existing AI workflows and tools that expect OpenAI, Claude, or Gemini-compatible endpoints.

At its core, DS2API features a modular backend built in Go, which does not depend on the Python runtime, ensuring high performance and efficient concurrency management. The backend exposes HTTP API surfaces that mimic the endpoints of OpenAI, Claude, and Gemini, allowing clients and SDKs designed for these platforms to interact seamlessly with DeepSeek models. The middleware handles protocol translation, authentication, session management, and concurrency control, making it suitable for high-load environments and multi-user scenarios.

The repository includes a React-based WebUI management console, located in the `webui/` directory, which is automatically built and statically served during deployment. This admin interface supports both English and Chinese, offers dark mode, and allows administrators to manage configurations, monitor server status, test accounts, and view conversation logs. The project supports multiple deployment options, including local binary execution, Docker containers, Vercel serverless deployment, and traditional Linux systemd setups, making it flexible for various infrastructure needs.

DS2API’s core features include compatibility with major AI API protocols. For OpenAI, it supports endpoints such as `/v1/models`, `/v1/chat/completions`, `/v1/responses`, `/v1/embeddings`, and `/v1/files`. For Claude, it provides `/anthropic/v1/models`, `/anthropic/v1/messages`, and related endpoints. Gemini compatibility is achieved through endpoints like `/v1beta/models/{model}:generateContent` and supports both standard and streaming content generation. The middleware also implements a unified CORS policy, multi-account rotation with automatic token refresh, and fine-grained concurrency and queue management per account.

A notable technical achievement is the pure Go implementation of DeepSeek’s Proof-of-Work (PoW) algorithm, which ensures high performance and low latency. The system also features advanced tool calling adaptation, including leakage prevention, structured incremental output, and compatibility with both Go and Node.js semantics. The admin API allows for runtime configuration updates, proxy and account management, session cleanup, and version checks. Health and readiness probes are provided for operational monitoring.

Model aliasing is supported, allowing common model names (such as `gpt-4.1`, `claude-*`, or `gemini-*`) to be mapped to DeepSeek’s native models, ensuring broad compatibility with third-party clients. The repository includes comprehensive documentation, example configuration files, and deployment guides to facilitate setup and integration. Authentication can be managed via API keys or direct token passthrough, and the system provides robust mechanisms for handling high concurrency, including per-account inflight limits and dynamic queue sizing.

In summary, DS2API serves as a robust, high-performance middleware layer that bridges DeepSeek’s conversational AI with the broader ecosystem of OpenAI, Claude, and Gemini-compatible tools and clients. It is designed for research, experimentation, and internal use, with a strong emphasis on flexibility, extensibility, and operational reliability.

ds2api
by
CJackHwangCJackHwang/ds2api

Repository Details

Fetching additional details & charts...