Skip to main content

Simple interface for creating and managing LLM chains

Project description

LLM-Blocks :building_construction:

GitHub stars PyPI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm-blocks-0.3.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

llm_blocks-0.3.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

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