Skip to main content

NiceLLM is a wrangler of API connections of Large Language Models (LLMs) in Python.

Project description

NiceLLM: A Python LLM toolkit

About

NiceLLM is a Python package that homologates mainstream library functions of Large Language Models (LLMs), such as OpenAI and Google Generative AI, into a unique and simple interface for the user.

Main Features

  • Simplified handling of API connections
  • Simplified interface to use images in the prompt

Installation

The source code can be found at https://github.com/idealab-udec/nicellm.

pip install nicellm

Initial config

To initialize the functions of nicellm, you will need to set some environment variables, which will contain the API keys for OpenAI and Google Generative AI. We suggest to create a file called .env in your root folder with the following information:

APIKEY_GOOGLE="YOUR-API-KEY-FROM-GENERATIVE-AI"
APIKEY_OPENAI="YOUR-API-KEY-FROM-OPEN-AI"

It is not mandatory to set up both variables. However, you must set up at least the one corresponding to the models you want to use.

Then, executing . .env to make sure that those variables are config.

Usage

Interact with gpt-3.5-turbo:

import nicellm as llm

llm.get_response(
    model_id="gpt-3.5-turbo",
    prompt="Who is the best LLM in the world?"
)

The same question can be easily replicated using gemini-pro:

llm.get_response(
    model_id="gemini-pro",
    prompt="Who is the best LLM in the world?"
)

Contributions

This project is maintained by the Interdisciplinary Education & Artificial Intelligence Lab, IDEALAB, from the University of Concepción, Chile.

All contributions and ideas are welcome and well received. Please send us your PRs, and we will revise them as soon as possible.

License

This project is under an MIT-License.

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

nicellm-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file nicellm-0.0.1.tar.gz.

File metadata

  • Download URL: nicellm-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for nicellm-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5384f1ab73a3abd7530078076f947db6fbef3c02e12ae772224f2c0cb37ac12c
MD5 085ab8df7b33a616a9df5a8290e01552
BLAKE2b-256 a078bec80d2286367af2c8c4f231bf0eb55fcecf16afd771230cafaf677b5c54

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