Skip to main content

Portability lib for OpenAI, Hugging Face, and FastChat local model APIs

Project description

Portability lib for OpenAI, Hugging Face, and FastChat local model APIs

PyPI Changelog Tests License

This library was written for examples in a book I wrote

You can read my book free online or can be purchased:

Safe For Humans AI - A "humans-first" approach to designing and building AI systems

Supported APIs

  • get_completion(prompt, max_tokens=64)
  • create_local_embeddings_files_in_dir(path_to_document_files_dir)
  • query_local_embeddings(query)

These APIs are implemented separately in two Python classes:

  • OpenAiWrapper
  • HuggingFaceAiWrapper

Supported APIs and Models

Currently this compatibiolity library only works with selected OpenAI APIs and the small Hugging Face model facebook/opt-iml-1.3b that can be run locally on a laptop with no GPU and only 8G of RAM.

Run the example programs:

python test_completion_openai.py
python test_local_index_openai.py
python test_completion_hf.py
python test_local_index_hf.py

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

llmlib-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file llmlib-0.2.0.tar.gz.

File metadata

  • Download URL: llmlib-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for llmlib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bc37367129c48bdd74f29e7f65718602d5aaf045e68fc4273ab5513ff7ff1af6
MD5 c55aaa03ac42e84707e83aed957f9bc3
BLAKE2b-256 5c5ce2d33371d62c9d884d7b9c4249baf2b07c3522774df8d9fd9ab5db7846de

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