Skip to main content

Simple interface for creating and managing LLM chains

Project description

LLM Blocks

GitHub stars PyPI

LLM Blocks is a Python library that provides a simple interface for creating and managing Language Model (LLM) chains. It is designed to make it easy to interact with OpenAI's GPT-3 API.

📚 Table of Contents

🎯 Why Use LLM Blocks

LLM Blocks makes it easy to create and manage LLM chains. It provides a simple, intuitive interface for interacting with OpenAI's GPT-3 API. With LLM Blocks, you can focus on building your application without worrying about the intricacies of the API.

🏗️ Repo Structure

llm_blocks
├── .gitignore
├── llm_blocks
│   ├── __init__.py
│   └── blocks.py
├── requirements.txt
├── setup.py
└── turbo_docs.toml

📦 Installation

To install LLM Blocks, you can use pip:

pip install llm-blocks

🚀 Usage

LLM Blocks provides three main classes: Block, TemplateBlock, and ChatBlock. These classes are the recommended interfaces for calling OpenAI APIs.

Here is an example of how to use them:

from llm_blocks import Block, TemplateBlock, ChatBlock

template = "Hello, {name}! How are you?"

# Create a Block
block = Block()
response = block("Hello, world!")

# Create a TemplateBlock
template_block = TemplateBlock(template)
response = template_block("AI Friend")
# template_block(name="AI Friend") also valid

# Create a ChatBlock
chat_block = ChatBlock(template)
response = chat_block("AI Friend")
response = chat_block("What is the meaning of life?")

🤝 Contributing

Contributions are welcome! Please feel free to submit a pull request.

📧 Contact

If you have any questions or feedback, please feel free to contact the author at voynow99@gmail.com.

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.3.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

llm_blocks-0.3.3-py3-none-any.whl (5.0 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