Skip to content

Conversation

@masegraye
Copy link

@masegraye masegraye commented Apr 17, 2025

Groq is largely OpenAI compatible, with a few quirks.

  • Adds first-class Groq support
  • Includes searching in response for x_grok, for token usage information
  • Adds proof-of-life test for all supported production models
  • All API tests tagged live_groq
  • ./scripts/groq_chat.sh lets you interactively test chatting with Groq models

NOTE: I was only able to test this code in isolation - not with anything that required the various keys in test_helper.exs be set.

@brainlid
Copy link
Owner

Groq support was added in #338

@brainlid brainlid closed this Aug 13, 2025
@masegraye
Copy link
Author

@brainlid This was for Groq (https://groq.com/) not Grok (https://x.ai/api). Groq is a managed provider for open models that provides fast inference.

@masegraye
Copy link
Author

masegraye commented Oct 20, 2025

@brainlid previously I was content to use this in my personal fork, but I find myself needing this again in an official capacity for work. Before I work to bring it back up to date with the latest langchain, I should ask: is this something you're likely to accept as a contribution?

@brainlid
Copy link
Owner

Hi @masegraye! Sorry, I didn't catch the service difference.

Yes, I'd accept this as a contribution. I'll reopen it. However, there are a few changes I'd request.

Don't include:

  • scripts/groq_chat.exs
  • scripts/groq_chat.sh

While cool, it's not something any of the other services are doing either.

In test/chat_models/chat_groq_test.exs, there's a test that does this:

      assert get_in(data, [:messages, Access.at(0), "role"]) == :user
      assert get_in(data, [:messages, Access.at(0), "content"]) == user_message
      assert get_in(data, [:messages, Access.at(1), "role"]) == :assistant
      assert get_in(data, [:messages, Access.at(1), "content"]) == assistant_message

I much prefer using pattern matches to assert a data shape because it's easier to look at a test and know what it's doing and testing.

Thanks!

@brainlid brainlid reopened this Oct 20, 2025
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.

2 participants