Skip to main content

Supercharge your LLM with a frictionless wrapper

Project description

hegel

Welcome to hegel, the python client library for Hegel AI. This library adds the full functionality of our Dialectic product to your LLM, including observability, computing metrics, and tracking customer feedback.

Monitoring your LLM

To use hegel, you'll wrap your current call to an LLM API with the HegelScribe object. HegelScribe helps record the input and response of a LLM call with minimal overhead. The call to the LLM's API is not routed through our server; only the input and response are captured and written to the database through a separate thread without blocking the main thread.

import openai
from hegel.scribe import HegelScribe

scribe = HegelScribe(completion_fn=openai.ChatCompletion.create)
response = scribe(
    model= "gpt-3.5-turbo",
    messages = [  
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Who won the world series in 2020?"},
    ])

Setting your API key

An OpenAI API key is needed if you would like to use OpenAI's API (we do not store or track your API key in anyway). A separate Hegel API key is needed to use our service. You can get a key by contacting us.

To set your API keys:

# Starting from this `hegel` directory
cp .env.example .env

Edit the .env file to include your keys. Avoid sharing that file.

Viewing Logs and Metrics

Scribe collects metrics, monitors failures, and helps gather customer feedback. You can view aggregate metrics, drill into logs, and more on the Hegel Dashboard.

Contributing

We welcome PRs and suggestions! Don't hesitate to open a PR/issue or to reach out to us via email.

Usage and Feedback

We will be delighted to work with early adopters to shape our designs. Please reach out to us via email if you're interested in using this tooling for your project or have any feedback.

License

We will be gradually releasing more components to the open-source community. The current license can be found in the LICENSE file. If there is any concern, please contact us and we will be happy to work with you.

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

hegel-0.0.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

hegel-0.0.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file hegel-0.0.3.tar.gz.

File metadata

  • Download URL: hegel-0.0.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for hegel-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9432d043f65dbfc8526ef87623493d31bddc56bf0bcee6096f05927eadeaf89c
MD5 711cbafed89eafd01ffc0ef86773412f
BLAKE2b-256 7622edf550ecb9f27ccbb37f464654a6afe6bceb1159025bf49c75a351679720

See more details on using hashes here.

File details

Details for the file hegel-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: hegel-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for hegel-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c12f0c7e8ce520d8e95486a3f24e682ea08e78d103298fc162c3c20304184433
MD5 7cec8eece4a1e55f5a5f44a8d30c0192
BLAKE2b-256 b1383c983d5129190eac68cee2c71eecefba0b795e42cceb593ba1a967d35af8

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