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, MistralAI, 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"
APIKEY_MISTRAL="YOUR-API-KEY-FROM-MISTRAL"

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

To obtain your API keys, please visit:

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?"
)

By using mistral-tiny:

llm.get_response(
    model_id="mistral-tiny",
    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.2.tar.gz (4.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: nicellm-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 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.2.tar.gz
Algorithm Hash digest
SHA256 6466fd26609f0245d4487f47dab02805ff6451336540a4c3618c4e565e4a721a
MD5 dc0f6b1ca5ffe90d1a2ac6bf17d9e2c2
BLAKE2b-256 218ab09439344c370a5e43ec2b14d18edb5e61317c63e0a3375bbfc1138bc266

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