feat: add DeepSeek and Minimax (m2.7) translation providers
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled

New providers:
- DeepSeek: direct API with deepseek-chat model, very cost-effective
- Minimax: MiniMax-M1 model via OpenAI-compatible API, supports m2.7

Changes:
- Full provider implementations with retry, health check, batch support
- Provider config with env vars (DEEPSEEK_*, MINIMAX_*)
- Auto-registration in provider registry
- Updated fallback chain to include new providers
- Updated setup-env.sh wizard with options 6 (deepseek) and 7 (minimax)
- Updated manage-keys.sh with new menu entries and provider switching
- Updated docker-compose.yml with new env vars

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 12:30:36 +02:00
parent d6d19eaf0c
commit e6e1678b1d
7 changed files with 603 additions and 11 deletions

View File

@@ -101,6 +101,8 @@ while true; do
show_key_status "OpenAI" "OPENAI_API_KEY"
show_key_status "DeepL" "DEEPL_API_KEY"
show_key_status "OpenRouter" "OPENROUTER_API_KEY"
show_key_status "DeepSeek" "DEEPSEEK_API_KEY"
show_key_status "Minimax" "MINIMAX_API_KEY"
show_key_status "Google" "GOOGLE_API_KEY"
echo ""
@@ -121,7 +123,9 @@ while true; do
echo " 4) Configurer Stripe (toutes les cles)"
echo " 5) Changer le mot de passe admin"
echo " 6) Changer le service de traduction"
echo " 7) Tout afficher (attention: secrets visibles)"
echo " 7) Configurer DeepSeek"
echo " 8) Configurer Minimax (m2.7)"
echo " 9) Tout afficher (attention: secrets visibles)"
echo " 0) Quitter"
echo ""
echo -ne "${YELLOW}Choix:${NC} "
@@ -192,10 +196,12 @@ while true; do
6)
echo -e "\n${BOLD}--- Service de traduction ---${NC}"
echo " Actuel: $(get_env TRANSLATION_SERVICE)"
echo " 1) ollama (local, gratuit)"
echo " 2) deepl (haute qualite)"
echo " 3) openai (GPT)"
echo " 1) ollama (local, gratuit)"
echo " 2) deepl (haute qualite)"
echo " 3) openai (GPT)"
echo " 4) openrouter (multi-modeles)"
echo " 5) deepseek (bon rapport qualite/prix)"
echo " 6) minimax (MiniMax-M1 / m2.7)"
echo ""
echo -ne " Choix: "
read -r svc
@@ -204,12 +210,34 @@ while true; do
2) set_env "TRANSLATION_SERVICE" "deepl" ;;
3) set_env "TRANSLATION_SERVICE" "openai" ;;
4) set_env "TRANSLATION_SERVICE" "openrouter" ;;
5) set_env "TRANSLATION_SERVICE" "deepseek" ;;
6) set_env "TRANSLATION_SERVICE" "minimax" ;;
*) echo -e " ${RED}Choix invalide${NC}" ;;
esac
echo -e " ${GREEN}Service mis a jour${NC}"
echo -e " ${YELLOW}Redemarre: docker compose restart backend${NC}"
;;
7)
echo -e "\n${BOLD}--- DeepSeek ---${NC}"
echo " Ou: https://platform.deepseek.com/api_keys"
echo " Modele par defaut: deepseek-chat"
ask_key "DeepSeek" "DEEPSEEK_API_KEY"
if [ -n "$(get_env DEEPSEEK_API_KEY)" ]; then
set_env "DEEPSEEK_ENABLED" "true"
echo -e " ${GREEN}Provider DeepSeek active${NC}"
fi
;;
8)
echo -e "\n${BOLD}--- Minimax (m2.7 / MiniMax-M1) ---${NC}"
echo " Ou: https://platform.minimaxi.com/"
echo " Modele par defaut: MiniMax-M1"
ask_key "Minimax" "MINIMAX_API_KEY"
if [ -n "$(get_env MINIMAX_API_KEY)" ]; then
set_env "MINIMAX_ENABLED" "true"
echo -e " ${GREEN}Provider Minimax active${NC}"
fi
;;
9)
echo ""
echo -e "${RED}${BOLD}ATTENTION: Secrets visibles!${NC}"
echo -ne "${YELLOW}Taper 'oui' pour continuer:${NC} "

View File

@@ -157,12 +157,14 @@ echo ""
echo -e "${BOLD}--- Services de traduction ---${NC}"
echo ""
echo "Quel service de traduction par defaut ?"
echo " 1) ollama (local, gratuit)"
echo " 2) google (API payante)"
echo " 3) deepl (API payante, haute qualite)"
echo " 4) openai (GPT, payant)"
echo " 1) ollama (local, gratuit)"
echo " 2) google (API gratuite via deep_translator)"
echo " 3) deepl (haute qualite, 500k car/mois gratuit)"
echo " 4) openai (GPT, payant)"
echo " 5) openrouter (multi-modeles, payant)"
ask "Choix (1-5)" "1" TRANSLATION_CHOICE
echo " 6) deepseek (tres bon rapport qualite/prix)"
echo " 7) minimax (MiniMax-M1 / m2.7, payant)"
ask "Choix (1-7)" "1" TRANSLATION_CHOICE
case "$TRANSLATION_CHOICE" in
1) TRANSLATION_SERVICE="ollama" ;;
@@ -170,12 +172,16 @@ case "$TRANSLATION_CHOICE" in
3) TRANSLATION_SERVICE="deepl" ;;
4) TRANSLATION_SERVICE="openai" ;;
5) TRANSLATION_SERVICE="openrouter" ;;
6) TRANSLATION_SERVICE="deepseek" ;;
7) TRANSLATION_SERVICE="minimax" ;;
*) TRANSLATION_SERVICE="ollama" ;;
esac
DEEPL_API_KEY=""
OPENAI_API_KEY=""
OPENROUTER_API_KEY=""
DEEPSEEK_API_KEY=""
MINIMAX_API_KEY=""
if [ "$TRANSLATION_SERVICE" = "ollama" ]; then
ask "URL Ollama" "http://ollama:11434" OLLAMA_BASE_URL
@@ -194,6 +200,14 @@ if [ "$TRANSLATION_SERVICE" = "openrouter" ] || [ "$TRANSLATION_SERVICE" = "all"
ask "Cle API OpenRouter (laisser vide si pas maintenant)" "" OPENROUTER_API_KEY
fi
if [ "$TRANSLATION_SERVICE" = "deepseek" ] || [ "$TRANSLATION_SERVICE" = "all" ]; then
ask "Cle API DeepSeek (laisser vide si pas maintenant)" "" DEEPSEEK_API_KEY
fi
if [ "$TRANSLATION_SERVICE" = "minimax" ] || [ "$TRANSLATION_SERVICE" = "all" ]; then
ask "Cle API Minimax (laisser vide si pas maintenant)" "" MINIMAX_API_KEY
fi
# ===========================================
# ETAPE 6 : Monitoring
# ===========================================
@@ -291,6 +305,16 @@ OPENAI_API_KEY=${OPENAI_API_KEY}
OPENAI_MODEL=gpt-4o-mini
OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
# DeepSeek
DEEPSEEK_ENABLED=${DEEPSEEK_ENABLED:-false}
DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
DEEPSEEK_MODEL=deepseek-chat
# Minimax (m2.7 / MiniMax-M1)
MINIMAX_ENABLED=${MINIMAX_ENABLED:-false}
MINIMAX_API_KEY=${MINIMAX_API_KEY}
MINIMAX_MODEL=MiniMax-M1
# Upload
MAX_FILE_SIZE_MB=50
ALLOWED_EXTENSIONS=.docx,.xlsx,.pptx