Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Groq Php Laravel Package

lucianotonet/groq-php

A PHP SDK for the GroqCloud API that lets developers add fast LLM inference to any PHP app, with chat completions, tool calling, vision, reasoning, audio transcription, text-to-speech, batch processing, and RAG support.

View on GitHub
Deep Wiki
Context7
v1.4.2

Added

  • Documents (RAG) & Citations restored: re-added the documents and citation_options Chat Completions parameters as pass-through forwarding, plus BuiltInTools::document() and BuiltInTools::documentFromFile() helpers. These are valid API parameters; support is model-specific (the legacy RAG models llama-3.3-70b-versatile / llama-3.1-8b-instant were retired on 2026-08-16 for free/developer tiers, so current models reject documents with not supported with this model). The library forwards them as-is and lets the API enforce model support.
  • Chat Completions parity: added the disable_tool_validation parameter pass-through.
  • Audio transcription/translation parity: added the url parameter (alternative to file) and fixed timestamp_granularities[] so each granularity is sent as a repeated multipart field (previously sent as a single array, which the API rejected). Both endpoints now accept either file or url.
v1.4.1

Fixed

  • Built-in Tools / Compound: use the current Compound system models (compound-beta / compound-beta-mini) instead of the deprecated groq/compound alias.
  • Removed the documents (RAG) and citation_options Chat Completions parameters: the live Groq API rejects them on all current models, so they were non-functional. compound_custom and search_settings remain supported.
  • New tests (BuiltInToolsTest, ResponsesTest) are now mode-aware so they pass both against the offline mock (default) and the real API (GROQ_LIVE_TESTS=1).
v1.4.0

Added

  • Responses API client (Groq::responses()): OpenAI-compatible input/output model responses with streaming, structured outputs (text.format), and reasoning controls.
  • Built-in (server-side) tools & Compound support: LucianoTonet\GroqPHP\BuiltInTools helpers for compound_custom, plus documents, search_settings, and citation_options on Chat Completions (RAG & citations).
  • Speech::sampleRate() and Speech::speed() fluent setters forwarded to the TTS API.
  • Forwarding of timestamp_granularities[] in Transcriptions (Groq supports it with response_format=verbose_json).
  • Documentation: Prompt Caching & Content Moderation (safeguard models).
  • Offline mock test layer (tests/MockRouter) so the suite runs without network or API credits; CI runs mocked by default with a nightly live job.

Changed

  • Documentation refreshed and verified against console.groq.com/docs (model defaults, Vision, Reasoning, deprecated models, features).

Fixed

  • Transcriptions docblock incorrectly claimed timestamp_granularities[] was unsupported.
v1.3.0

Breaking Changes in Files/Batches Module

  • Changed JSONL file format requirements for batch processing
  • Restricted file extensions to .jsonl only (removed support for .json, .txt, .ndjson)
  • Added stricter validation for file contents and structure

Changed

  • Updated Files API validation to properly handle 'batch' purpose
  • Added support for additional MIME types: application/x-jsonlines, application/jsonl, application/x-ndjson, application/x-ndjason
  • Updated JSONL file format documentation and examples
  • Updated tests to use new JSONL format and purpose
  • Improved file validation order in FileManager.php
  • Fixed JSONL file validation in FileManager to properly check content format
  • Enhanced error messages for file type validation
  • Improved test coverage for file upload functionality

Added

  • New example file: examples/batch-processing.php
  • Additional test cases for JSONL file validation
  • Improved error messages for file validation
  • Test results: 39 tests, 218 assertions (all passing)
  • Added more comprehensive validation for JSONL file contents
  • Support for audio transcription and translation in batch processing
  • Support for chat completions in batch processing

Fixed

  • Issue with file type validation in FileManager::validateFile method
  • Improved MIME type detection for JSONL files
  • Fixed test case for file upload to use correct JSONL format
  • Corrected JSONL test file structure to match API requirements

Migration Guide for Files/Batches Module

If you are using the Files/Batches module, you will need to:

  1. Update your JSONL files to include required fields:
    • custom_id: Your unique identifier for tracking
    • method: Must be "POST"
    • url: One of: /v1/chat/completions, /v1/audio/transcriptions, or /v1/audio/translations
    • body: Request parameters matching the endpoint format
  2. Ensure all files use .jsonl extension
  3. Update file content to match new validation requirements
  4. Review the updated documentation for complete format specifications
v1.0.0
  • 23/03/2025 test: Add EnvironmentVariablesTest for GROQ_API_KEY and GROQ_API_BASE
  • 23/03/2025 fix: prevent TypeError from unset GROQ_API_BASE environment variable
  • 23/03/2025 refactor: Update depracated models on examples and tests to use Llama 3
  • 27/02/2025 docs: Update README
  • 23/02/2025 fix: Fix general warning - 'The version field is present, it is recommended to leave it out if the package is published on Packagist.'
  • 23/02/2025 Add GitHub Actions workflow for running tests
v0.1.2
  • 23/02/2025 chore: Bump version to v0.1.2
  • 23/02/2025 Merge pull request #11 from lucianotonet/feat/files-and-batches
  • 23/02/2025 Apply suggestions from code review
  • 23/02/2025 Apply suggestions from code review
  • 23/02/2025 Add comprehensive test suite for Groq PHP library
  • 23/02/2025 Adds reasoning format options to example
  • 23/02/2025 Adds file and batch processing capabilities
v0.1.0
  • 18/02/2025 chore: bump version to 0.1.0
  • 18/02/2025 Merge pull request #10 from lucianotonet/develop
  • 18/02/2025 Update temperature input range in reasoning example
  • 18/02/2025 Update README with comprehensive configuration options and new reasoning/tool calling documentation
  • 18/02/2025 Renames max_tokens to max_completion_tokens
  • 18/02/2025 Adds reasoning feature
  • 18/02/2025 Merge pull request #9 from lguichard/main
  • 18/02/2025 Fixes
  • 14/02/2025 Fix - Update completions parameters
v0.0.10
  • 29/10/2024 Update version to 0.0.10 in composer.json, add API key options in README.
  • 29/10/2024 Merge pull request #8 from lucianotonet/develop
  • 29/10/2024 Merge branch 'hotfix/test-vision-with-url' into main
  • 29/10/2024 Merge branch 'hotfix/test-vision-with-url' into develop
  • 29/10/2024 Translate messages
  • 29/10/2024 hotfix: Update image URL in VisionTest
  • 29/10/2024 Merge branch 'feature/apikey-on-runtime' into develop
  • 29/10/2024 feat: Update Groq class properties and setOptions method.
  • 19/09/2024 feat: Ensure API key is explicitly set during initialization
  • 19/09/2024 feat(Vision): add default model and enhance analyze method
  • 19/09/2024 feat: add parallel tool calls and additional parameters for flexibility
  • 08/09/2024 Update image URL in README for Groq PHP project
v0.0.9
  • 06/09/2024 Merge remote-tracking branch 'origin/main'
  • 06/09/2024 Fix: Re-added missing parameters on request
  • 06/09/2024 Update README.md
  • 05/09/2024 Update package URL in README for consistency and clarity.
  • 05/09/2024 Add image to README for Groq PHP project
  • 04/09/2024 Update README.md
  • 04/09/2024 Merge tag 'v0.0.9' and add Vision functionality for image analysis. - Merge tag 'v0.0.9' - Add Vision functionality for image analysis and examples
  • 04/09/2024 Merge tag 'v0.0.9'
  • 04/09/2024 Merge pull request #6 from tgeorgel/main
  • 04/09/2024 Add Vision functionality for image analysis and examples:
  • 03/09/2024 fix: Prevent the language to be forced on the transcript endpoint
  • 02/08/2024 Update Groq PHP package version to 0.0.8
v0.0.8
  • 02/08/2024 Update Groq PHP package version to 0.0.8
  • 02/08/2024 feat: Update examples
  • 02/08/2024 feat: Enhance error handling and improve API response management
  • 30/07/2024 chore: Update badges in README.md
v0.0.7
  • 23/07/2024 chore: Bump version to 0.0.7
  • 23/07/2024 Test: Validate API key and integrate model listing
  • 23/07/2024 Refactor: Enhance Error Handling and Improve Code Quality
  • 23/07/2024 docs: Update Changelog
  • 23/07/2024 feat: Add list models feature
  • 23/07/2024 chore: Update to use $_ENV instead of getenv() for improved reliability
  • 23/07/2024 chore: Change GROQ_API_BASE_URL env var to GROQ_API_BASE
v0.0.6
  • 19/07/2024 feat: Add speech-to-text transcription and translation features
v0.0.4
  • 20/04/2024 Add examples folder + some improvements: - Add support for response streaming and JSON mode. - Improve error handling with more descriptive errors. - Add usage examples. - Fix bugs related to streaming and JSON mode. - Update minimum PHP version. - Add unit tests.
  • 13/04/2024 Fix: Cannot assign bool to property LucianoTonet\GroqPHP\Groq::$baseUrl of type string
  • 30/03/2024 Update README
v0.0.3
v0.0.1
v0.1.1
v0.0.5
  • 04/07/2024 Merge pull request #4 from lucianotonet/versionfix
  • 04/07/2024 Fix version mismatch
  • 04/07/2024 Update composer.json
  • 20/06/2024 Merge pull request #3 from JosephGabito/main
  • 21/06/2024 Update README.md
  • 13/06/2024 Docs: Mark Models endpoint as completed (1c9a24d)
  • 13/06/2024 Remove unrelated scripts
  • 13/06/2024 Docs: Remove max retries from readme
  • 13/06/2024 Refatoração: Melhora a legibilidade do código em exemplos
  • 13/06/2024 feat: Remove Llama2 references as it is not available anymore
  • 18/05/2024 Refactored error handling and added documentation examples for Groq PHP library.
  • 17/05/2024 Refactor script filenames for brevity and clarity. Rename CHANGELOG_GENERATOR.sh to CHANGELOG_GEN.sh and CHANGELOG_GENERATOR_AI.sh to CHANGELOG_GEN_AI.sh for concise and consistent naming conventions.
  • 17/05/2024 Add Groq API key and base URL to .env.example file
  • 16/05/2024 Add Models class and list method for fetching models from API
v0.0.2
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin