This repository provides a Python script to track the current Large Language Model (LLM) utilization using the IONOS Billing API. The script retrieves the utilization data from the API, processes it, and outputs the results in a JSON format.
- IONOS access token (replace
YOUR_ACCESS_TOKEN
in the script) - IONOS contract ID (replace
YOUR_CONTRACT_ID
in the script) - Python 3.6+
requests
andjson
libraries (included in Python standard library)
- Clone the repository:
git clone https://github.com/carforge/IONOS_AI_Usage.git
- Replace
YOUR_ACCESS_TOKEN
andYOUR_CONTRACT_ID
in theIONOS_Billing_API.py
script with your actual credentials. - Run the script:
python IONOS_Billing_API.py
The script will output a JSON object containing the current LLM utilization data, including the model name, input, and output quantities.
Example output:
{
"_SOME-METER-ID_": {
"mdl_name": "Llama 3.1 405B",
"input": 111.0,
"output": 111.0
},
"_SOME-METER-ID_": {
"mdl_name": "Mixtral 8x7B Instruct",
"input": 111.0,
"output": 111.0
}
}
Feel free to contribute to this repository by submitting pull requests or reporting issues.
This repository is licensed under the MIT License.
- IONOS for providing the Billing API
- The developers of the
requests
andjson
libraries
This script is provided as-is and without warranty. Use at your own risk.