Skip to main content

lmux-groq

Groq provider for lmux. Talks to the Groq Chat Completions API directly over httpx.

Supports chat completions and streaming.

Part of the lmux ecosystem: standardized interface, cost tracking on every response, and registry-based routing across providers.

Auth

Set GROQ_API_KEY in your environment. The default GroqEnvAuthProvider reads it automatically.

from lmux_groq import GroqProvider

provider = GroqProvider()

Usage

Chat

from lmux import UserMessage

response = provider.chat("llama-3.3-70b-versatile", [UserMessage(content="Hello")])
print(response.content)
print(response.cost)

Streaming

for chunk in provider.chat_stream("llama-3.3-70b-versatile", [UserMessage(content="Hello")]):
    if chunk.delta:
        print(chunk.delta, end="")

Async

All methods have async variants: achat, achat_stream.

Registry

Use with the lmux registry to route across multiple providers:

from lmux import Registry

registry = Registry()
registry.register("groq", provider)
response = registry.chat("groq/llama-3.3-70b-versatile", messages)

Provider Params

from lmux_groq import GroqParams

response = provider.chat(
    "llama-3.3-70b-versatile",
    messages,
    provider_params=GroqParams(service_tier="flex"),
)
Parameter Type Description
service_tier "auto" | "on_demand" | "flex" | "performance" Service tier selection
seed int Deterministic sampling seed
user str End-user identifier

Constructor Options

GroqProvider(
    auth=...,          # AuthProvider[str], default: GroqEnvAuthProvider()
    base_url=...,      # Optional base URL override
    timeout=...,       # Request timeout in seconds
    max_retries=...,   # Max retry attempts
    default_headers=...,  # Optional headers included with every request
    transport=...,        # Optional httpx.BaseTransport for the sync client (proxies, testing)
    async_transport=...,  # Optional httpx.AsyncBaseTransport for the async client
)

default_headers is useful for gateway authentication, tracing, and routing. Groq-managed authorization and content-type headers take precedence over caller values, case-insensitively.

Metadata

Release files for lmux-groq 0.8.2

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

Source distribution (sdist)

Source distribution for lmux-groq 0.8.2
File Size Uploaded
lmux_groq-0.8.2.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lmux-groq 0.8.2
File Interpreter ABI Platform
lmux_groq-0.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / lmux_groq-0.8.2.tar.gz

Download URL lmux_groq-0.8.2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
163f42f167bb1a64013001d80c8bc4140863cdc2f4d10e59f6c343b453eb8aca
BLAKE2b-256 checksum
How to use checksums
83b209099b2378bc44e76d5c5d2bc5d21a76773c834d8142806927165d53efed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 1, 2026.

Transparency log

Release files / lmux_groq-0.8.2-py3-none-any.whl

Download URL lmux_groq-0.8.2-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e76245d8725728ca61c70be2038fcc117e8b4ec9bc7f1bff830cfa9d4531f191
BLAKE2b-256 checksum
How to use checksums
10f4003206b289b544bbc556dc9d8b127a1a32156ff34c86b847043bafa53569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.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