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

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.1
File Size Uploaded
lmux_groq-0.8.1.tar.gz 9.3 kB Details

Built distribution (wheel)

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

Total release size: 21.8 kB

Release files / lmux_groq-0.8.1.tar.gz

Download URL lmux_groq-0.8.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6ad92d4d929edee62ce1bd182c7d4ffb57a0e4bf54e8e7b310604332203ef52f
BLAKE2b-256 checksum
How to use checksums
335556fe61659edb300aac5bff2748c432841c84546b449399c517c1be1cf3b9
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 Aug 17, 2026.

Transparency log

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

Download URL lmux_groq-0.8.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adf02533c6859bc836e1a09f0f4490a1f5852e476d52f46cbb3a15e9fa45d0d9
BLAKE2b-256 checksum
How to use checksums
0d5c0db78068e4d849f70c1e2a249580abc263e667a8c1e344093fc485c4f4bb
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 Aug 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.2

2 release files

This release

0.8.1 This release

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