Skip to main content

Comet tool for logging and evaluating LLM traces

Project description

Comet Opik logo
Opik
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:

  • Development:

    • Tracing: Track all LLM calls and traces during development and production (Quickstart, Integrations
    • Annotations: Annotate your LLM calls by logging feedback scores using the Python SDK or the UI.
  • Evaluation: Automate the evaluation process of your LLM application:

  • Production Monitoring: Monitor your LLM application in production and easily close the feedback loop by adding error traces to your evaluation datasets.


🛠️ Installation

Opik is available as a fully open source local installation or using Comet.com as a hosted solution. 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 can do so by cloning the repository and starting the platform using Docker Compose:

# Clone the Opik repository
git clone https://github.com/comet-ml/opik.git

# Navigate to the opik/deployment/docker-compose directory
cd opik/deployment/docker-compose

# Start the Opik platform
docker compose up --detach

# You can now visit http://localhost:5173 on your browser!

Opik reports anonymous usage reports to the Opik team to help with the development of new features. No private information is collected, there reports are fully anonymous.

You can opt-out of usage reporting by setting the OPIK_USAGE_REPORT_ENABLED environment variable to false before running Opik locally:

# Start the Opik platform
export OPIK_USAGE_REPORT_ENABLED=false

docker compose up --detach

All usage reports can be found here: Usage Reports

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

Installation methods Docs link
Local instance Local Deployment
Kubernetes Kubernetes

🏁 Get Started

To get started, you will need to first install the Python SDK:

pip install opik

Once the SDK is installed, you can configure it by running the opik configure command:

opik configure

This will allow you to configure Opik locally by setting the correct local server address or if you're using the Cloud platform by setting the API Key

[!TIP]
You can also call the opik.configure(use_local=True) method from your Python code to configure the SDK to run on the local installation.

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
LiteLLM Call any LLM model using the OpenAI format Documentation Open Quickstart In Colab
LangChain Log traces for all LangChain LLM calls Documentation Open Quickstart In Colab
LangGraph Log traces for all LangGraph executions Documentation Open Quickstart In Colab
LlamaIndex Log traces for all LlamaIndex LLM calls Documentation Open Quickstart In Colab
Ollama Log traces for all Ollama LLM calls Documentation Open Quickstart In Colab
Predibase Fine-tune and serve open-source Large Language Models Documentation Open Quickstart In Colab
Ragas Evaluation framework for your Retrieval Augmented Generation (RAG) pipelines 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:

import opik

opik.configure(use_local=True) # Run locally

@opik.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.2.0.tar.gz (100.7 kB view details)

Uploaded Source

Built Distribution

opik-0.2.0-py3-none-any.whl (199.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for opik-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f8ebe0e57a77e1487a47afbe364350336a980ee623d63c74306acfb796997b73
MD5 c8640b785faa4d96fd7807d511318785
BLAKE2b-256 661665ef12c035e21e0249c982c85a49feafd0328b3fb2f704d667d518175a82

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for opik-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a943e9c54265592b5d2975c7adce2ff00496ff87fa4855993df10e797d9aeb19
MD5 2ff14065baa4dcfc8e2aa117bd75d12a
BLAKE2b-256 19711415e40a50ad938ee7bb5e336e015861b2aab2a743dc963a7d78fc027226

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