utils
ImpactsOutput
Bases: BaseModel
Impacts output data model.
Attributes:
| Name | Type | Description |
|---|---|---|
energy |
Energy | None
|
Total energy consumption |
gwp |
GWP | None
|
Total Global Warming Potential (GWP) impact |
adpe |
ADPe | None
|
Total Abiotic Depletion Potential for Elements (ADPe) impact |
pe |
PE | None
|
Total Primary Energy (PE) impact |
wcf |
WCF | None
|
Usage-only Water Consumption Footprint (WCF) impact |
usage |
Usage | None
|
Impacts for the usage phase |
embodied |
Embodied | None
|
Impacts for the embodied phase |
warnings |
list[WarningMessage] | None
|
List of warnings |
errors |
list[ErrorMessage] | None
|
List of errors |
llm_impacts(provider, model_name, output_token_count, request_latency, electricity_mix_zone=None)
High-level function to compute the impacts of an LLM generation request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider |
str
|
Name of the provider. |
required |
model_name |
str
|
Name of the LLM used. |
required |
output_token_count |
int
|
Number of generated tokens. |
required |
request_latency |
float
|
Measured request latency in seconds. |
required |
electricity_mix_zone |
str | None
|
ISO 3166-1 alpha-3 code of the electricity mix zone (WOR by default). |
None
|
Returns:
| Type | Description |
|---|---|
ImpactsOutput
|
The impacts of an LLM generation request. |