Skip to main content

Aura — Carbon tracking and AI bias analysis toolkit

Project description

auraagent

Carbon tracking and monitoring toolkit for AI engineers.

Track CO2 emissions from your Python scripts and AI training jobs, and visualize them on your AURA dashboard — with a single line of code.


Installation

# Package de base (tracking uniquement)
pip install auraagent

Requires Python 3.9+


Premiers pas

1. Lancer l'interface de configuration

aura init

Ouvre automatiquement http://localhost:8765 dans votre navigateur.

Connectez-vous avec votre email et votre clé API générée depuis votre dashboard AURA → Profil → Clés API.

2. Tracker des émissions dans votre code

Context manager :

from aura.carbon import AuraCarbon
import time

with AuraCarbon(project_name="mon-projet") as tracker:
    # Votre code ici
    time.sleep(5)

# Les émissions sont automatiquement envoyées au dashboard

Décorateur :

from aura.carbon import track_emissions

@track_emissions(project_name="fine-tuning-bert")
def train_model():
    # Votre entraînement
    pass

train_model()

Gestion manuelle :

from aura.carbon import AuraCarbon

tracker = AuraCarbon(project_name="inference")
tracker.start()

# ... votre code ...

emissions = tracker.stop()
print(f"Émissions : {emissions:.6f} kg CO₂")

CLI

# Lancer l'interface web
aura-web

# Voir le statut de la configuration locale
aura status

# Se déconnecter (supprime ~/.aura.config)
aura logout

Configuration avancée

La configuration est stockée dans ~/.aura.config après la première connexion :

[aura]
api_endpoint    = https://cevia.ai/api
api_key         = votre_cle_api
user_id         = 42
machine_id      = uuid-de-votre-machine
organization    = CEVIA
default_project = mon-projet

Tester en local / réseau privé

Pour pointer vers un serveur Django local au lieu de cevia.ai :

# Serveur local
export AURA_SERVER_URL=http://127.0.0.1:8000
aura-web

# Réseau local (autre machine)
export AURA_SERVER_URL=http://192.168.1.42:8000
aura-web

Ou de façon permanente dans votre ~/.zshrc / ~/.bashrc :

export AURA_SERVER_URL=http://127.0.0.1:8000

Architecture

auraagent/
├── aura/
│   ├── carbon/
│   │   ├── tracker.py      # AuraCarbon — wrapper CodeCarbon
│   │   ├── output.py       # AuraOutput — envoi HTTP vers le serveur
│   │   └── decorators.py   # @track_emissions
│   ├── web/
│   │   ├── main.py         # Lance FastAPI + ouvre le navigateur
│   │   ├── app.py          # Application FastAPI
│   │   ├── routers/        # auth, tracker, config
│   │   ├── services/       # Logique métier (singleton tracker)
│   │   └── templates/      # Pages HTML (login, dashboard, settings)
│   └── core/
│       ├── constants.py    # AURA_SERVER_URL (surchargeable via env)
│       ├── config.py       # Lecture/écriture ~/.aura.config
│       ├── auth.py         # Vérification email + clé API
│       ├── models.py       # Modèles Pydantic
│       └── exceptions.py   # AuraError, AuraAuthError, etc.
├── installer/
│   ├── install.py          # Script d'installation (crée icône bureau)
│   └── build.py            # Compilation PyInstaller
└── tests/

Flux de données

Votre code Python
      │
      ▼
AuraCarbon (wrapper CodeCarbon)
      │  mesure CPU/GPU/RAM
      ▼
AuraOutput (BaseOutput)
      │  POST /api/emissions/
      │  Authorization: Token <api_key>
      ▼
Serveur Django AURA
      │
      ▼
Dashboard cevia.ai

Flux d'authentification (première connexion)

aura-web (localhost:8765)
      │  email + api_key
      ▼
POST /api/auth/verify/       → retourne api_endpoint, user_id, organization
      │
      ▼
POST /api/machines/register/ → retourne machine_id
      │
      ▼
~/.aura.config               ← écrit la configuration locale

Dépendances

Dépendance Rôle
codecarbon Mesure de la consommation électrique
requests Envoi HTTP des émissions
pydantic Validation des modèles de données
click Interface CLI
rich Affichage terminal
fastapi (web) Interface web locale
uvicorn (web) Serveur ASGI
jinja2 (web) Templates HTML

Licence

MIT — CEVIA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auraagent-0.2.1.1.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auraagent-0.2.1.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file auraagent-0.2.1.1.tar.gz.

File metadata

  • Download URL: auraagent-0.2.1.1.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for auraagent-0.2.1.1.tar.gz
Algorithm Hash digest
SHA256 acf790b3d13dbaf3254e791f6e1c59c5c1d023dcdcc609e5e2c7e5455e8d2cdd
MD5 6f909a388d162a03c3015a02a6c8fa62
BLAKE2b-256 a91be5d9500686badd9b46276270cb3757d28eb045e8545539171b8d6531d287

See more details on using hashes here.

File details

Details for the file auraagent-0.2.1.1-py3-none-any.whl.

File metadata

  • Download URL: auraagent-0.2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for auraagent-0.2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d31d58a0c26af1d0016d16a56e4aa674455bd3c8e99f0393e2e6f7964c21c30
MD5 1ff1a5cc5db2ac52e19a9cb5419512b2
BLAKE2b-256 61971dcfddfcbbd4f02d2f7842fefaeb61ac2260d4ab97d4ca57e9e9c2b09874

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page