Skip to main content

Groq inference provider for the NucleusIQ AI agent framework (official groq Python SDK).

Project description

nucleusiq-groq

Groq inference provider for NucleusIQ: Chat Completions via Groq’s OpenAI-compatible API, using Groq’s official groq Python SDK (AsyncGroq / Groq).

Status: 0.1.0a1 (alpha / pre-release). Requires nucleusiq>=0.7.8.

Design, phased roadmap (Phase A vs B), and API caveats: docs/design/GROQ_PROVIDER.md (repo root).


Install

PyPI (when published):

pip install nucleusiq nucleusiq-groq

Monorepo (editable):

cd src/providers/inference/groq
uv sync --group dev

Core is pulled via [tool.uv.sources] as an editable path dependency; for pip-only local installs, install nucleusiq from src/nucleusiq first, then this package.


Configuration

Variable Purpose
GROQ_API_KEY Required. Groq API key.
GROQ_MODEL Optional. Default for chat/tool examples: llama-3.3-70b-versatile.
GROQ_MODEL_STRUCTURED Optional. Model for json_schema structured output (example 05 defaults to openai/gpt-oss-20b if unset).

Unsupported Chat Completions fields (e.g. logit_bias, messages[].name) are stripped or rejected at the wire layer; see the design doc.


Usage

import asyncio
from nucleusiq.agents import Agent
from nucleusiq.agents.config import AgentConfig, ExecutionMode
from nucleusiq.agents.task import Task
from nucleusiq.prompts.zero_shot import ZeroShotPrompt
from nucleusiq_groq import BaseGroq, GroqLLMParams

async def main() -> None:
    llm = BaseGroq(model_name="llama-3.3-70b-versatile", async_mode=True)
    agent = Agent(
        name="demo",
        prompt=ZeroShotPrompt(),
        llm=llm,
        config=AgentConfig(
            execution_mode=ExecutionMode.DIRECT,
            llm_params=GroqLLMParams(temperature=0.2),
        ),
    )
    await agent.initialize()
    result = await agent.execute(Task(id="1", objective="Capital of France in one short phrase."))
    print(result.output)

asyncio.run(main())

Phase A (this release)

  • BaseGroqcall / call_stream, tool calling, structured output (response_format / Pydantic).
  • GroqLLMParams — typed, extra="forbid"; merges into provider calls.
  • Local function tools — OpenAI-style tool JSON; assistant tool_calls normalized for Groq before each request.
  • Retries — rate-limit and transient errors with exponential backoff; errors mapped to NucleusIQ LLMError types.

Not in Phase A: Groq Responses API, built-in/hosted tools, remote MCP (see design doc Phase B).


Examples

Runnable agents (real API): examples/README.md.

cd src/providers/inference/groq
uv run python examples/agents/01_groq_direct.py

Development

From this directory:

uv sync --group dev
uvx ruff check nucleusiq_groq tests examples
uvx pyrefly check
uv run pytest

License

MIT — same as the NucleusIQ monorepo.

Project details


Download files

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

Source Distribution

nucleusiq_groq-0.1.0a1.tar.gz (73.6 kB view details)

Uploaded Source

Built Distribution

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

nucleusiq_groq-0.1.0a1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file nucleusiq_groq-0.1.0a1.tar.gz.

File metadata

  • Download URL: nucleusiq_groq-0.1.0a1.tar.gz
  • Upload date:
  • Size: 73.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nucleusiq_groq-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 91fe224bd231c27b2235b8f1aa57a960112ae202338b837040b607cf7fd64d76
MD5 b9a993df54f4c64ff92df816d4ef7b80
BLAKE2b-256 3c307fdcc5d4d0fbb50e9049982a3121d7b46575702db1ca5ae5d7541f6337ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for nucleusiq_groq-0.1.0a1.tar.gz:

Publisher: publish.yml on nucleusbox/NucleusIQ

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

File details

Details for the file nucleusiq_groq-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for nucleusiq_groq-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 51a83d5a567f4ad55b5108a38780539f45540028f52053533be39d802b19934d
MD5 e627ec986b788138e1d7ac6be2f11c3e
BLAKE2b-256 95a82fe3fae5fef279b7e38d436dd0d43580d6026f388f9d9de91b52bbd635e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nucleusiq_groq-0.1.0a1-py3-none-any.whl:

Publisher: publish.yml on nucleusbox/NucleusIQ

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