LlamaIndex Tools Integration: WaveSpeed
WaveSpeedToolSpec gives a LlamaIndex agent access to the
WaveSpeed AI inference platform: text-to-image and
text-to-video generation, running any model in the catalog by id, and recovering
a long-running job from its prediction id.
It is built on the official wavespeed
Python SDK, so it inherits the SDK's submission semantics — a submission POST is
never retried, terminal statuses (failed / cancelled / timeout / deleted) are handled
explicitly, and every request carries channel attribution.
Installation
pip install llama-index-tools-wavespeed
export WAVESPEED_API_KEY="your-api-key" # https://wavespeed.ai
Tools
| Tool | What it does |
|---|---|
generate_image |
Text to image. Default model bytedance/seedream-v5.0-pro. Accepts resolution and aspect_ratio. |
generate_video |
Text to video. Default model wavespeed-ai/minimax-h3/text-to-video (cheap open-weights starting point; use bytedance/seedance-2.5/text-to-video for the highest quality). Accepts duration. |
run_model |
Runs any model id with an arbitrary input dict — image editing, upscaling, image-to-video, speech, and so on. See https://wavespeed.ai/models. |
get_prediction |
Fetches an earlier prediction by id. Video jobs routinely outlive a single tool call; when one times out the error carries a task_id the agent can pass here. |
Each tool returns the output URL(s), one per line, or a string starting with
Error: that carries the prediction id and the platform's own error text.
Usage
import asyncio
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.wavespeed import WaveSpeedToolSpec
tool_spec = WaveSpeedToolSpec() # reads WAVESPEED_API_KEY
# or: WaveSpeedToolSpec(api_key="...")
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
response = asyncio.run(
agent.run("Generate a 16:9 image of a red panda drinking boba tea.")
)
print(response)
ReActAgent works the same way:
from llama_index.core.agent.workflow import ReActAgent
agent = ReActAgent(tools=tool_spec.to_tool_list(), llm=OpenAI(model="gpt-4.1"))
You can also call the tools directly, without an agent:
tool_spec = WaveSpeedToolSpec()
print(tool_spec.generate_image("a lighthouse at dusk", aspect_ratio="16:9"))
print(tool_spec.run_model("wavespeed-ai/z-image/turbo", {"prompt": "a fox"}))
Configuration
WaveSpeedToolSpec(
api_key=None, # else WAVESPEED_API_KEY
image_model="bytedance/seedream-v5.0-pro",
video_model="wavespeed-ai/minimax-h3/text-to-video",
timeout=600.0, # None waits forever
poll_interval=2.0,
)
The default 600s timeout is deliberate: an unbounded wait would strand the
calling agent. When a video job exceeds it, the task keeps running server-side —
take the task_id out of the error and call get_prediction.
The underlying SDK client is created with max_retries=0 so a single tool call
can never turn into a second, separately billed submission.
Why size and seed are not exposed
The platform's input whitelist silently drops parameters the default models do
not declare. Advertising them in an LLM-facing schema would invite the agent to
set values that are then ignored, so generate_image and generate_video
expose only parameters that actually take effect. If a specific model you pick
does support them, pass them through run_model.
A note on discovery
llamahub.ai is generated from metadata in the
run-llama/llama_index monorepo, which
no longer accepts new integration packages.
This package is therefore not listed on LlamaHub. It is a normal PyPI
distribution that installs into the llama_index.tools namespace package and
works exactly like the official tool specs.
Development
uv sync --all-groups # or: pip install -e . pytest ruff
pytest tests
ruff check .
The test suite mocks the SDK client and never calls the live API.
License
MIT
WaveSpeed AI — AI image & video generation platform. Try it in the browser: Image generator · Video generator
Metadata
Release files for llama-index-tools-wavespeed 0.1.2
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_tools_wavespeed-0.1.2.tar.gz | 9.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_tools_wavespeed-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / llama_index_tools_wavespeed-0.1.2.tar.gz
| Download URL | llama_index_tools_wavespeed-0.1.2.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63d2ef8c6988c7729819f7112278fe0dc88908ebd89e817f5a741e95d7a023e6
|
|
BLAKE2b-256 checksum How to use checksums |
fe934d664dd473af9c2158a124bc9b810910ef18df501c471ddabbcc0fda3477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logRelease files / llama_index_tools_wavespeed-0.1.2-py3-none-any.whl
| Download URL | llama_index_tools_wavespeed-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9dc3a1264a688d8e0e26a3020ddbcc963485ba34c5eae02146e2146de07bd824
|
|
BLAKE2b-256 checksum How to use checksums |
090f0334e3d4df0a2a7d2e2bd60fa8535dbc69b356131cf7094855c32417d53b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency log