Simple interface for creating and managing LLM chains
Project description
LLM-Blocks :building_construction:
LLM-Blocks is a Python library that provides a simple interface for creating and managing Language Learning Model (LLM) chains. It is designed to make it easy to interact with OpenAI's GPT-3.5-turbo model, allowing you to create completions and generate responses in a chat-like format.
:book: Table of Contents
:question: Why Use LLM-Blocks
LLM-Blocks is designed to simplify the process of creating and managing LLM chains. It provides a high-level interface that abstracts away the complexities of interacting with the OpenAI API, allowing you to focus on creating engaging and interactive chat experiences. Whether you're building a chatbot, a virtual assistant, or any other application that requires conversational AI, LLM-Blocks can help you get there faster.
:deciduous_tree: Repo Structure
.
├── .gitignore
├── llm_blocks
│ ├── blocks.py
│ └── __init__.py
├── requirements.txt
├── setup.py
├── test.ipynb
└── turbo_docs.toml
:gear: Installation
LLM-Blocks can be installed via pip:
pip install llm-blocks
:rocket: Usage
Here's an example of how to use the StreamBlock
and BatchBlock
classes in LLM-Blocks:
from llm_blocks import blocks
template = "Hello, {name}!"
# Create a StreamBlock
block = blocks.StreamBlock(template=template)
response_generator = block(name="World")
block.display(response_generator)
# Create a BatchBlock
# Example of how to use the non-defualt model
block = blocks.BatchBlock(template=template, model_name="gpt-4")
response = block(name="World")
block.display(response)
:handshake: Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for llm_blocks-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2de80ca9552d699188e80175bf61e7b781160894d03923aaa7387e8f3ac85d59 |
|
MD5 | 8d22c96ec01944d2ff135550bacd8933 |
|
BLAKE2b-256 | fd786597771e417d09c4335a49a854ca929f28eec0f84c74bcbed826a7b855a6 |