Skip to content

[BUG] Groq API compatibility: tool call format error (tool_use_failed / invalid_request_error) #748

Description

@61j3t

Quick Summary

When configuring Groq as the LLM provider, all agent calls fail with a 400 tool_use_failed error. The model generates responses using a <function=name{...}> format which Groq's API rejects, as it expects standard OpenAI-style tool calls.

Environment & Tools

PicoClaw Version: main branch
AI Model & Provider: llama-3.3-70b-versatile via Groq
Operating System: macOS
Channels: CLI

📸 Steps to Reproduce

Add a Groq model entry to model_list in ~/.picoclaw/config.json with "model": "groq/llama-3.3-70b-versatile"
Set agents.defaults.model to the corresponding model_name
Run picoclaw agent -m "Hello"

❌ Actual Behavior

Status: 400
{"error":{"message":"Failed to call a function. Please adjust your prompt.","type":"invalid_request_error","code":"tool_use_failed","failed_generation":"<function=message{"channel": "cli", "content": "Hello, how can I help you?"},-------------"}}

✅ Expected Behavior

Agent responds normally via Groq's API.

💬 Additional Context

The system prompt appears to instruct the model to use a custom <function=name{...}> format. Groq's API enforces strict OpenAI-compatible tool call schemas and rejects this format. A fix would be to use native OpenAI-style tool_calls when the provider is Groq or any OpenAI-compatible endpoint. The issue does not appear to be with the API key or model availability. basic Groq API calls work fine outside of picoclaw.

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions