Class GroqClient

All Implemented Interfaces:
com.tnsai.llm.LLMClient

public class GroqClient extends AbstractOpenAICompatibleClient
Groq LLM client implementation. Provides access to Groq's fast inference API with OpenAI-compatible interface.

Supported models:

  • llama-3.3-70b-versatile - Llama 3.3 70B (recommended)
  • llama-3.1-8b-instant - Llama 3.1 8B (fast)
  • llama-3.2-1b-preview - Llama 3.2 1B (ultrafast)
  • llama-3.2-3b-preview - Llama 3.2 3B
  • mixtral-8x7b-32768 - Mixtral 8x7B
  • gemma2-9b-it - Gemma 2 9B

Configuration via environment variables:

  • GROQ_API_KEY - Required API key for authentication
  • GROQ_BASE_URL - Optional, defaults to https://api.groq.com/openai/v1
See Also:
  • Constructor Details

    • GroqClient

      public GroqClient(String model)
    • GroqClient

      public GroqClient(String model, float temperature)
    • GroqClient

      public GroqClient(String model, float temperature, Integer maxTokens)
    • GroqClient

      public GroqClient(String model, float temperature, Float topP, Integer maxTokens)
    • GroqClient

      public GroqClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey)
    • GroqClient

      public GroqClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey)