healthai-ai — Vue d'ensemble
[cite_start]Mono-repo des micro-services IA de la plateforme HealthAI[cite: 8, 101].
- Repo : HealthAI-Corpo/healthai-ai
Services & Dépendances Externes
| Service | Image | Port | Bases de données | Rôle |
|---|---|---|---|---|
| healthai-ai-api | ghcr.io/healthai-corpo/healthai-ai-api | 8000 | - | [cite_start]Gateway GraphQL — point d'entrée unique [cite: 69] |
| healthai-vision | ghcr.io/healthai-corpo/healthai-vision | 8001 | PostgreSQL + MongoDB | [cite_start]Analyse par photo (YOLOv8) + Moteur de conseil [cite: 83, 85, 123] |
| healthai-workout | ghcr.io/healthai-corpo/healthai-workout | 8002 | PostgreSQL + MongoDB | [cite_start]Recommandation sportive (Scikit-learn) [cite: 101, 123] |
| healthai-ollama | ollama/ollama:latest | 11434 | - | [cite_start]Service LLM partagé (Génération de conseils) [cite: 157, 158] |
Stack commune
- Python 3.12 via uv (Gestion des paquets et environnements virtuels)
- FastAPI + uvicorn
- Base de données : PostgreSQL via
SQLAlchemy(Async) + MongoDB viaMotor(Async) - Communication inter-services : HTTPX async
- Auth : Zitadel JWT géré par la gateway
Cartographie de l'Architecture Global
Architecture des Variables d'Environnement
Le projet utilise une configuration hybride facilitant le déploiement sur l'infrastructure globale :
.envracine : Centralise les variables communes et partagées (Ex:POSTGRES_USER,POSTGRES_PASSWORD, ports d'exposition)..envspécifiques aux services : Gèrent les configurations internes de l'application (Ex: clés API internes, configurations des modèles IA).
Lancement rapide
bash
# Copier les configurations d'environnement
cp healthai-vision/.env.example healthai-vision/.env
cp healthai-workout/.env.example healthai-workout/.env
cp healthai-api/.env.example healthai-api/.env
# Lancer l'environnement complet (Bases de données + Services IA)
docker compose up -d --build
::: info Centralisation des LLM (Ollama)
Pour optimiser l'usage des ressources de l'infrastructure (RAM/CPU/VRAM), les modèles de langage (LLM) sont externalisés dans un conteneur unique healthai-ollama. Il agit comme un service interne de génération de texte consommé de manière asynchrone par healthai-workout (plans sportifs) et healthai-vision (conseils d'ajustement nutritionnel).
::: ::: warning Premier build & Modèles IALe premier build de healthai-vision installe les dépendances lourdes (Torch, Ultralytics via uv). Le temps de build s'allonge si l'équipe configure un modèle YOLOv8 moyen (medium). Les modèles légers (yolov8n.pt) sont privilégiés par défaut pour accélérer le déploiement. Un volume nommé hf_cache préserve les poids des modèles lors des redémarrages.:::
## URLs une fois démarrés
| Service | URL |
|---------|-----|
| Gateway (docs) | http://localhost:8000/docs |
| Vision (docs) | http://localhost:8001/docs |
| Workout (docs) | http://localhost:8002/docs |
| Ollama (Statut API) | http://localhost:11434/ |
## Healthcheck global
```bash
curl http://localhost:8000/test-internalRéponse attendue :
json
{
"gateway": "OK",
"vision_service": { "status": "online" },
"workout_service": { "status": "online" },
"ollama_service": { "status": "online" }
}