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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmux_groq-0.8.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lmux_groq-0.8.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file lmux_groq-0.8.0.tar.gz.

File metadata

  • Download URL: lmux_groq-0.8.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for lmux_groq-0.8.0.tar.gz
Algorithm Hash digest
SHA256 32a6117a52a8cac86ed4c56829e00269a443a745da3ae2c6808f99c020661237
MD5 1b7b46f3ecbcc0aa055d078868d52c1f
BLAKE2b-256 5baff116485cc5d33bd3aa8164005fd12263bcb5de6d9cf7127214f704143045

See more details on using hashes here.

Provenance

The following attestation bundles were made for lmux_groq-0.8.0.tar.gz:

Publisher: publish.yml on cluebbehusen/lmux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lmux_groq-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: lmux_groq-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for lmux_groq-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37139540322558b8e11777ea419d987d57d4593a1ae704e06dd10a0da7821dc8
MD5 ec75faafc6a05d90131f9ece12b41dbe
BLAKE2b-256 aafbf27b1aa77b6b0cec6110617c873af3cefdb58a0e7387ebde3aafdb50bebe

See more details on using hashes here.

Provenance

The following attestation bundles were made for lmux_groq-0.8.0-py3-none-any.whl:

Publisher: publish.yml on cluebbehusen/lmux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page