Skip to main content

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

👨‍💻 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmstudio_tracker-1.0.5a0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

llmstudio_tracker-1.0.5a0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file llmstudio_tracker-1.0.5a0.tar.gz.

File metadata

  • Download URL: llmstudio_tracker-1.0.5a0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for llmstudio_tracker-1.0.5a0.tar.gz
Algorithm Hash digest
SHA256 26abc70d72a6d87ad598ed2fd99f02a4dc81d60cc651c92f83b28faafcc77916
MD5 3197d67e9e0cc8c2aeca1ae6be9be40e
BLAKE2b-256 ef090e02b063a78af262d79000c880bbaa64f8ac3340e00003e3a6884df7598d

See more details on using hashes here.

File details

Details for the file llmstudio_tracker-1.0.5a0-py3-none-any.whl.

File metadata

  • Download URL: llmstudio_tracker-1.0.5a0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for llmstudio_tracker-1.0.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ed3696fcca3e397c7b19ab388477101a001c738e003587d491de6146fcc3f0e
MD5 13cff457f664c7b8a83f9e4b68566040
BLAKE2b-256 284ae7efc87c08f9b488dc2bbb579522885d476edfc975d21568bba40a615dc7

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