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 hashes)

Uploaded Source

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