Skip to main content

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.

Metadata

Release files for llm-blocks 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-blocks 0.3.3
File Size Uploaded
llm-blocks-0.3.3.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-blocks 0.3.3
File Interpreter ABI Platform
llm_blocks-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / llm-blocks-0.3.3.tar.gz

Download URL llm-blocks-0.3.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d1d4b110a26cdf3a7c4f504333ac410a0d5823d8efa6dc5940dd3cf74b6ae3f0
BLAKE2b-256 checksum
How to use checksums
90c92b1fd4fbb4868865da031f30be6979c54e31b5ef0cbafd68125fa73953c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.1

Release files / llm_blocks-0.3.3-py3-none-any.whl

Download URL llm_blocks-0.3.3-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a9eba1f5ecff37969f92311d222f5d86c45e0aa29b356e4577f36dd94b38a04
BLAKE2b-256 checksum
How to use checksums
a1d0a71865d77243d1171296e17a02a1e0a2a5a74d9d2a95d8a1ba4e52248401
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.1

Release history Release notifications | RSS feed

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page