Giter VIP home page Giter VIP logo

paradigm-client's Introduction

paradigm-client

Python client for LightOn Paradigm Large language Model.

Installation

You can install this package from PyPi with:

pip install paradigm-client

Or from source:

pip install -U git+https://github.com/lightonai/paradigm-client.git

Once the package is installed, make sure to define environment variables PARADIGM_API_KEY to your API key, e.g. by adding the following line to your .bashrc

export PARADIGM_API_KEY="<your api key>"

Quick Start

Using paradigm-client is pretty simple, here are a code example to show you how you can use it.

from paradigm_client.remote_model import RemoteModel

model = RemoteModel(model_name="llm-mini")

print(model.create("Hello, I am").completions[0].output_text)

Logging a feedback into Paradigm

After using the Create endpoint of Paradigm, you can log a feedback about it.

Feedback data is expected to be in a dictionary format with a key being one of "flag", "value", "tag" and "comment".

  • flag: used for boolean feedbacks
  • value: used for float feedbacks
  • tag: used for short text feedbacks
  • comment: used for free text feedbacks

Here are the different steps to log a feedback:

  1. If the feedback type you want to use does not exist on Paradigm yet, go to the admin interface of Paradigm and create it.
  2. Get the rating_id of the feedback type you want to use.
  3. Instantiate a RemoteModel object.
  4. Get the completion_id from the response of a RemoteModel.create() call.
  5. Call the log_feedback() method of your RemoteModel object with the rating_id, the completion_id related to your feedback and your feedback data.

Important note: The API Key used to generate the completion_id and to send the feedback must authorize the logging of its requests from the admin interface of Paradigm.

Access to LightOn Paradigm

Learn more about Paradigm: https://www.lighton.ai/fr/paradigm. For a list of use cases: https://www.lighton.ai/fr/blog/ai-use-case-5.

Known Issues

If you find that a RemoteModel instantiation and subsequent completions are unusually slow, it may be that your network does not support IPv6. Try disabling IPv6 and see if that helps.

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.