PackageTrack
Sign in Get early access

lucianotonet/groq-php

A powerful PHP library for seamless integration with the GroqCloud API

v1.3.0 255K downloads/mo #4876 most downloaded on Packagist lucianotonet/groq-php

What this package is like to depend on

Last release 1 years ago

03 Jun 2025

Release timing varies

gaps range from 9 days to 4 months

Nearly every release is documented

notes for 17 of 17 stable releases

Nothing withdrawn

no release was ever pulled

2 years old

17 releases · first in 2024

0 releases in the last 12 months

see the full history below

Release timeline

17 releases · Mar 2024 to Jun 2025
2025 2026
Release Pre-release

Releases

latest 17
  1. v1.3.0 03 Jun 2025
    Release notes

    🚀 Release v1.3.0

    This release brings significant improvements to the Files/Batches module, including expanded support for batch processing of chat completions and audio operations.

    🔄 Breaking Changes in Files/Batches Module

    New JSONL Format Requirements (Fixes #14)

    • Each line must now follow Groq's official batch format:
      {
        "custom_id": "your-tracking-id",
        "method": "POST",
        "url": "/v1/chat/completions",
        "body": {
          "model": "llama-3.1-8b-instant",
          "messages": [...]
        }
      }

    File Restrictions

    • Only .jsonl extension is now supported
    • Removed support for .json, .txt, .ndjson

    ✨ New Features

    • Batch processing support for:
      • Chat completions
      • Audio transcription
      • Audio translation
    • Enhanced validation and error handling

    🛠️ Improvements

    • Additional MIME types support
    • Better JSONL file type detection
    • Expanded test coverage
    • Updated documentation

    📝 Migration Guide

    1. Update your JSONL files:

      • Add custom_id field
      • Set method to "POST"
      • Use proper endpoint URL
      • Move request parameters inside body object
    2. Supported Endpoints:

      • /v1/chat/completions
      • /v1/audio/transcriptions
      • /v1/audio/translations

    📚 Example JSONL File

    {"custom_id": "chat-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "llama-3.1-8b-instant", "messages": [{"role": "user", "content": "Hello"}]}}
    {"custom_id": "audio-1", "method": "POST", "url": "/v1/audio/transcriptions", "body": {"model": "whisper-large-v3", "language": "en", "url": "https://example.com/audio.wav"}}

    📋 Notes

    • Changes only affect the Files/Batches module
    • Core library features remain unchanged
    • All tests passing: 39 tests, 218 assertions

    🔗 Links

    Open source →
    Release notes

    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
    Open source →
  2. v1.2.0 25 May 2025
    Release notes

    Release v1.2.0 - Fix JSONL format in batch processing tests

    Open source →
  3. v1.1.0 13 Apr 2025
    Release notes

    Release Notes: v1.1.0

    New features

    Text-to-Speech (TTS) API Integration

    • Added support for GroqCloud's Text-to-Speech API
    • Implemented the Speech class with a fluent interface for easy configuration
    • Added a new speech() method to the Audio class
    • Added support for both English and Arabic TTS models

    Implementation details

    • Models: Added support for playai-tts (English) and playai-tts-arabic (Arabic)
    • Parameters:
      • model(): Set the TTS model to use
      • input(): Define text to convert to speech
      • voice(): Set voice identifier (e.g., "Bryan-PlayAI")
      • responseFormat(): Define output format (default: "wav")
    • Methods:
      • create(): Returns audio content as stream
      • save($filePath): Saves audio directly to a file

    Example usage

    // Save audio to file
    $result = $groq->audio()->speech()
        ->model('playai-tts')
        ->input('Hello, this text will be converted to speech')
        ->voice('Bryan-PlayAI')
        ->responseFormat('wav')
        ->save('output.wav');
    
    // Get as stream (e.g., to send to browser)
    $audioStream = $groq->audio()->speech()
        ->model('playai-tts')
        ->input('This is another example text')
        ->voice('Bryan-PlayAI')
        ->create();
    
    header('Content-Type: audio/wav');
    header('Content-Disposition: inline; filename="speech.wav"');
    echo $audioStream;

    Documentation

    Updated README.md to include comprehensive documentation about the new TTS functionality.

    Additional notes

    • Text-to-Speech requires acceptance of terms of use in the GroqCloud console
    • For more detailed examples, see examples/audio-speech.php
    Open source →
  4. v1.0.0 23 Mar 2025
    Release notes

    GroqPHP v1.0.0

    We are thrilled to announce the release of GroqPHP v1.0.0! 🎉

    This marks a significant milestone as we celebrate our first anniversary. The initial commit was made on March 22, 2024, and after a year of development and iteration, we are proud to have reached 16,000+ downloads. This achievement is a testament to the growing adoption of our library in the PHP community.

    What's New in v1.0.0

    The 1.0.0 release represents a stable, feature-rich offering that builds upon previous versions with several significant improvements:

    Files and Batch Processing

    One of the most significant additions in this release is comprehensive support for the Groq Files and Batch Processing APIs:

    • File Management: Seamlessly upload, list, retrieve, download, and delete JSONL files for batch processing

      • Support for large file uploads (up to 100MB)
      • Automatic validation of file formats and content
      • Comprehensive error handling for all file operations
    • Batch Processing: Process large volumes of requests asynchronously

      • Create and manage batch jobs with detailed status tracking
      • Support for batch job creation, retrieval, listing, and cancellation
      • Detailed error reporting for batch operations

    Other Enhancements

    • Improved Error Handling: Enhanced exception handling with more descriptive error messages
    • Updated Models Support: Added support for the latest Groq models, including Llama 3.1
    • Environment Variables: Improved handling of environment variables with better fallbacks
    • Comprehensive Testing: Added extensive test suite for all components
    • API Stability: Finalized API design with stable interfaces

    Under the Hood

    • Fixed various warnings and potential type errors
    • Added GitHub Actions workflow for automated testing
    • Updated deprecated model references
    • Enhanced documentation with more examples

    Breaking Changes

    While we have made efforts to maintain backward compatibility, there are a few breaking changes to be aware of:

    • The minimum PHP version requirement remains at ^8.1.0
    • Some parameter names have been standardized for consistency

    Contributors

    We extend our heartfelt thanks to all contributors who have made this release possible:

    • Luciano Tonet (@lucianotonet) - Project creator and main developer
    • Thomas Georgel (@tgeorgel) - Improvements to audio functionality to prevent forced language setting
    • lguichard (@lguichard) - API parameter fixes and improvements
    • Joseph G (@JosephGabito) - Documentation improvements

    And to all users who have provided valuable feedback and suggestions through issues, including @zachary, @EliasPereirah, @flemzord, and @mmddev87.

    Looking Forward

    As we move beyond v1.0.0, we remain committed to improving GroqPHP with new features, optimizations, and expanded model support. We encourage you to report issues and contribute to the project on GitHub.

    Open source →
    Release notes
    • 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
    Open source →
  5. 0.1.2 23 Feb 2025
    Release notes

    What's Changed

    Full Changelog: v0.1.1...v0.1.2

    Open source →
    Release notes
    • 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
    Open source →
  6. 0.1.1 20 Feb 2025
    Release notes
    • Rewrite description
    Open source →
    Release notes
    Open source →
  7. 0.1.0 18 Feb 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v0.0.10...v0.1.0

    Open source →
    Release notes
    • 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
    Open source →
  8. 0.0.10 29 Oct 2024
    Release notes

    What's Changed

    Full Changelog: v0.0.9...v0.0.10

    Open source →
    Release notes
    • 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
    Open source →
  9. 0.0.9 07 Sep 2024
    Release notes

    What's Changed

    Add Vision functionality for image analysis and examples:

    • Added PHP files for Vision analysis and some examples like Vison Simple, Vision URL, Vision Multiple, and Vision Feedback.
    • Implemented forms to upload images or provide image URLs with prompts for analysis on examples.
    • fix: Prevent the language to be forced on the transcript endpoint by @tgeorgel in #6

    New Contributors

    Full Changelog: v0.0.8...v0.0.9

    Open source →
    Release notes
    • 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
    Open source →
  10. 0.0.8 02 Aug 2024
    Release notes

    This release includes several enhancements and improvements to the Groq PHP package:

    • Enhanced error handling and improved API response management, including a new 'failed_generation' field for errors in JSON object responses
    • Updated examples with improved error handling and compatibility with the latest GroqException implementations
    • Refreshed README.md with new badges displaying version, total downloads, and license information
    • Updated package version to 0.0.8, ensuring access to the latest features and performance enhancements

    These updates aim to provide a more robust and user-friendly experience when working with the Groq API through this PHP package.

    Full Changelog: v0.0.7...v0.0.8

    Open source →
    Release notes
    • 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
    Open source →
  11. 0.0.7 24 Jul 2024
    Release notes
    • 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
    Open source →
  12. 0.0.6 20 Jul 2024
    Release notes
    • 19/07/2024 feat: Add speech-to-text transcription and translation features
    Open source →
  13. 0.0.5 04 Jul 2024
    Release notes
    • 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
    Open source →
  14. 0.0.4 20 Apr 2024
    Release notes
    • 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
    Open source →
  15. 0.0.3 30 Mar 2024
    Release notes
    Open source →
  16. 0.0.2 28 Mar 2024
    Release notes
    Open source →
  17. 0.0.1 22 Mar 2024
    Release notes
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive