Skip to main content

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.

Metadata

Release files for nicellm 0.0.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 nicellm 0.0.2
File Size Uploaded Provenance
nicellm-0.0.2.tar.gz 4.7 kB Without provenance Details

Release files / nicellm-0.0.2.tar.gz

Download URL nicellm-0.0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6466fd26609f0245d4487f47dab02805ff6451336540a4c3618c4e565e4a721a
BLAKE2b-256 checksum
How to use checksums
218ab09439344c370a5e43ec2b14d18edb5e61317c63e0a3375bbfc1138bc266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Security for nicellm 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

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