Skip to content

feat(model): add Groq chat model and formatter#1467

Open
saswattulo wants to merge 1 commit intoagentscope-ai:mainfrom
saswattulo:feat/groq-model
Open

feat(model): add Groq chat model and formatter#1467
saswattulo wants to merge 1 commit intoagentscope-ai:mainfrom
saswattulo:feat/groq-model

Conversation

@saswattulo
Copy link
Copy Markdown

@saswattulo saswattulo commented Apr 12, 2026

feat(model): add groq chat model and formatter

AgentScope Version

1.0.19dev

Description

Background: Groq provides low-latency inference for popular open-weight
models (Llama, Mixtral, Gemma) via an OpenAI-compatible API. It was not
previously supported in AgentScope.

Changes made:

  • src/agentscope/model/_groq_model.pyGroqChatModel class with
    streaming, tool use, and structured output support
  • src/agentscope/formatter/_groq_formatter.pyGroqChatFormatter and
    GroqMultiAgentFormatter (inherits OpenAI-compatible formatter)
  • pyproject.toml — added groq optional dependency
    (pip install agentscope[groq])
  • tests/model_groq_test.py — 11 unit tests covering init, non-streaming,
    streaming, tool use, structured output, and usage parsing
  • examples/agent/groq_agent/ — runnable example covering basic chat,
    streaming, ReAct agent with tools, and structured output

How to test:

pip install agentscope[groq]
export GROQ_API_KEY="your-key"
pytest tests/model_groq_test.py        # 11 tests, all pass
python examples/agent/groq_agent/main.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant