Skip to main content

No project description provided

Project description

CallToChange 🌍

Description

CallToChange is a carbon emissions calculator for AI apps. This tool analyzes and calculates the carbon emissions generated by a company's LLM (Large Language Model) calls.

This project won first place in the environmental track at LA Hacks (hundreds of participants)


This repo is for call-to-change, a Python library that logs LLM calls with a single line of code.


How to use the Python library

Use the command pip install call-to-change to download our library. Ensure the downloaded version is >= 0.8.6.

Here is a sample script utilizing call-to-change:

from openai import OpenAI
from call_to_change import log

client = OpenAI()

log(client, 'test@test.com')

response = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Who won the world series in 2020?"},
  ]
)

print(response.choices[0].message.content)

How to use the log function

The log function takes in two parameters, an OpenAI client and an email address.

It modifies the client to log any text generation or image generation calls you made. These calls will be tied to the email address you input into the log function.


How to access logs

If you have an account with our web app, your logged calls can be seen through your dashboard. From there, you can view the carbon emissions tied to your OpenAI calls and the offset cost.

If not, your text generation and image generation calls will still be saved. To access your data, create an account with us here and go to the Dashboard page.


How it works

Our Python library logs LLM calls in MongoDB.

Under the hood, it does this by sending a POST request to API routes in our web app. These API routes securely handle data updates in MongoDB.

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

call_to_change-0.8.7.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

call_to_change-0.8.7-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file call_to_change-0.8.7.tar.gz.

File metadata

  • Download URL: call_to_change-0.8.7.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for call_to_change-0.8.7.tar.gz
Algorithm Hash digest
SHA256 2f13d32477066ca63137530847b8e6482f6acd6b10746393378175aed0de8783
MD5 7d7c66bba9add3ec061ee275c01796a9
BLAKE2b-256 e375debed580635cfbcd27b5a172ac01a0cc6526ce49ee1a7781c09d5646381d

See more details on using hashes here.

File details

Details for the file call_to_change-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: call_to_change-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for call_to_change-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 41538e04f239b1e445165a976fb236bf1470f44d8ef7dbc63e249a6b294114d2
MD5 80b2cf28e801e0210f2a5b69078058a0
BLAKE2b-256 4f78b7ab2b9d46a7cc3262152f0031a1ccca65d2700cfb3a3a499cd75495ee53

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