Spaces:
Runtime error
Runtime error
metadata
title: DeepSeek Proxy
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
π DeepSeek Proxy for Hugging Face
OpenAI-compatible proxy server for DeepSeek web chat β run it on Hugging Face Space for free, then connect VS Code/Cline for unlimited AI coding.
β‘ Quick Start (3 Steps)
Step 1: Create HF Space
- Go to huggingface.co/spaces
- Click "Create new Space"
- Settings:
- Space name:
deepseek-proxy(or any name) - SDK:
Docker - Visibility:
Privateβ οΈ (important for token security) - Hardware:
CPU free
- Space name:
- Click "Create Space"
Step 2: Set Your Token
- In your Space β Settings tab β Secrets
- Add a secret:
- Name:
DEEPSEEK_TOKEN - Value: Your DeepSeek browser token
- Name:
How to get your token:
- Open chat.deepseek.com in browser
- Press
F12β Application β Cookies βchat.deepseek.com - Find the token starting with
oxMs/...(usually inAuthorizationorauth-token) - Copy and paste into HF Secrets
β οΈ Token expires every ~7 days. Update it weekly.
Step 3: Deploy
Upload these files to your Space:
app.pyDockerfilerequirements.txt
Or use git:
git clone https://huggingface.co/spaces/YOURNAME/deepseek-proxy
cd deepseek-proxy
# copy files here
git add .
git commit -m "deploy proxy"
git push
Wait for the build (1-2 minutes), then check https://YOURNAME-deepseek-proxy.hf.space/health
π VS Code / Cline Setup
1. Install Cline Extension
- VS Code β Extensions β Search "Cline" β Install
2. Configure Cline Settings
Open VS Code settings (Ctrl+,) and add:
{
"cline.apiConfig": {
"apiProvider": "openai-compatible",
"openAiBaseUrl": "https://YOURNAME-deepseek-proxy.hf.space/v1",
"openAiModelId": "deepseek-chat",
"openAiApiKey": "hf-any-key"
}
}
Or use the Cline Settings UI:
- Click Cline icon in sidebar
- Settings β API Provider:
OpenAI Compatible - Base URL:
https://YOURNAME-deepseek-proxy.hf.space/v1 - Model ID:
deepseek-chat - API Key:
hf-any-key(any value works, auth is via your HF Space)
3. Test
Ask Cline: "What is 2+2?" β it should reply in ~5-10 seconds.
π§ Available Models
| Model | Use Case |
|---|---|
deepseek-chat |
Fast coding, general questions |
deepseek-reasoner |
Deep thinking, debugging, complex logic |
π§ Troubleshooting
"Token not configured" error
- Go to Space Settings β Secrets β make sure
DEEPSEEK_TOKENis set - Rebuild the Space (Factory Rebuild in Settings)
"PoW rejected" or timeout
- DeepSeek may have changed their PoW β check proxy logs in Space
- Try getting a fresh token from browser
Space goes to sleep
- HF Spaces sleep after 48h of inactivity
- Use UptimeRobot to ping
/healthevery 30 minutes - Or use HF Space's "Permanent" upgrade ($5/month)
Cline timeout errors
- Increase Cline timeout: Cline Settings β Request Timeout β 120 seconds
- The first request is slow (~20s) because of PoW solving
- Subsequent requests are fast (PoW is cached for 5 minutes)
π‘ API Endpoints
| Endpoint | Description |
|---|---|
GET / |
Status page |
GET /health |
Health check (for UptimeRobot) |
GET /v1/models |
List available models |
POST /v1/chat/completions |
Chat completion (OpenAI format) |
β οΈ Disclaimer
This uses DeepSeek's web chat via scraping. This is not an official API.
- Personal use only
- Token expires ~7 days
- DeepSeek may block this approach at any time
- Use at your own risk
π Links
- DeepSeek Web: chat.deepseek.com
- Hugging Face: huggingface.co/spaces
- Cline Extension: cline.bot
Made for free AI coding. Enjoy! π