Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ services:
# API keys (set based on auth mode via .env.auth)
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}

volumes:
# Named volume for Claude Code config persistence
Expand Down
9 changes: 9 additions & 0 deletions scripts/ccr-config-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
"api_base_url": "http://host.docker.internal:1234/v1/chat/completions",
"api_key": "not-needed",
"models": ["qwen/qwen3-coder-30b", "openai/gpt-oss-20b"]
},
{
"name": "deepseek",
"api_base_url": "https://api.deepseek.com/chat/completions",
Comment thread
GreyDGL marked this conversation as resolved.
"api_key": "__DEEPSEEK_API_KEY__",
"models": ["deepseek-chat", "deepseek-reasoner"],
"transformer": {
"use": ["deepseek"]
}
}
],
"StatusLine": {
Expand Down
32 changes: 31 additions & 1 deletion scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ echo ""
echo -e " ${GREEN}[4]${NC} Local LLM (via LM Studio, Ollama, etc.)"
echo -e " Route requests to a local LLM server on your host machine"
echo ""
echo -e " ${GREEN}[5]${NC} Deepseek API Key"
echo -e " Route requests through Deepseek to use deepseek-chat, deepseek-reasoner, etc."

read -p "Enter your choice [1-4] (default: 1): " choice
read -p "Enter your choice [1-5] (default: 1): " choice
choice="${choice:-1}"

case $choice in
Expand Down Expand Up @@ -134,6 +136,34 @@ EOF
echo " 3. Run 'make connect' to start PentestGPT"
;;

5)
echo ""
echo -e "${BLUE}Deepseek Configuration${NC}"
echo -e "${YELLOW}Get your API key from: https://platform.deepseek.com/${NC}"
echo ""
read -sp "Enter your Deepseek API key: " deepseek_key
echo ""

if [ -z "$deepseek_key" ]; then
echo -e "${RED}Error: API key cannot be empty${NC}"
exit 1
fi

# Save auth mode
cat > "$ENV_FILE" << EOF
# PentestGPT Authentication Configuration
# Generated by make config
PENTESTGPT_AUTH_MODE=deepseek
DEEPSEEK_API_KEY=${deepseek_key}
EOF

# Set restrictive permissions on the file
chmod 600 "$ENV_FILE"

echo -e "${GREEN}Deepseek configuration saved!${NC}"
echo -e "${BLUE}CCR will be configured automatically when you run 'make connect'${NC}"
;;

*)
echo -e "${RED}Invalid choice. Exiting.${NC}"
exit 1
Expand Down
20 changes: 19 additions & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ NC='\033[0m'
# Router configurations for different modes
OPENROUTER_ROUTER='{"default":"openrouter,openai/gpt-5.1","background":"openrouter,openai/gpt-5.1","think":"openrouter,openai/gpt-5.1","longContext":"openrouter,openai/gpt-5.1","longContextThreshold":60000,"webSearch":"openrouter,google/gemini-3-pro-preview"}'
LOCAL_ROUTER='{"default":"localLLM,openai/gpt-oss-20b","background":"localLLM,openai/gpt-oss-20b","think":"localLLM,qwen/qwen3-coder-30b","longContext":"localLLM,qwen/qwen3-coder-30b","longContextThreshold":60000,"webSearch":"localLLM,openai/gpt-oss-20b"}'
# deepseek-v3.2 reasoner model is not compatible for for current ccr, will add deepseek-reasoner when it is available.
Comment thread
GreyDGL marked this conversation as resolved.
DEEPSEEK_ROUTER='{"default":"deepseek,deepseek-chat","background":"deepseek,deepseek-chat","think":"deepseek,deepseek-chat","longContext":"deepseek,deepseek-chat","longContextThreshold":60000,"webSearch":"deepseek,deepseek-chat"}'

setup_ccr() {
local mode="$1"
Expand All @@ -38,18 +40,26 @@ setup_ccr() {

# Substitute API key (for openrouter mode)
if [ -n "$api_key" ]; then
sed -i "s/__OPENROUTER_API_KEY__/${api_key}/g" "$CCR_CONFIG_FILE"
if [ "$mode" = "openrouter" ]; then
sed -i "s/__OPENROUTER_API_KEY__/${api_key}/g" "$CCR_CONFIG_FILE"
else
sed -i "s/__DEEPSEEK_API_KEY__/${api_key}/g" "$CCR_CONFIG_FILE"
fi
fi

# Substitute Router config based on mode (use | as delimiter to avoid conflicts with /)
if [ "$mode" = "openrouter" ]; then
sed -i "s|\"__ROUTER_CONFIG__\"|${OPENROUTER_ROUTER}|g" "$CCR_CONFIG_FILE"
local display_model="openai/gpt-5.1"
elif [ "$mode" = "deepseek" ]; then
sed -i "s|\"__ROUTER_CONFIG__\"|${DEEPSEEK_ROUTER}|g" "$CCR_CONFIG_FILE"
local display_model="deepseek-chat"
else
sed -i "s|\"__ROUTER_CONFIG__\"|${LOCAL_ROUTER}|g" "$CCR_CONFIG_FILE"
local display_model="localLLM (qwen/qwen3-coder-30b, openai/gpt-oss-20b)"
fi


echo -e "${BLUE}Starting Claude Code Router...${NC}"

# Start CCR daemon (nohup to keep it running)
Expand Down Expand Up @@ -93,6 +103,14 @@ case "$AUTH_MODE" in
fi
setup_ccr "openrouter" "$OPENROUTER_API_KEY"
;;
deepseek)
if [ -z "$DEEPSEEK_API_KEY" ]; then
echo -e "${YELLOW}Error: DEEPSEEK_API_KEY not set${NC}"
echo "Please run 'make config' and select Deepseek option"
exit 1
fi
setup_ccr "deepseek" "$DEEPSEEK_API_KEY"
;;
local)
echo -e "${GREEN}Local LLM mode${NC}"
echo -e "Ensure your local LLM server is running on host.docker.internal:1234"
Expand Down
Loading