LLMstudio Tracker is the module of LLMstudio that allows monitoring and logging your LLM calls. By leveraging LLMstudio Tracker, users can gain insights on model performance and streamline development workflows with actionable analytics.
Project description
LLMstudio Tracker
LLMstudio Tracker is the module of LLMstudio that allows monitoring and logging your LLM calls. It supports seamless integration with the LLMstudio environment through configurable tracking servers, allowing for detailed insights into synchronous and asynchronous chat interactions. By leveraging LLMstudio Tracker, users can gain insights on model performance and streamline development workflows with actionable analytics.
🌟 Features
- Monitoring and Logging: Keep track of your usage and performance for all requests.
- Logs Persistence with SQLAlquemy: You can configure the tracker to use a database of your choice (SQLlite, Postgres, Bigquery, etc...)
Installation
Install the latest version of LLMstudio using pip. We suggest that you create and activate a new virtual environment.
pip install 'llmstudio[tracker]'
How to run
To configure the tracker host, port, and database URI, create a .env file at the same path you'll run LLMstudio and set values for:
- LLMSTUDIO_TRACKING_HOST (default is 0.0.0.0)
- LLMSTUDIO_TRACKING_PORT (default is 50002)
- LLMSTUDIO_TRACKING_URI (the default is sqlite:///./llmstudio_mgmt.db)
If you skip this step, LLMstudio will just use the default values.
LLMSTUDIO_TRACKING_HOST=0.0.0.0
LLMSTUDIO_TRACKING_PORT=8002
LLMSTUDIO_TRACKIN_URI="your_db_uri"
Launching from a terminal
Now you should be able to run LLMstudio Tracker using the following command:
llmstudio server --tracker
Launching directly in your code
Alternatively, you can start the server in your code:
from llmstudio.server import start_servers
start_servers(proxy=False, tracker=True)
When the --tracker flag is set, you'll be able to access the Swagger at http://0.0.0.0:50002/docs (default port)
If you didn't provide the URI to your database, LLMstudio will create an SQLite database at the root of your project and write the logs there.
Usage
Now, you can initialize an LLM to make calls and link it to your tracking configuration so that the tracker will log the calls.
from llmstudio_tracker.tracker import TrackingConfig
tracker_config = TrackingConfig(host="0.0.0.0", port="50002") # needs to match what was set in your .env file
# You can set OPENAI_API_KEY in your .env file
openai = LLM("openai", tracking_config = tracker_config)
openai.chat("Hey!", model="gpt-4o")
Analysing the logs
from llmstudio_tracker.tracker import Tracker
tracker = Tracker(tracking_config=tracker_config)
logs = tracker.get_logs()
logs.json()
📖 Documentation
- Visit our docs to learn how it works
- Checkout our notebook examples to follow along with interactive tutorials, especially:
👨💻 Contributing
- Head on to our Contribution Guide to see how you can help LLMstudio.
- Join our Discord to talk with other LLMstudio enthusiasts.
Thank you for choosing LLMstudio. Your journey to perfecting AI interactions starts here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llmstudio_tracker-1.1.0a1.tar.gz.
File metadata
- Download URL: llmstudio_tracker-1.1.0a1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Linux/6.8.0-1020-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd7b0d96ae7edb656bf814c8d0deadf3fd62b0cd4158bc1fb65a961bb6b1c93c
|
|
| MD5 |
6cc8eef29cdd7aa12b140e0bec47655c
|
|
| BLAKE2b-256 |
eaddac6b5c9b8cefab5f105b788041ceaeb070cb8d37af5f460155d74b7418bb
|
File details
Details for the file llmstudio_tracker-1.1.0a1-py3-none-any.whl.
File metadata
- Download URL: llmstudio_tracker-1.1.0a1-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Linux/6.8.0-1020-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f967dc7857663d9a851e24ddea99cf09db4ab755a972c390f4a4c00f20c04c3e
|
|
| MD5 |
def4352770f6e9674c17599a8701eafd
|
|
| BLAKE2b-256 |
5b2d95fa19786ddc95efc2ba67e767d272965b4fd1121f05bc5207aa4ba1cc3a
|