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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file llm-blocks-0.3.0.tar.gz.

File metadata

  • Download URL: llm-blocks-0.3.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for llm-blocks-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4102a6440850d5c294c183bcdd3fb93e987f208b0586caecc2b1a5a95ea2ffbf
MD5 bc655574c0b3ea754d6946cd014a7938
BLAKE2b-256 752c198423859c616ec37923c9e7e0888abcaa18ad251eaa05c8778a7eec7cc2

See more details on using hashes here.

File details

Details for the file llm_blocks-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: llm_blocks-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for llm_blocks-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2de80ca9552d699188e80175bf61e7b781160894d03923aaa7387e8f3ac85d59
MD5 8d22c96ec01944d2ff135550bacd8933
BLAKE2b-256 fd786597771e417d09c4335a49a854ca929f28eec0f84c74bcbed826a7b855a6

See more details on using hashes here.

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