Skip to content
Merged
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
5 changes: 2 additions & 3 deletions .claude/agents/genai-iterator.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Agent orchestrateur pour iterer sur les 110 notebooks GenAI (`MyIA.AI.Notebooks/

## Pratiques d'auth (verifie via genai-stack/commands/auth.py)

- ComfyUI : **Bearer token** (hash bcrypt cote serveur, `bcrypt_hash` dans la config) — env `COMFYUI_BEARER_TOKEN` (+ `COMFYUI_RAW_TOKEN`).
- ComfyUI : **Bearer token** (hash bcrypt côté serveur, `bcrypt_hash` dans la config). Env canonique `COMFYUI_API_TOKEN` (alias `COMFYUI_AUTH_TOKEN`, deux noms pour le même secret, gérés par `render_envs.py`). Le bearer vit dans `.secrets/qwen-api-user.token`. `COMFYUI_BEARER_TOKEN`/`COMFYUI_RAW_TOKEN` ne sont plus gérés (cf #14382).
- Forge : **Basic auth** — env `FORGE_USER` / `FORGE_PASSWORD`.
- vLLM (z-image) : pas d'auth.
- Verifier l'auth de chaque service : `python genai.py auth`.
- **FLAG inventaire (a normaliser)** : incoherence de nommage `COMFYUI_BEARER_TOKEN` vs `COMFYUI_AUTH_TOKEN` selon les notebooks — harmoniser, ne pas dupliquer.
- **FLAG inventaire (résolu par #16647)** : `COMFYUI_API_TOKEN` = `COMFYUI_AUTH_TOKEN` (alias canonique). `COMFYUI_BEARER_TOKEN` n'est plus géré — éviter le nom dans les nouveaux notebooks/docs.

## Quantization (recommandations verifiees via commands/quant.py)

Expand Down Expand Up @@ -83,7 +83,6 @@ Commandes :
1. URLs placeholder `yourdomain.com` : `Image/04-4-Cross-Stitch-Legacy` (cell ~256), `Texte/10_LocalLlama` (cell ~509) — remplacer par le vrai sous-domaine.
2. `02-5-Multi-Model-TTS-Gateway` : 401 (auth a corriger).
3. Leak `LOCAL_MODE` dans les outputs committes de `02-4-Z-Image-Lumina2` + `02-1-Qwen-Image-Edit-2509` — re-executer en mode remote propre.
4. Naming `COMFYUI_BEARER_TOKEN` vs `COMFYUI_AUTH_TOKEN` — harmoniser.

## Anti-patterns interdits

Expand Down
3 changes: 2 additions & 1 deletion .claude/commands/validate-genai.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ python scripts/genai-stack/docker_manager.py # Docker management
```

Configuration: `MyIA.AI.Notebooks/GenAI/.env` (template: `.env.example`)
Required: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COMFYUI_BEARER_TOKEN`, `HUGGINGFACE_TOKEN`
Required: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COMFYUI_API_TOKEN` (alias `COMFYUI_AUTH_TOKEN`), `HUGGINGFACE_TOKEN`
Note: `COMFYUI_BEARER_TOKEN` (ancien nom pré-#14382) n'est plus géré par `render_envs.py` — ne pas l'utiliser.
3 changes: 2 additions & 1 deletion .claude/rules/genai-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ paths: MyIA.AI.Notebooks/GenAI/**/*
## Règles HARD

- API keys dans `MyIA.AI.Notebooks/GenAI/.env` (template `.env.example`)
- Variables requises : `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COMFYUI_BEARER_TOKEN`, `HUGGINGFACE_TOKEN`
- Variables requises : `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COMFYUI_API_TOKEN` (alias `COMFYUI_AUTH_TOKEN`), `HUGGINGFACE_TOKEN`
- Note historique : `COMFYUI_BEARER_TOKEN` est l'ancien nom pré-#14382, **non géré** par `render_envs.py` (résout vide). Ne plus l'utiliser. Le bearer bcrypt côté serveur vit dans `.secrets/qwen-api-user.token`, voir [docs/genai/secrets-management.md](../../docs/genai/secrets-management.md).
- Lancer `/validate-genai` ou `python scripts/genai-stack/genai.py validate --full` AVANT exécution de notebooks GenAI
- Hook `block-secrets.py` bloque les `.env` — demander au user d'éditer manuellement
- Sécurisation des services exposés (audit + plan, #16) : [docs/genai/service-security-audit.md](../../docs/genai/service-security-audit.md)
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/genai-iterate/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ python genai.py auth # token present + correct (Bearer comfyui / Basic
python genai.py gpu # VRAM libre sur le GPU cible ?
python genai.py quant summary # bonne quant chargee ?
```
- comfyui-qwen : GPU0 ~20GB, Bearer (`COMFYUI_BEARER_TOKEN`). forge-turbo : GPU1 ~8GB, Basic (`FORGE_USER`/`FORGE_PASSWORD`). vllm-zimage : GPU1 ~15GB, no auth.
- comfyui-qwen : GPU0 ~20GB, Bearer (`COMFYUI_API_TOKEN` ou alias `COMFYUI_AUTH_TOKEN`). forge-turbo : GPU1 ~8GB, Basic (`FORGE_USER`/`FORGE_PASSWORD`). vllm-zimage : GPU1 ~15GB, no auth.

### Phase 2 — Quantization (arbitrage VRAM)
- GPU 8GB => `genai.py quant apply qwen` (Nunchaku INT4 ~4GB) obligatoire.
Expand All @@ -49,7 +49,7 @@ python genai.py quant summary # bonne quant chargee ?
- `yourdomain.com` dans `Image/04-4-Cross-Stitch-Legacy`, `Texte/10_LocalLlama`.
- `02-5-Multi-Model-TTS-Gateway` 401.
- `LOCAL_MODE` leak dans outputs de `02-4-Z-Image-Lumina2`, `02-1-Qwen-Image-Edit-2509`.
- Naming `COMFYUI_BEARER_TOKEN` vs `COMFYUI_AUTH_TOKEN` a harmoniser.
- Naming `COMFYUI_API_TOKEN` = `COMFYUI_AUTH_TOKEN` (alias canonique, deux noms pour le même secret — géré par `render_envs.py`). `COMFYUI_BEARER_TOKEN` n'est plus géré.

## Anti-patterns interdits
- Literal de secret inline / `os.getenv` avec fallback secret / imprimer un token.
Expand Down
6 changes: 4 additions & 2 deletions scripts/genai-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ Fichier : `MyIA.AI.Notebooks/GenAI/.env`

| Variable | Description |
|----------|-------------|
| `COMFYUI_BEARER_TOKEN` | Hash bcrypt pour auth ComfyUI |
| `COMFYUI_RAW_TOKEN` | Token brut (pour login UI) |
| `COMFYUI_API_TOKEN` (alias `COMFYUI_AUTH_TOKEN`) | Token canonique pour auth ComfyUI (alias gérés par `render_envs.py`) |
| `COMFYUI_PASSWORD` | Mot de passe login UI (formulaire ComfyUI-Login) |
| `HF_TOKEN` | Token HuggingFace (telechargement modeles) |
| `FORGE_USER` / `FORGE_PASSWORD` | Auth Forge-Turbo |

Note : `COMFYUI_BEARER_TOKEN` et `COMFYUI_RAW_TOKEN` étaient utilisés pré-#14382 et ne sont plus gérés — `render_envs.py` ne les propage pas. Le bearer bcrypt côté serveur vit dans `.secrets/qwen-api-user.token`.
| `LOCAL_MODE` | `true` pour Docker local, `false` pour myia.io |

---
Expand Down
Loading