🎯 Measure AI model carbon footprint with Ecologits.ai methodology

121 views · 🎯 AI Summarization & Classification

Description

This template provides a straightforward technique to measure and raise awareness about the environmental impact of your AI automations.

By adding a simple calculation step to your workflow, you can estimate the carbon footprint (in grams of CO₂ equivalent) generated by each call to a Large Language Model.

Based on the open methodology from Ecologits.ai, this workflow empowers you to build more responsible AI applications. You can use the calculated footprint to inform your users, track your organization’s impact, or simply be more mindful of the resources your workflows consume.

Who is this for?

What problem does this solve?

How it works

This template demonstrates a simple calculation snippet that you can adapt and add to your own workflows.

  1. Set conversion factor: A dedicated Conversion factor node at the beginning of the workflow holds the gCO₂e per token value. This makes it easy to configure.
  2. AI generates output: An AI node (in this example, a Basic LLM Chain) runs and produces a text output.
  3. Estimate token count: The Calculate gCO₂e node takes the character length of the AI’s text output and divides it by 4. This provides a reasonable estimate of the number of tokens generated.
  4. Calculate carbon footprint: The estimated token count is then multiplied by the conversion factor defined in the first node. The result is the carbon footprint for that single AI call.

Setup

  1. Set your conversion factor (Critical Step):
    • The default factor (0.0612) is for GPT-4o hosted in the US.
    • Visit ecologits.ai/latest to find the specific conversion factor for your AI model and server region.
    • In the Conversion factor node, replace the default value with the correct factor.
  2. Integrate the snippet into your workflow:
    • Copy the Conversion factor and Calculate gCO₂e nodes from this template.
    • Place the Conversion factor node near the start of your workflow (before your AI node).
    • Place the Calculate gCO₂e node after your AI node.
  3. Link your AI output:
    • Click on the Calculate gCO₂e node.
    • In the AI output field, replace the expression with the output from your AI node (e.g., {{ $('My OpenAI Node').item.json.choices[0].message.content }}). The carbon calculation will now work with your data.
  4. Activate your workflow. The carbon footprint will now be calculated with each execution.

Taking it further

🔗 Nodes Used

Basic LLM Chain, OpenAI Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup