Coder Social home page Coder Social logo

nr-openai-observability's Introduction

Community Project header

OpenAI Observability

A lightweight tool to monitor your OpenAI workload.

Installation

With pip

pip install nr-openai-observability

Getting Started

STEP 1: Set Your Environment Variables

  • Get your License key (also referenced as ingest - license) and set it as environment variable: NEW_RELIC_LICENSE_KEY. Click here for more details and instructions.

Bash

export NEW_RELIC_LICENSE_KEY=<license key>

Python

import os
os.environ["NEW_RELIC_LICENSE_KEY"] = "<license key>"

NEW_RELIC_LICENSE_KEY can also be sent as a parameter at the monitor.initialization() call.

  • Are you reporting data to the New Relic EU region? click here for more instructions.

STEP 2: Add the following two lines to your code

from nr_openai_observability import monitor
monitor.initialization()

Code example:

import os

import openai
from nr_openai_observability import monitor

monitor.initialization()

openai.api_key = os.getenv("OPENAI_API_KEY")
openai.Completion.create(
    model="text-davinci-003",
    prompt="What is Observability?",
    max_tokens=20,
    temperature=0 
)

STEP 3: Follow the instruction here to add the dashboard to your New Relic account.

EU Account Users:

If you are using an EU region account, you should also set your EVENT_CLIENT_HOST:

Bash

export EVENT_CLIENT_HOST="insights-collector.eu01.nr-data.net"

Python

import os
os.environ["EVENT_CLIENT_HOST"] = "insights-collector.eu01.nr-data.net"

EVENT_CLIENT_HOST can also be sent as a parameter at the monitor.initialization() call.

Support

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

Contribute

We encourage your contributions to improve nr-openai-observability! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

If you would like to contribute to this project, review these guidelines.

To all contributors, we thank you! Without your contribution, this project would not be what it is today.

License

nr-openai-observability is licensed under the Apache 2.0 License. The nr-openai-observability also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.

nr-openai-observability's People

Contributors

smatzkel-newrelic avatar ykriger-newrelic avatar tomasrasymas avatar cliftondobrich avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.