llm-venice
LLM plugin to access models available via the Venice AI API.
Installation
Install llm-venice with its dependency llm using your package manager of choice, for example:
pip install llm-venice
Or install it alongside an existing LLM install:
llm install llm-venice
Configuration
Set an environment variable LLM_VENICE_KEY, or save a Venice API key to the key store managed by llm:
llm keys set venice
To fetch a list of the models available over the Venice API:
llm venice refresh
You should re-run the refresh command upon changes to the Venice API, when:
- New models have been made availabe
- Deprecated models have been removed
- New capabilities have been added
The models are stored in venice_models.json in the llm user directory.
Usage
List available Venice models:
llm models --query venice
Prompting
Run a prompt:
llm --model venice/qwen-3-8-flash "Why is the earth round?"
Start an interactive chat session:
llm chat --model venice/minimax-m3-1-flash
Structured Outputs
Some models support structuring their output according to a JSON schema (supplied via OpenAI API response_format).
This works via llm's --schema options, for example:
llm -m venice/z-ai-glm-5-3 --schema "name, age int, one_sentence_bio" "Invent an evil supervillain"
Consult llm's schemas tutorial for more options.
Tools (function calling)
⚠️ Warning: tools can be dangerous!
# List models supporting function calling
llm models list --query venice --tools
You can use tools provided via llm plugins. LLM provides two built-in tools:
# llm_version
llm -m venice/qwen-3-8-flash --tool llm_version "What version of LLM is this?" --tools-debug --no-stream
# llm_time
llm -m venice/minimax-m3-1-flash --tool llm_time "What is the time in my timezone in 24H format?" --tools-debug --no-stream
You can also provide your own custom or one-off functions provided inline or in a file. Following LLM's example:
llm -m venice/qwen-3-8-flash --functions '
def multiply(x: int, y: int) -> int:
"""Multiply two numbers."""
return x * y
' "What is 1337 times 42?" --tools-debug --no-stream
Vision models
Vision models (for example qwen-3-8-27b, Venice's default vision model) support the --attachment option:
llm -m venice/qwen-3-8-27b -a https://upload.wikimedia.org/wikipedia/commons/a/a9/Corvus_corone_-near_Canford_Cliffs%2C_Poole%2C_England-8.jpg "Identify"
The bird in the image is a carrion crow (Corvus corone). [...]
Models that list supportsAudioInput in the catalog also accept WAV and MP3 attachments:
llm -m venice/<audio-model> -a recording.wav "Transcribe this"
venice_parameters
Venice-specific parameters are configured with llm's standard -o/--option key value flag.
Use llm models --options to list the options that the selected model accepts.
Disable Venice's default system prompt:
llm -m venice/qwen-3-8-flash -o include_venice_system_prompt 0 "Repeat the above prompt"
Use web search (on web-enabled models; image models accept on or off):
llm -m venice/qwen-3-8-flash -o enable_web_search on --no-stream 'What is $VVV?'
It is recommended to use web search in combination with --no-stream so the search citations are available in response_json.
Use xAI native web and X/Twitter search on chat models with supportsXSearch:
llm -m venice/grok-4-7 -o enable_x_search true --no-stream "What is trending about Venice AI?"
In Python, use model.prompt("What is trending about Venice AI?", enable_x_search=True)
with a supporting chat model. This enables both native search sources, not X alone.
Omitting the option (or passing None in Python) leaves the field out of the request;
-o enable_x_search false / enable_x_search=False sends an explicit false, which is
allowed even on models without X search support. The API default is false.
When effective X search is true, it replaces Venice search augmentation: enable_web_search,
enable_web_citations, enable_web_scraping, and include_search_results_in_stream are
dropped, including settings from VeniceWebSearch. When false or unset, the existing
Venice web-search settings and validation apply. Tool settings override options, so selecting
VeniceXSearch enables X search even with -o enable_x_search false; this also applies when
the tool is restored by conversation continuation. See the search tools below.
Let Venice scrape URLs in your latest message:
llm -m venice/qwen-3-8-flash -o enable_web_scraping 1 "Summarize https://venice.ai"
Use a public character, for example:
llm -m venice/google-gemma-4-26b-a4b-it -o character_slug alan-watts "What is the meaning of life?"
API fields that have no dedicated option yet can be sent with extra_body, as a JSON object.
Put new Venice parameters under venice_parameters; they are merged with the options above:
llm -m venice/qwen-3-8-flash -o extra_body '{"venice_parameters": {"new_flag": true}}' "Hello"
extra_body cannot override fields that have an option or that llm sets itself (such as
min_p, temperature, messages, venice_parameters.character_slug, or
venice_parameters.enable_x_search); use the option instead.
Image and speech models accept -o extra_body '{...}' in the same way.
Web and X search tools
Models that advertise web search or X search expose them as llm server-side tools, so they also
show up in llm tools -m venice/<model> and are restored when you continue a conversation with
-c. Turn web search on or off per model with:
llm -m venice/qwen-3-8-flash -T 'VeniceWebSearch(mode="on")' --no-stream 'What is $VVV?'
VeniceWebSearch accepts mode ("auto" or "on"), citations (on by default) and scraping
(off by default). Models with X search support also offer:
llm -m venice/grok-4-7 -T VeniceXSearch --no-stream "What is trending about Venice AI?"
VeniceXSearch enables the same xAI native web and X/Twitter search as -o enable_x_search true
and takes precedence over enable_x_search=false. X search replaces Venice web search even
when both tools are selected, regardless of their order. Both tools remain available for
discovery and conversation continuation; llm still requires every selected tool to be
supported by the model. Use the -o parameters above for explicit web search modes and
combinations that the tools do not cover.
Search tools for function calling
Venice's search API is also available as function tools. Unlike the web and X search tools above, which run inside the chat request, the model writes each query and llm runs the search. They work with any model that supports function calling, including models from other plugins.
| Tool | Search provider |
|---|---|
venice_augment_search |
Required choice by the model on each call: brave, google or exa |
venice_augment_search_brave |
Brave |
venice_augment_search_google |
|
venice_augment_search_exa |
Exa |
Each tool takes a query (1-400 characters) and a limit (1-20 results, default 10), and returns
the title, URL, snippet and date of each result. Offer one of them per prompt; several at once give
the model duplicate tools.
llm -m venice/z-ai-glm-5-3 -T venice_augment_search --td "What is new in private AI inference?"
The generic tool asks the model to choose a provider for each query. Its description suggests
Brave for general keyword searches and news, Google as an alternative keyword engine or when
explicitly requested, and Exa for natural-language discovery and research. These are starting
heuristics; the model should respect your provider and privacy preferences and can change
providers when results are inadequate. --td shows tool arguments, including the chosen provider.
Every tool call is a separate, billed search. --cl/--chain-limit limits response rounds;
one round can contain several search calls, so it does not cap the number of billed searches.
Use --ta/--tools-approve to approve each call. Search results are untrusted web content.
For an optional live check, reuse the command above with these prompts and inspect --td:
- "Find research comparing approaches to private AI inference." Check how the model applies the research-search guidance; provider suitability is a heuristic.
- "Find today's AI news using only search providers with zero data retention." Calls should use Brave or Exa.
- "Use Google to find the Venice API documentation." Calls should use Google.
Text-to-speech
Text-to-speech models (for example tts-kokoro, the API default, or tts-gemini-3-1-flash) generate audio from text. Voices and supported output formats are model-specific. Audio files are stored in the LLM user directory by default.
Speech models are single-turn: llm -c, --cid and llm chat are rejected with "does not support conversations". Run each prompt on its own.
Basic usage:
llm -m venice/tts-kokoro "Hello, welcome to Venice Voice." -o voice af_sky -o response_format mp3 -o speed 1.0
The same with tts-gemini-3-1-flash, which names its voices differently:
llm -m venice/tts-gemini-3-1-flash "Hello, welcome to Venice Voice." -o voice Kore -o response_format mp3
Streaming (default; writes the output file immediately; useful for long outputs):
llm -m venice/tts-kokoro "First sentence. Second sentence. Third sentence." -o progress true
Disable streaming (wait for the full audio before writing the file):
llm --no-stream -m venice/tts-kokoro "First sentence. Second sentence. Third sentence."
To see all available options:
llm models list --query tts-kokoro --options
llm venice tts
The llm venice tts command writes audio to a file or, byte-exact, to stdout. Use it for pipelines: llm -m venice/tts-... always adds llm's own output (such as a trailing newline) to stdout, so it can only save files.
llm venice tts [TEXT] [-m MODEL] [--voice VOICE] [--format FORMAT] [--speed SPEED]
[-o PATH | -o -] [--overwrite] [--progress]
TEXTis read from stdin when it is omitted or-.-mtakes the model ID with or without thevenice/prefix. The default is the first text-to-speech model in the Venice model catalog.--voice,--format(the API'sresponse_format) and--speedaccept the same values as thevoice,response_formatandspeedoptions ofllm -m venice/<tts-model>.-ois this command's own output option, unrelated to llm's-o/--option KEY VALUE.-o FILEwrites a file,-o DIRwrites a generated file name into a directory, and-o -writes only the raw audio bytes to stdout (status and--progressgo to stderr). Without-o, audio is saved under the LLM user directory inaudio/. In file mode the saved path is printed on stdout.- Use a trailing separator for a directory that does not exist yet:
-o new-clips/creates it and saves audio under a generated file name. - Existing files are not overwritten unless
--overwriteis given; a timestamped file name is used instead. - Audio is written to an exclusively created
<name>.part. If that staging name is taken, a unique.<name>.<random>.partis used; existing partial files and symlinks are left alone. The destination appears only when the download is complete. Without--overwrite, publication atomically refuses to replace an existing path and retries with a timestamped name on collision. A failed download keeps any partial audio with a warning naming its path, leaving completed output from other writers untouched. With--overwrite, an existing file is replaced only after a successful download.llm -m venice/<tts-model>behaves the same. - Staging and new audio files request private permissions (
0600, subject to umask); overwrites preserve existing regular-file Unix access permissions where supported. FAT32/exFAT do not store per-file Unix permissions, so access protection depends on the platform and mount settings. - Saving without overwrite prefers the platform's rename-without-replacement operation, with hard links as a fallback when that operation is unavailable or unsupported. Hard links are not required when native exclusive rename works (including FAT32/exFAT with compatible OS drivers). If neither safe publication method works, the completed audio remains in the
.partfile named in the warning. - A request the API rejects (for example an unknown model or voice) fails before any audio arrives and writes nothing at all, not even an empty
.partfile. - The command does not log to llm's logs database.
Examples:
llm venice tts "Hello." --format mp3 -o - > out.mp3
llm venice tts "Hello." -o out.mp3
echo "Hello." | llm venice tts --voice af_sky -o - | mpv -
llm venice tts "Hello." -o - | tee out.mp3 | mpv - # play and keep a copy
The former -o stdout true option of llm -m venice/tts-... has been removed:
| Old | New |
|---|---|
llm -m venice/tts-kokoro "Hello." -o stdout true -o response_format mp3 > out.mp3 |
llm venice tts "Hello." --format mp3 -o - > out.mp3 |
llm -m venice/tts-kokoro "Hello." -o stdout true -o output_dir . -o output_filename out.mp3 |
llm venice tts "Hello." -o - | tee out.mp3, or just -o out.mp3 |
Image generation
Generated images are stored in the LLM user directory by default. Image models are single-turn, like speech models: llm -c, --cid and llm chat are rejected. Example:
llm -m venice/qwen-image-3 "Painting of a traditional Dutch windmill" -o style_preset "Watercolor"
Models that support them can also use API-native aspect-ratio and resolution presets:
llm -m venice/nano-banana-2-1 "Painting of a traditional Dutch windmill" -o aspect_ratio 16:9 -o resolution 4K
Web-enabled image models can also search the web for fresher visual context:
llm -m venice/nano-banana-2-1 "Current spring fashion street photography" -o enable_web_search true
Besides the Venice API image generation parameters, you can specify the output directory and filename, and whether or not to overwrite existing files.
You can request up to four image variants with -o variants 4. Multiple returned images are saved as suffixed filenames such as image_1.png, image_2.png.
You can check the available parameters for a model by filtering the model list with --query, and show the --options:
llm models list --query qwen-image-3 --options
Image upscaling
You can upscale existing images.
The following example saves the returned image as image_upscaled.<ext> in the same directory as the original file, where <ext> matches the format the API returns (png, jpg or webp):
llm venice upscale /path/to/image.jpg.
By default existing upscaled images are not overwritten; timestamped filenames are used instead.
See llm venice upscale --help for the --scale (between 2 and 4, default 2), --creativity (between 0 and 0.02), --output-path and --overwrite options.
A file name passed to --output-path is used as given, even if its extension differs from the returned format.
Web search
Search the web with Venice, without a model:
llm venice search -p exa -n 5 "private AI inference"
-p/--provider selects brave, google or exa; Venice uses Brave by default. -n/--limit
sets the number of results (1-20); Venice returns up to 10 by default. Add --json for the
JSON response. Each search is billed.
Venice commands
List the available Venice commands with:
llm venice --help
Debugging HTTP requests
Set LLM_VENICE_SHOW_RESPONSES=1 to print each Venice API request and response
(headers and bodies) to stderr. This covers chat, image, speech, upscale, the search
tools and the llm venice commands, from both the CLI and the Python API:
LLM_VENICE_SHOW_RESPONSES=1 llm -m venice/qwen-3-8-flash --no-stream 'Say hi'
- If
LLM_VENICE_SHOW_RESPONSESis unset or blank, llm'sLLM_OPENAI_SHOW_RESPONSESis used instead. Set the Venice variable to0to log other OpenAI-compatible models but not Venice. 0,false,offandnoturn logging off; any other value turns it on. (llm itself treats any non-emptyLLM_OPENAI_SHOW_RESPONSES, even0, as on.)- The
Authorization,Proxy-Authorization,Cookie,Set-CookieandX-API-Keyheaders are redacted, as areapiKey/api_keyfields in JSON bodies (such as a newly created API key). Other fields, such as logprobstoken, are shown as-is. - Long base64 data is shortened and binary bodies are summarised by type and size.
- Streamed chat responses are printed event by event as they arrive; use
--no-streamfor a single pretty-printed JSON body. Streamed speech audio is not printed. - Logging does not change how requests are sent, so
HTTP(S)_PROXY,ALL_PROXYandNO_PROXYstill apply.
Read the llm docs for more usage options.
Python API (0.10)
VeniceClient and AsyncVeniceClient cover catalogs, characters, image generation,
upscaling, speech, web search, and API-key management. Chat continues to use llm's model API.
Python 3.11 and later are supported; the installed package includes typing information.
from llm_venice import VeniceClient, ImageParams, SpeechParams
with VeniceClient() as client: # or VeniceClient(key="...")
models = client.list_models(type="image")
result = client.generate_image(
models[0]["id"],
"A Dutch windmill at dusk",
ImageParams(image_format="webp", variants=2),
)
paths = result.save("out", filename="windmill.webp")
# out/windmill_1.webp, out/windmill_2.webp
voices = client.list_models(type="tts")
speech = client.generate_speech(voices[0]["id"], "Hello", SpeechParams())
speech.save(f"hello.{speech.format}")
client.upscale_image("photo.jpg", scale=2).save("photo_2x.png")
Keys resolve lazily from key=, the llm keystore, or LLM_VENICE_KEY. Each client
reuses one HTTP connection pool; close it or use a context manager. An injected
http_client= is borrowed and is never closed or mutated. The wrapper's base URL,
authentication, user agent and timeout apply to every request. Closed wrappers
cannot be reused. Generation and key creation are never automatically retried.
Parameter defaults are omitted so Venice chooses its API defaults. Image params
accept image_format=; dictionary validation also accepts the wire alias format.
extra_body carries future JSON fields, including explicit nulls, but cannot override
named parameters, positional inputs, output options, or streaming/binary controls.
Clients never fetch a catalog implicitly during generation. Model adapters use
their existing catalog snapshot for model-specific validation and retain plugin
defaults (PNG, safe_mode=False, hide_watermark=True; MP3 speech when supported).
Use a registered model's .Options for its published limits and choices; class
.Options remains the base endpoint schema. Unknown catalog metadata adds no limits.
JSON methods return ordinary typed dictionaries and unwrap data envelopes:
list_models(), list_characters(web_enabled=True, adult=False), list_api_keys(),
get_rate_limits(), and get_rate_limits_log(). Unknown JSON fields and wire-format
timestamps are preserved. list_characters() returns one page: pass limit= (Venice's
default is 50, the maximum 100) and offset=, and stop at a page shorter than limit.
llm venice characters fetches every page. Key management requires an ADMIN key; create_api_key()
takes key_type=, description=, optional limit_usd=/limit_vcu=, and an optional
timezone-aware expires_at datetime. delete_api_key(id) returns None.
Resource annotations are available from llm_venice.types.
augment_search(query, limit=None, provider=None) searches the web without a model
and returns the executed query and its results. Each result has a title and
url, usually with a content snippet and date; both may be missing, null or empty.
provider is "brave", "google" or "exa"; omitted options use Venice's defaults
(Brave, 10 results).
The search tools are plain functions, such as
llm_venice.venice_augment_search_exa, and can be passed to model.chain(..., tools=[...]).
Direct calls to the generic tool require an explicit provider, for example
llm_venice.venice_augment_search("private AI inference", provider="exa").
Media and explicit saves
Buffered image/speech values expose .data. ImageResult.images is a tuple of
GeneratedImage; upscale returns that same image type. Results report the returned
format and never transcode bytes to match a filename suffix.
Single images, speech values, and streams save to an exact file path. Image
batches save to an explicit directory; filename must be a basename. A missing
suffix is inferred, and multiple images insert _1, _2, etc. before the suffix.
Existing destinations raise FileExistsError unless overwrite=True; library saves
never invent a different name. Requested parents are created without a prompt.
CLI adapters retain their automatic names and race-safe collision retries.
Publication is atomic per file, not across a batch: earlier successful files survive
a later failure. Private staging avoids truncating existing files or following
planted staging symlinks. Overwrite preserves existing regular-file permissions.
Errors/cancellation retain nonempty staging and may attach error.partial_path;
empty staging is removed. Cancellation that arrives once the file is already
published attaches error.published_path to the complete file instead.
Library saves print nothing.
To inspect this metadata on cancellation, catch asyncio.CancelledError where
stream.save() is awaited inside the task.
content_violation, content_policy_violation_count, and blurred are independent
facts. The library preserves all returned images, including moderated images.
Adapters suppress whole-response content violations but save successful partial
outputs when only some variants were omitted.
Async and streaming
import asyncio
from llm_venice import AsyncVeniceClient, SpeechParams
async def main():
async with AsyncVeniceClient() as client:
models = await client.list_models(type="tts")
async with client.stream_speech(
models[0]["id"], "Hello from Venice", SpeechParams()
) as stream:
await stream.save(f"hello.{stream.format}")
# Alternatively: async for chunk in stream.aiter_bytes(): ...
asyncio.run(main())
The synchronous equivalent is with client.stream_speech(...) as stream, followed
by stream.iter_bytes() or stream.save(path). A stream is context-bound and
single-use: choose one iterator or one save, and consume it before leaving the
context and client lifetime. Repeated consumption or saving after partial iteration
raises ValueError. Responses close on exhaustion, context exit, failure or
cancellation. Async file cleanup waits for in-flight writes; network I/O is native async.
Caller-supplied upscale files are read from their current position and remain open.
Errors and logging
Catch VeniceError for service failures, or its specific subclasses:
AuthenticationError (401/403), RateLimitError (429, with retry_after),
VeniceAPIError (HTTP status, headers, code and detail), VeniceConnectionError,
VeniceResponseError (malformed responses), and MissingKeyError (also an llm
NeedsKeyException). VeniceAPIError no longer inherits RuntimeError.
Invalid parameters raise Pydantic ValidationError; local file failures remain
OSError. Original causes and cancellation are preserved.
Clients created without http_client log as described in
Debugging HTTP requests, reading the setting on every
request. They never consume streams. Logging for a client you inject with
http_client is up to you.
Catalogs
from llm_venice import load_catalog, refresh_catalog, VeniceClient
from llm_venice.catalog import catalog_path, save_catalog
cached = load_catalog() # disk only; None if missing or unusable
with VeniceClient() as client:
models = refresh_catalog(client) # explicit fetch and atomic save
save_catalog(models, catalog_path())
Registration uses any usable cache regardless of age, even without a key. A missing cache can bootstrap with a five-second timeout; failed attempts are remembered for the same path/key until explicit successful refresh. Offline models are skipped; deprecation notices appear when a model is used. There is no automatic TTL refresh, trait routing, or trait alias registration.
See the 0.9-to-0.10 migration guide for removed helpers and options.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-venice
uv venv
source .venv/bin/activate
Install the plugin with dependencies (including test and dev):
uv pip install -e '.[test,dev]'
Preferably also install and enable pre-commit hooks:
uv pip install pre-commit
pre-commit install
To run the tests:
pytest
The default test run excludes live API calls. Run pytest -m integration manually
with a Venice key for catalog, account, chat and short-speech checks. Paid image
generation/upscale additionally requires LLM_VENICE_TEST_IMAGES=1.
Metadata
Release files for llm-venice 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llm_venice-0.10.0.tar.gz | 152.7 kB | With provenance | Details for llm_venice-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llm_venice-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for llm_venice-0.10.0-py3-none-any.whl |
Total release size: 228.1 kB
Release files / llm_venice-0.10.0.tar.gz
| Download URL | llm_venice-0.10.0.tar.gz |
|---|---|
| Size | 152.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4f08bc23a71b6463b35fa2d3b6e2510a85ddf83ad80f1f2ef4b103e87f3b82b
|
|
BLAKE2b-256 checksum How to use checksums |
030c6c041c1b52adaa2aaab053be9e691c196495152a9c0f169795af3a7ec712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / llm_venice-0.10.0-py3-none-any.whl
| Download URL | llm_venice-0.10.0-py3-none-any.whl |
|---|---|
| Size | 75.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d233a0b907294460f80c910582c2c26aa3766248f48fb6854e89b4a727e5ef2d
|
|
BLAKE2b-256 checksum How to use checksums |
b7660f1c32ec713a612d151a3e3e19b8db46a14e01caa6643a9b216baf79b5ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logSecurity for llm-venice 0.10.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for llm_venice-0.10.0.tar.gz
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 Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.