Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

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.

Metadata

Release files for paradigm-client 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paradigm-client 0.5.2
File Size Uploaded
paradigm_client-0.5.2.tar.gz 28.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for paradigm-client 0.5.2
File Interpreter ABI Platform
paradigm_client-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 43.2 kB

Release files / paradigm_client-0.5.2.tar.gz

Download URL paradigm_client-0.5.2.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e5b4b3cb019d3e27892e3ad7009fec914f49a569970a833e326f40b7ca8e39c3
BLAKE2b-256 checksum
How to use checksums
41389e13e52b35611183913b0478b30a31ada21fd86381555fdceba7673c11f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / paradigm_client-0.5.2-py3-none-any.whl

Download URL paradigm_client-0.5.2-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d711cf633dc16343d98f37c7a54b8eba69650c8f3c5c0a4f691ddbe10055b6e
BLAKE2b-256 checksum
How to use checksums
c82a9bc05fa8d6b6415ec6ed208c26fc3d1443d13ecade3bf6bab9d81f629edf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page