Skip to main content

UpTrain - ML Observability and Retraining Framework

Project description

uptrain

An open-source framework to evaluate and monitor LLM applications

Docs - Slack Community - Bug Report - Feature Request

PRs Welcome Docs Community Website

UpTrain is a Python framework that ensures your LLM applications are performing reliably by allowing users to check aspects such as correctness, structural integrity, bias, hallucination, etc. UpTrain can be used to:

Experimentation

UpTrain framework can be used to experiment across multiple prompts, model providers, chain configurations, etc. and get quantitative scores to compare them. Check out the experimentation tutorial to learn more.

uptrain experimentation

Validation

You can use the UpTrain Validation Manager to define checks, retry logic and validate your LLM responses before showing it to your users. Check out the tutorial here.

uptrain validation

Monitoring

You can use the UpTrain framework to continuously monitor your model's performance and get real-time insights on how well it is doing on a variety of evaluation metrics. Check out the monitoring tutorial to learn more.

Get started 🙌

To run it on your machine, checkout the Quickstart tutorial:

Install the package through pip:

pip install uptrain

Note: Uptrain uses commonly used python libraries like openai-evals and sentence-transformers. To make sure, all the functionalities work, use the uptrain-add command to install the full version of the package.

uptrain-add --feature full

How to use UpTrain in 4 simple steps:

Say we want to plot a line chart showing whether our model's responses contain any grammatical mistakes or not.

# Step 1: Choose and create the appropriate operator from UpTrain
grammar_score = GrammarScore(
  col_in_text = "model_response",       # input column name (from dataset)
  col_out = "grammar_score"             # desired output column name
)

# Step 2: Create a check with the operators and the required plots as arguments 
grammar_check = Check(
  operators = [grammar_score],
  plots = LineChart(y = "grammar_score")
)

# Step 3: Create a CheckSet with the checks and data source as arguments
checkset = CheckSet(
    checks = [grammar_check]
    source = JsonReader(fpath = '...')
)

# Step 4: Set up and run the CheckSet
checkset.setup(Settings(openai_api_key = '...'))
checkset.run(dataset)

Key Features 💡

Integrations

Eval Frameworks LLM Providers LLM Packages Serving frameworks
OpenAI Evals ✅ GPT-3.5-turbo ✅ Langchain 🔜 HuggingFace 🔜
EleutherAI LM Eval 🔜 GPT-4 ✅ Llama Index 🔜 Replicate 🔜
BIG-Bench 🔜 Claude 🔜 AutoGPT 🔜
Cohere 🔜

Why UpTrain 🤔?

Large language models are trained over billions of data points and perform really well over a wide variety of tasks. But one thing these models are not good at is being deterministic. Even with the most well-crafted prompts, the model can misbehave for certain inputs, be it hallucinations, wrong output structure, toxic or biased response, irrelevant response, and error modes can be immense.

To ensure your LLM applications work reliably and correctly, UpTrain makes it easy for developers to evaluate the responses of their applications on multiple criteria. UpTrain's evaluation framework can be used to:

  1. Validate (and correct) the response of the model before showing it to the user
  2. Get quantitative measures to experiment across multiple prompts, model providers, etc.
  3. Do unit testing to ensure no buggy prompt or code gets pushed into your production
  4. Monitor your LLM applications in real time and understand when they are going wrong in order to fix them before users complain.

We are constantly working to make UpTrain better. Want a new feature or need any integrations? Feel free to create an issue or contribute directly to the repository.

License 💻

This repo is published under Apache 2.0 license. We are also working towards adding a hosted offering to make setting off eval runs easier - please fill this form to get a waitlist slot.

Stay Updated ☎️

We are continuously adding tons of features and use cases. Please support us by giving the project a star ⭐!

Provide feedback (Harsher the better 😉)

We are building UpTrain in public. Help us improve by giving your feedback here.

Contributors 🖥️

We welcome contributions to UpTrain. Please see our contribution guide for details.

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

uptrain-0.3.6.tar.gz (141.2 kB view details)

Uploaded Source

Built Distribution

uptrain-0.3.6-py3-none-any.whl (199.7 kB view details)

Uploaded Python 3

File details

Details for the file uptrain-0.3.6.tar.gz.

File metadata

  • Download URL: uptrain-0.3.6.tar.gz
  • Upload date:
  • Size: 141.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for uptrain-0.3.6.tar.gz
Algorithm Hash digest
SHA256 074dd95208a6d3d79d3ed2926b2efdcb5d0401aec8442d325d7c7385f5ef22aa
MD5 e43e5cc5e62d7dcc0d27e29ca423f43a
BLAKE2b-256 e4822f008e5c37abf1b2c1a0d970b5e45d947c96eea2cba1fed0bbf50043e8b9

See more details on using hashes here.

File details

Details for the file uptrain-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: uptrain-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 199.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for uptrain-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 282dbc464b50fb37ca410619227f17073f287d15ab44ebe10a30c83e3be2df17
MD5 cb91a26c63cfd61e2f33a5db0b7db646
BLAKE2b-256 de0cb91f562664392f2e1905beb2fae6761a88989ec4ab7a46cbda32b77a1068

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page