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

Uploaded Source

Built Distribution

llm_blocks-0.3.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm-blocks-0.3.3.tar.gz
  • Upload date:
  • Size: 3.7 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.3.tar.gz
Algorithm Hash digest
SHA256 d1d4b110a26cdf3a7c4f504333ac410a0d5823d8efa6dc5940dd3cf74b6ae3f0
MD5 b6faf0bd41a09db68318c59775d2f4e4
BLAKE2b-256 90c92b1fd4fbb4868865da031f30be6979c54e31b5ef0cbafd68125fa73953c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llm_blocks-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a9eba1f5ecff37969f92311d222f5d86c45e0aa29b356e4577f36dd94b38a04
MD5 5d8e1720f16cf7e82c29b919b4b10abf
BLAKE2b-256 a1d0a71865d77243d1171296e17a02a1e0a2a5a74d9d2a95d8a1ba4e52248401

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