LLMCompiler Agent Pack
This LlamaPack implements the LLMCompiler agent paper.
A lot of code came from the source repo, we repurposed with LlamaIndex abstractions. All credits to the original authors for a great work!
A full notebook guide can be found here.
CLI Usage
You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:
llamaindex-cli download-llamapack LLMCompilerAgentPack --download-dir ./llm_compiler_agent_pack
You can then inspect the files at ./llm_compiler_agent_pack and use them as a template for your own project!
Code Usage
You can download the pack to a directory. NOTE: You must specify skip_load=True - the pack contains multiple files,
which makes it hard to load directly.
We will show you how to import the agent from these files!
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
download_llama_pack("LLMCompilerAgentPack", "./llm_compiler_agent_pack")
From here, you can use the pack. You can import the relevant modules from the download folder (in the example below we assume it's a relative import or the directory has been added to your system path).
# setup pack arguments
from llama_index.core.agent import AgentRunner
from llm_compiler_agent_pack.step import LLMCompilerAgentWorker
agent_worker = LLMCompilerAgentWorker.from_tools(
tools, llm=llm, verbose=True, callback_manager=callback_manager
)
agent = AgentRunner(agent_worker, callback_manager=callback_manager)
# start using the agent
response = agent.chat("What is (121 * 3) + 42?")
You can also use/initialize the pack directly.
from llm_compiler_agent_pack.base import LLMCompilerAgentPack
agent_pack = LLMCompilerAgentPack(tools, llm=llm)
The run() function is a light wrapper around agent.chat().
response = pack.run("Tell me about the population of Boston")
You can also directly get modules from the pack.
# use the agent
agent = pack.agent
response = agent.chat("task")
Metadata
Release files for llama-index-packs-agents-llm-compiler 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_index_packs_agents_llm_compiler-0.3.1.tar.gz | 19.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_packs_agents_llm_compiler-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.7 kB
Release files / llama_index_packs_agents_llm_compiler-0.3.1.tar.gz
| Download URL | llama_index_packs_agents_llm_compiler-0.3.1.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a41d918626342ab2f972b8dbdc28b340fc331acef6e29415f206525f8489245
|
|
BLAKE2b-256 checksum How to use checksums |
eb778a81924c9619e1d9cec6fb9ae6efdf2bbd5dfe54ae40a6ab89980411b086
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Release files / llama_index_packs_agents_llm_compiler-0.3.1-py3-none-any.whl
| Download URL | llama_index_packs_agents_llm_compiler-0.3.1-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da233b96eee081c56582bc2245023d269abb0d6c552ad2abd8069765abdbd873
|
|
BLAKE2b-256 checksum How to use checksums |
e5479cf2ab70dc2bf7abab494d445c2556e67fce2938cb7fae1d5c5896750a4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|