Skip to content
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

Add Groq inference provider #527

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bklieger-groq
Copy link

What does this PR do?

This PR adds a Groq inference provider that allows integration with Groq's AI inference offerings for Llama models. Groq has an OpenAI-compatible endpoint.

Added support for Chat Completions with:

  1. Llama 3.0 8b & 70b
  2. Llama 3.1 8b & 70b
  3. Llama 3.2 1b, 3b, 11b, and 90b.

The integration includes support for streaming, JSON mode, and tool calling.


Missing support:

  1. Completions (non-Chat completions)
  2. Top_k and repetition_penalty
  3. Embeddings

Test Plan

Groq has been added to the existing test plan. You can run it with the following command:

GROQ_API_KEY=<api-key> pytest -s -v --providers inference=groq llama_stack/providers/tests/inference/test_text_inference.py

You can get a Groq API key for free here: https://console.groq.com/keys

10 tests pass, 6 are skipped, none fail.

Sources

Documentation: https://console.groq.com/docs/overview
API Reference: https://console.groq.com/docs/api-reference#chat-create

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Ran pre-commit to handle lint / formatting issues.
  • [*] Read the contributor guideline,
    Pull Request section?
  • Updated relevant documentation.
  • [*] Wrote necessary unit or integration tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants