Skip to content

[Platform] Add Groq support #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dave1010
Copy link

Contributes to #16

Q A
Bug fix? no
New feature? yes
Docs? yes
Issues Contributes to #16
License MIT


$platform = PlatformFactory::create($_SERVER['GROQ_API_KEY']);
$model = new Llama(Llama::LLAMA3_70B, [
'temperature' => 0.5, // default options for the model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this is the default, can we remove it in the example?

Comment on lines +75 to +78
* `Meta's Llama`_ with `Azure`_, `Ollama`_, `Replicate`_, `AWS Bedrock`_ and `Groq`_ as Platform
* `Google's Gemma`_ with `Groq`_ as Platform
* `Mistral's Mixtral`_ with `Groq`_ as Platform
* `Alibaba's Qwen`_ with `Groq`_ as Platform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use some kind of table for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this doesn't scale well - not necessarily scope of this PR, but I'm in need for better ideas - even feels like a three dimensional table 😆

@OskarStark OskarStark added the Platform Issues & PRs about the AI Platform component label Jul 14, 2025
@OskarStark OskarStark changed the title feat: Add Groq support [Platform] Add Groq support Jul 14, 2025
* @author Christopher Hertel <[email protected]>
* @author Dave Hulbert <[email protected]>
*/
class Llama extends Model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be something more neutral like

Suggested change
class Llama extends Model
class Model extends BaseModel

since this is not only Llama it's a bit confusing - it's rather a collection of models available on Groq

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Yeah, I'll update. Started with Llama, then I realised they have others now.

require_once dirname(__DIR__, 2).'/vendor/autoload.php';
(new Dotenv())->loadEnv(dirname(__DIR__).'/.env');

$platform = PlatformFactory::create($_SERVER['GROQ_API_KEY']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when introducing a new env var, please add it to .env file (without value in this case) and check if the variable is set before - see other examples

use Symfony\AI\Platform\Message\MessageBag;
use Symfony\Component\Dotenv\Dotenv;

require_once dirname(__DIR__, 2).'/vendor/autoload.php';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 2 can be removed here:

Suggested change
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
require_once dirname(__DIR__).'/vendor/autoload.php';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after this change the example works for me 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. Somehow I got in a bit of a mess with doing a composer install in the monorepo!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split the test class per tested class

Comment on lines +25 to +27
/**
* @covers \Symfony\AI\Platform\Bridge\Groq\Llama
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use #[CoversClass(Llama::class)] attribute instead

Copy link
Contributor

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to this repository @dave1010 - and thanks a ton for working on this! New bridges are always welcome!

@OskarStark and me added some comments, but I think mostly minor stuff - so great work already :) 👍

Please always make sure to run provided example classes yourself locally - to make sure they are functional. You can find some pointers here: https://github.com/symfony/ai/blob/main/examples/README.md

@OskarStark
Copy link
Contributor

We just created some CHANGELOG.md files.
Please rebase your branch and add info to the appropriate CHANGELOG.md file.

Thanks

@dave1010
Copy link
Author

Will do. Thanks.

Sorry, haven't had a chance to get back to this yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Issues & PRs about the AI Platform component Status: Needs Work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants