Skip to main content

Comet tool for logging and evaluating LLM traces

Project description

Open-source end-to-end LLM Development Platform

Confidently evaluate, test and monitor LLM applications. 

WebsiteSlack communityTwitterDocumentation

Opik thumbnail

🚀 What is Opik?

Opik is an open-source platform for evaluating, testing and monitoring LLM applications. Built by Comet.


You can use Opik for:


🛠️ Installation

The easiest way to get started with Opik is by creating a free Comet account at comet.com.

If you'd like to self-host Opik, you create a simple local version of Opik using::

pip install opik-installer

opik-server install

For more information about the different deployment options, please see our deployment guides:

Installation methods Docs link
Local instance All-in-one isntallation
Kubernetes Kubernetes

🏁 Get Started

If you are logging traces to the Cloud Opik platform, you will need to get your API key from the user menu and set it as the OPIK_API_KEY environment variable:

export OPIK_API_KEY=<Your API key>
export OPIK_WORKSPACE=<You workspace, often the same as your username>

If you are using a local Opik instance, you don't need to set the OPIK_API_KEY or OPIK_WORKSPACE environment variable and isntead set the environment variable OPIK_BASE_URL to point to your local Opik instance:

export OPIK_BASE_URL=http://localhost:5173

You are now ready to start logging traces using the Python SDK.

📝 Logging Traces

The easiest way to get started is to use one of our integrations. Opik supports:

Integration Description Documentation Try in Colab
OpenAI Log traces for all OpenAI LLM calls Documentation Open Quickstart In Colab
LangChain Log traces for all LangChain LLM calls Documentation Open Quickstart In Colab
LlamaIndex Log traces for all LlamaIndex LLM calls Documentation Open Quickstart In Colab

[!TIP]
If the framework you are using is not listed above, feel free to open an issue or submit a PR with the integration.

If you are not using any of the frameworks above, you can also using the track function decorator to log traces:

from opik import track

@track
def my_llm_function(user_question: str) -> str:
    # Your LLM code here

    return "Hello"

[!TIP]
The track decorator can be used in conjunction with any of our integrations and can also be used to track nested function calls.

🧑‍⚖️ LLM as a Judge metrics

The Python Opik SDK includes a number of LLM as a judge metrics to help you evaluate your LLM application. Learn more about it in the metrics documentation.

To use them, simply import the relevant metric and use the score function:

from opik.evaluation.metrics import Hallucination

metric = Hallucination()
score = metric.score(
    input="What is the capital of France?",
    output="Paris",
    context=["France is a country in Europe."]
)
print(score)

Opik also includes a number of pre-built heuristic metrics as well as the ability to create your own. Learn more about it in the metrics documentation.

🔍 Evaluating your LLM Application

Opik allows you to evaluate your LLM application during development through Datasets and Experiments.

You can also run evaluations as part of your CI/CD pipeline using our PyTest integration.

🤝 Contributing

There are many ways to contribute to Opik:

To learn more about how to contribute to Opik, please see our contributing guidelines.

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

opik-0.1.6.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

opik-0.1.6-py3-none-any.whl (171.3 kB view details)

Uploaded Python 3

File details

Details for the file opik-0.1.6.tar.gz.

File metadata

  • Download URL: opik-0.1.6.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for opik-0.1.6.tar.gz
Algorithm Hash digest
SHA256 dcd171667319f56c80a64459befcd4b5ea99057140cacb0acd936baf49b8e4c9
MD5 62aebcc043af9bb0af8684f2a4948cc5
BLAKE2b-256 3b998e1fef7cf35c4c8cbb85b139bacd5b01879757c8988f94b7a46499489222

See more details on using hashes here.

File details

Details for the file opik-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: opik-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 171.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for opik-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 105349194b0574f2e40a5426ae18195db3b707951a2425c7667a153b98f6076b
MD5 700d830198566e1bdb32c7bf66b401e9
BLAKE2b-256 c325060dbf9012bea99c23c5eb578dd248cb6302f84bd3eb866c179d098c15f1

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