Python building blocks to explore large language models on any computer with 512MB of RAM
Target Audience
This package is designed to be as simple as possible for learners and educators exploring how large language models intersect with modern software development. The interfaces to this package are all simple functions using standard types. The complexity of large language models is hidden from view while providing free local inference using light-weight, open models. All included models are free for educational use, no API keys are required, and all inference is performed locally by default.
Installation and Getting Started
This package can be installed using the following command:
pip install languagemodels
Once installed, you should be able to interact with the package in Python as follows:
This will require downloading a significant amount of data (~250MB) on the first run. Models will be cached for later use and subsequent calls should be quick.
Example Usage
Here are some usage examples as Python REPL sessions. This should work in the REPL, notebooks, or in traditional scripts and applications.
Text Completions
Instruction Following
Chat
Helper functions are provided to retrieve text from external sources that can be used to augment prompt context.
Semantic search is provided to retrieve documents that may provide helpful context from a document store.
This can also be used to get a blend of context from stored documents: