Repository: mindsdb/mindsdb
Pull request: Integration of Groq Models with MindsDB
## Description

This PR integrates Groq models into MindsDB to enable faster AI predictions. By leveraging Groq’s high-speed processing, users can obtain quicker results.

Fixes #9796 

## Type of change

(Please delete options that are not relevant)

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ⚡ New feature (non-breaking change which adds functionality)
- [ ] 📢 Breaking change (fix or feature that would cause existing functionality not to work as expected)
- [x] 📄 This change requires a documentation update

## Verification Process

To ensure the changes are working as expected:

 - [ ]   Test Location: Specify the URL or path for testing.
 - [ ]   Verification Steps: Outline the steps or queries needed to validate the change. Include any data, configurations, or actions required to reproduce or see the new functionality.

## Additional Media:

- [x] I have attached a brief loom video or screenshots showcasing the new functionality or change.

![image](https://github.com/user-attachments/assets/03c1a97c-d0ad-49f2-aed7-a1e48b014d98)


## Checklist:

- [x] My code follows the style guidelines(PEP 8) of MindsDB.
- [ ] I have appropriately commented on my code, especially in complex areas.
- [x] Necessary documentation updates are either made or tracked in issues.
- [ ] Relevant unit and integration tests are updated or added.





Problem statement:
[Integration]: Groq LLMs
### Is there an existing integration?

- [X] I have searched the existing integrations.

### Use Case

- Faster AI Predictions: Groq models provide quicker results for database queries using MindsDB.


### Motivation

Users will get faster AI responses and reduced computational costs with Groq models in MindsDB.

### Implementation

Create an AI engine from the Groq handler

```sql
CREATE ML_ENGINE groq_engine
FROM groq
USING
      groq_api_key = 'api-key-value';
```

Create a model

```sql
CREATE MODEL groq_model
PREDICT target_column
USING
      engine = 'groq_engine',  -- engine name as created via CREATE ML_ENGINE
      model_name = 'groq_model_name',  -- optional
      question_column = 'question',  -- optional, column name that stores user input
      context_column = 'context',  -- optional, column that stores context of the user input
      prompt_template = 'input message to the model here', -- optional, user provides instructions to the model here
      user_column = 'user_input', -- optional, stores user input
      prompt = 'instruction to the model', -- optional stores instruction to the model
      max_tokens = 100, -- optional, token limit for answer
      temperature = 0.3, -- temp
```

### Anything else?

By integrating Groq, users can access AI-powered queries like OpenAI, but with Groq's speed and efficiency advantages.

Hints from issue discussion:
I would like to work on this

Commit message: Merge branch 'main' into feat/groq-handler

Patch to review:
diff --git a/mindsdb/integrations/handlers/groq_handler/README.md b/mindsdb/integrations/handlers/groq_handler/README.md
new file mode 100644
index 00000000000..d1004e58b34
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/README.md
@@ -0,0 +1,108 @@
+---
+title: Groq
+sidebarTitle: Groq
+---
+
+This documentation describes the integration of MindsDB with [Groq](https://groq.com/), a cloud service that simplifies the way developers interact with cutting-edge LLMs through its API.
+
+## Prerequisites
+
+Before proceeding, ensure the following prerequisites are met:
+
+1. Install MindsDB locally via [Docker](https://docs.mindsdb.com/setup/self-hosted/docker) or [Docker Desktop](https://docs.mindsdb.com/setup/self-hosted/docker-desktop).
+2. To use Groq within MindsDB, install the required dependencies following [this instruction](https://docs.mindsdb.com/setup/self-hosted/docker#install-dependencies).
+3. Obtain the Groq API key required to deploy and use Groq models within MindsDB. Get the API key from [here](https://console.groq.com/keys).
+
+## Setup
+
+Create an AI engine from the [Groq handler](https://github.com/mindsdb/mindsdb/tree/main/mindsdb/integrations/handlers/groq_handler).
+
+```sql
+CREATE ML_ENGINE groq_engine
+FROM groq
+USING
+      groq_api_key = 'api-key-value'
+```
+
+Create a model using `groq_engine` as an engine.
+
+```sql
+CREATE MODEL groq_model
+PREDICT answer
+USING
+      engine = 'groq_engine',   -- engine name as created via CREATE ML_ENGINE
+      model_name = 'model-name',              -- choose one of available models
+      prompt_template = 'prompt-to-the-model' -- prompt message to be completed by the model
+```
+
+## Usage
+
+The following usage examples utilize `groq_engine` to create a model with the `CREATE MODEL` statement.
+
+Classify text sentiment using the Mistral 7B model.
+
+```sql
+CREATE MODEL groq_model
+PREDICT sentiment
+USING
+   engine = 'groq_engine',
+   model_name = 'llama3-8b-8192',
+   prompt_template = 'Classify the sentiment of the following text as one of `positive`, `neutral` or `negative`: {{text}}. Give sentiment as result only.';
+```
+
+Query the model to get predictions.
+
+```sql
+SELECT text, sentiment
+FROM groq_model
+WHERE text = 'I love machine learning!';
+```
+
+Here is the output:
+
+```sql
++--------------------------+-----------+
+| text                     | sentiment |
++--------------------------+-----------+
+| I love machine learning! | positive  |
++--------------------------+-----------+
+```
+
+## Supported Models
+
+For an overview of the models supported, visit the [following docs](https://console.groq.com/docs/models). This list will help you quickly identify the right models for your needs.
+
+## Troubleshooting Guide
+
+<Warning>
+`SQL statement cannot be parsed by mindsdb_sql`
+
+* **Symptoms**: SQL queries failing or not recognizing table names containing spaces or special characters.
+* **Checklist**:
+    1. Ensure table names with spaces or special characters are enclosed in backticks.
+    Examples:
+        * Incorrect:
+
+            ```sql
+            SELECT input.text, output.sentiment
+            FROM integration.travel data AS input
+            JOIN groq_model AS output
+            ```
+
+        * Incorrect:
+
+            ```sql
+            SELECT input.text, output.sentiment
+            FROM integration.'travel data' AS input
+            JOIN groq_model AS output
+            ```
+
+        * Correct:  
+
+            ```sql
+            SELECT input.text, output.sentiment
+            FROM integration.`travel data` AS input
+            JOIN groq_model AS output
+            ```
+
+</Warning>
diff --git a/mindsdb/integrations/handlers/groq_handler/__about__.py b/mindsdb/integrations/handlers/groq_handler/__about__.py
new file mode 100644
index 00000000000..c0961ab5b17
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/__about__.py
@@ -0,0 +1,9 @@
+__title__ = 'MindsDB Groq handler'
+__package_name__ = 'mindsdb_groq_handler'
+__version__ = '0.0.1'
+__description__ = "MindsDB handler for Groq"
+__author__ = 'MindsDB Inc'
+__github__ = 'https://github.com/mindsdb/mindsdb'
+__pypi__ = 'https://pypi.org/project/mindsdb/'
+__license__ = 'MIT'
+__copyright__ = 'Copyright 2022- mindsdb'
\ No newline at end of file
diff --git a/mindsdb/integrations/handlers/groq_handler/__init__.py b/mindsdb/integrations/handlers/groq_handler/__init__.py
new file mode 100644
index 00000000000..d20421c6ba9
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/__init__.py
@@ -0,0 +1,23 @@
+from mindsdb.integrations.libs.const import HANDLER_TYPE
+from mindsdb.utilities import log
+
+logger = log.getLogger(__name__)
+
+from .__about__ import __description__ as description
+from .__about__ import __version__ as version
+
+try:
+    from .groq_handler import GroqHandler as Handler
+
+    import_error = None
+except Exception as e:
+    Handler = None
+    import_error = e
+
+title = "Groq"
+name = "groq"
+type = HANDLER_TYPE.ML
+icon_path = 'icon.svg'
+permanent = False
+
+__all__ = ["Handler", "version", "name", "type", "title", "description", "import_error", "icon_path"]
\ No newline at end of file
diff --git a/mindsdb/integrations/handlers/groq_handler/groq_handler.py b/mindsdb/integrations/handlers/groq_handler/groq_handler.py
new file mode 100644
index 00000000000..7dbcd88f42b
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/groq_handler.py
@@ -0,0 +1,132 @@
+import os
+import pandas as pd
+import openai
+from openai import OpenAI, NotFoundError, AuthenticationError
+from typing import Dict, Optional
+from mindsdb.integrations.handlers.openai_handler import Handler as OpenAIHandler
+from mindsdb.integrations.utilities.handler_utils import get_api_key
+from mindsdb.integrations.handlers.groq_handler.settings import groq_handler_config
+from mindsdb.utilities import log
+
+logger = log.getLogger(__name__)
+
+
+class GroqHandler(OpenAIHandler):
+    """
+    This handler handles connection to the Groq.
+    """
+
+    name = 'groq'
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.api_base = groq_handler_config.BASE_URL
+        self.default_model = 'llama3-8b-8192'
+        self.default_mode = 'default'
+
+    @staticmethod
+    def _check_client_connection(client: OpenAI):
+        """
+        Check the Groq engine client connection by listing models.
+
+        Args:
+            client (OpenAI): OpenAI client configured with the Groq API credentials.
+
+        Raises:
+            Exception: If the client connection (API key) is invalid.
+
+        Returns:
+            None
+        """
+        try:
+            client.models.list()
+        except NotFoundError:
+            pass
+        except AuthenticationError as e:
+            if e.body['code'] == 401:
+                raise Exception('Invalid api key')
+            raise Exception(f'Something went wrong: {e}')
+
+    def create_engine(self, connection_args):
+        """
+        Validate the Groq API credentials on engine creation.
+
+        Args:
+            connection_args (dict): Connection arguments.
+
+        Raises:
+            Exception: If the handler is not configured with valid API credentials.
+
+        Returns:
+            None
+        """
+        connection_args = {k.lower(): v for k, v in connection_args.items()}
+        api_key = connection_args.get('groq_api_key')
+        if api_key is not None:
+            org = connection_args.get('api_organization')
+            api_base = connection_args.get('api_base') or os.environ.get('groq_BASE', groq_handler_config.BASE_URL)
+            client = self._get_client(api_key=api_key, base_url=api_base, org=org)
+            GroqHandler._check_client_connection(client)
+
+    @staticmethod
+    def create_validation(target, args=None, **kwargs):
+        """
+        Validate the Groq API credentials on model creation.
+
+        Args:
+            target (str): Target column, not required for LLMs.
+            args (dict): Handler arguments.
+            kwargs (dict): Handler keyword arguments.
+
+        Raises:
+            Exception: If the handler is not configured with valid API credentials.
+
+        Returns:
+            None
+        """
+        if 'using' not in args:
+            raise Exception(
+                "Groq engine requires a USING clause! Refer to its documentation for more details."
+            )
+        else:
+            args = args['using']
+
+        engine_storage = kwargs['handler_storage']
+        connection_args = engine_storage.get_connection_args()
+        api_key = get_api_key('groq', args, engine_storage=engine_storage)
+        api_base = connection_args.get('api_base') or args.get('api_base') or os.environ.get('GROQ_BASE', groq_handler_config.BASE_URL)
+        org = args.get('api_organization')
+        client = OpenAIHandler._get_client(api_key=api_key, base_url=api_base, org=org)
+        GroqHandler._check_client_connection(client)
+
+    def predict(self, df: pd.DataFrame, args: Optional[Dict] = None) -> pd.DataFrame:
+        """
+        Call the Groq engine to predict the next token.
+
+        Args:
+            df (pd.DataFrame): Input data.
+            args (dict): Handler arguments.
+
+        Returns:
+            pd.DataFrame: Predicted data
+        """
+        api_key = get_api_key('groq', args, self.engine_storage)
+        supported_models = self._get_supported_models(api_key, self.api_base)
+        self.chat_completion_models = [model.id for model in supported_models]
+        return super().predict(df, args)
+
+    @staticmethod
+    def _get_supported_models(api_key, base_url, org=None):
+        """
+        Get the list of supported models for the Groq engine.
+
+        Args:
+            api_key (str): API key.
+            base_url (str): Base URL.
+            org (str): Organization name.
+
+        Returns:
+            List: List of supported models.
+        """
+        client = openai.OpenAI(api_key=api_key, base_url=base_url, organization=org)
+        return client.models.list()
diff --git a/mindsdb/integrations/handlers/groq_handler/icon.svg b/mindsdb/integrations/handlers/groq_handler/icon.svg
new file mode 100644
index 00000000000..df8814f2988
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/icon.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 28.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 1000 341.5" style="enable-background:new 0 0 1000 341.5;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#FFFFFF;}
+</style>
+<path class="st0" d="M556,7.1c-62.1,0-112.4,50.3-112.4,112.4S493.9,232,556,232s112.4-50.3,112.4-112.4c0,0,0,0,0,0
+	C668.3,57.5,618,7.2,556,7.1z M556,189.8c-38.8,0-70.3-31.5-70.3-70.3c0-38.8,31.5-70.3,70.3-70.3c38.8,0,70.3,31.5,70.3,70.3
+	C626.2,158.3,594.7,189.8,556,189.8L556,189.8z"/>
+<path class="st0" d="M131.6,6.5C69.5,6,18.7,55.8,18.1,117.9C17.5,180,67.4,230.8,129.5,231.4c0.7,0,1.4,0,2.1,0h37v-42.1h-37
+	c-38.8,0.5-70.6-30.6-71.1-69.4s30.6-70.6,69.4-71.1c0.5,0,1.1,0,1.6,0c38.7,0,70.4,31.5,70.4,70.3l0,0v103.5l0,0
+	c0,38.5-31.3,69.8-69.7,70.3c-18.4-0.2-35.9-7.5-48.9-20.6L53.5,302c20.7,20.8,48.7,32.6,78,32.9l0,0h1.5l0,0
+	c61.3-0.9,110.6-50.6,110.9-111.9V116.2C242.4,55.2,192.5,6.6,131.6,6.5z"/>
+<path class="st0" d="M918.6,330.1V116.8c-1.5-61-51.4-109.6-112.4-109.7c-62.1-0.6-112.9,49.3-113.5,111.4S742.1,231.4,804.2,232
+	c0.7,0,1.4,0,2.1,0h37v-42.1h-37c-38.8,0.5-70.6-30.6-71.1-69.4s30.6-70.6,69.4-71.1c0.5,0,1.1,0,1.6,0c38.7,0,70.4,31.5,70.4,70.3
+	l0,0v210.1l0,0L918.6,330.1z"/>
+<path class="st0" d="M276.1,232h42V119.6c0-38.8,31.5-70.3,70.3-70.3c12.8,0,24.7,3.4,35.1,9.4l21.1-36.5c-16.5-9.5-35.7-15-56.1-15
+	c-62.1,0-112.4,50.3-112.4,112.4L276.1,232z"/>
+<g>
+	<path class="st0" d="M950.3,10c3.2,1.8,5.7,4.3,7.5,7.5c1.8,3.2,2.7,6.7,2.7,10.6c0,3.9-0.9,7.4-2.8,10.7c-1.9,3.2-4.4,5.8-7.6,7.6
+		c-3.2,1.9-6.8,2.8-10.6,2.8s-7.4-0.9-10.6-2.8c-3.2-1.9-5.7-4.4-7.5-7.6c-1.8-3.2-2.8-6.7-2.8-10.6c0-3.8,0.9-7.4,2.8-10.6
+		c1.8-3.2,4.4-5.7,7.6-7.6s6.8-2.8,10.7-2.8C943.6,7.2,947.1,8.1,950.3,10z M948.2,43c2.6-1.5,4.6-3.6,6.1-6.2
+		c1.5-2.6,2.2-5.5,2.2-8.7c0-3.2-0.7-6.1-2.2-8.7s-3.5-4.6-6-6.1c-2.6-1.5-5.5-2.2-8.7-2.2c-3.2,0-6.1,0.8-8.7,2.3
+		c-2.6,1.5-4.6,3.6-6.1,6.2c-1.5,2.6-2.2,5.5-2.2,8.7c0,3.2,0.7,6.1,2.2,8.7c1.5,2.6,3.5,4.7,6,6.2c2.6,1.5,5.4,2.3,8.6,2.3
+		C942.7,45.3,945.6,44.5,948.2,43z M949.5,29.2c-0.7,1.2-1.8,2.1-3.2,2.8l5,7.7h-6.2l-4.3-6.7h-0.2h-3.9v6.7h-6.2v-23h10
+		c3.1,0,5.6,0.7,7.4,2.2c1.8,1.5,2.7,3.5,2.7,6C950.6,26.5,950.2,28,949.5,29.2z M940.1,28.4c1.4,0,2.5-0.3,3.2-0.9
+		c0.8-0.6,1.2-1.5,1.2-2.6c0-1.1-0.4-2-1.2-2.7s-1.9-0.9-3.2-0.9h-3.5v7.2H940.1z"/>
+</g>
+</svg>
diff --git a/mindsdb/integrations/handlers/groq_handler/requirements.txt b/mindsdb/integrations/handlers/groq_handler/requirements.txt
new file mode 100644
index 00000000000..55108dc7877
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/requirements.txt
@@ -0,0 +1,2 @@
+pydantic-settings >= 2.1.0
+-r mindsdb/integrations/handlers/openai_handler/requirements.txt
diff --git a/mindsdb/integrations/handlers/groq_handler/settings.py b/mindsdb/integrations/handlers/groq_handler/settings.py
new file mode 100644
index 00000000000..ef929f2424c
--- /dev/null
+++ b/mindsdb/integrations/handlers/groq_handler/settings.py
@@ -0,0 +1,18 @@
+from pydantic_settings import BaseSettings
+
+
+class GroqHandlerConfig(BaseSettings):
+    """
+    Configuration for Groq handler.
+
+    Attributes
+    ----------
+
+    BASE_URL : str
+        Base URL for the Groq API.
+    """
+
+    BASE_URL: str = "https://api.groq.com/openai/v1"
+
+
+groq_handler_config = GroqHandlerConfig()


Code review comments:
diff_hunk: @@ -0,0 +1,132 @@
+import os
+import pandas as pd
+import openai
+from openai import OpenAI, NotFoundError, AuthenticationError
+from typing import Dict, Optional
+from mindsdb.integrations.handlers.openai_handler import Handler as OpenAIHandler
+from mindsdb.integrations.utilities.handler_utils import get_api_key
+from mindsdb.integrations.handlers.groq_handler.settings import groq_handler_config
+from mindsdb.utilities import log
+
+logger = log.getLogger(__name__)
+
+
+class GroqHandler(OpenAIHandler):
+    """
+    This handler handles connection to the Groq.
+    """
+
+    name = 'groq'
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.api_base = groq_handler_config.BASE_URL
+        self.default_model = 'llama3-8b-8192'
+        self.default_mode = 'default'
path: mindsdb/integrations/handlers/groq_handler/groq_handler.py
text: @user1:
I think we can move these defaults over to the config.

@author:
```py
class GroqHandlerConfig(BaseSettings):
    """
    Configuration for Groq handler.

    Attributes
    ----------

    BASE_URL : str
        Base URL for the Groq API.
    """

    BASE_URL: str = "https://api.groq.com/openai/v1"
    DEFAULT_MODEL: str = "llama3-8b-8192"
    DEFAULT_MODE: str = "default"
```
Like this

@user1:
Yes, exactly. We can use the config to set the above instance variables.

diff_hunk: @@ -0,0 +1,108 @@
+---
+title: Groq
+sidebarTitle: Groq
+---
+
+This documentation describes the integration of MindsDB with [Groq](https://groq.com/), a cloud service that simplifies the way developers interact with cutting-edge LLMs through its API.
+
+## Prerequisites
+
+Before proceeding, ensure the following prerequisites are met:
+
+1. Install MindsDB locally via [Docker](https://docs.mindsdb.com/setup/self-hosted/docker) or [Docker Desktop](https://docs.mindsdb.com/setup/self-hosted/docker-desktop).
+2. To use Groq within MindsDB, install the required dependencies following [this instruction](https://docs.mindsdb.com/setup/self-hosted/docker#install-dependencies).
+3. Obtain the Groq API key required to deploy and use Groq models within MindsDB. Get the API key from [here](https://console.groq.com/keys).
+
+## Setup
+
+Create an AI engine from the [Groq handler](https://github.com/mindsdb/mindsdb/tree/main/mindsdb/integrations/handlers/groq_handler).
+
+```sql
+CREATE ML_ENGINE groq_engine
+FROM groq
+USING
+      groq_api_key = 'api-key-value'
+```
+
+Create a model using `groq_engine` as an engine.
+
+```sql
+CREATE MODEL groq_model
+PREDICT answer
+USING
+      engine = 'groq_engine',   -- engine name as created via CREATE ML_ENGINE
+      model_name = 'model-name',              -- choose one of available models
+      prompt_template = 'prompt-to-the-model' -- prompt message to be completed by the model
+```
+
+## Usage
+
+The following usage examples utilize `groq_engine` to create a model with the `CREATE MODEL` statement.
+
path: mindsdb/integrations/handlers/groq_handler/README.md
text: @user1:
Speaking of the supported parameters, does Groq also support the generation of images and embeddings? The OpenAI integration supports an `image` and `embedding` mode. If Groq does not support this, we might need to take some precautions. The configuration settings for the OpenAI integration are maintained [here](https://github.com/mindsdb/mindsdb/blob/main/mindsdb/integrations/handlers/openai_handler/constants.py) and then set as instance variables in the handler. Can you please have a look and make the necessary changes?

@author:
There are no embedding and image models in Groq.

@author:
So I need to override these instance variables like 
- supported_modes 
- chat_completion_models 


@user1:
OK, then I think setting `self.supported_modes` in your handler to `['default', 'conversational', 'conversational-full']` should do the trick to prevent users from using these modes. Please test this once you make the changes.

@user1:
I think you have already overridden `chat_completion_models`, so you should be fine there.

@author:
I am thinking of doing like this

<details>
<summary>Groq Handler Config</summary>

```py
class GroqHandlerConfig(BaseSettings):
    """
    Configuration for Groq handler.

    Attributes
    ----------

    BASE_URL : str
        Base URL for the Groq API.
    """

    BASE_URL: str = "https://api.groq.com/openai/v1"
    DEFAULT_MODEL: str = "llama3-8b-8192"
    DEFAULT_MODE: str = "default"
    SUPPORTED_MODES: list[str] = [
        'default',
        'conversational',
        'conversational-full',
    ]
    CHAT_MODELS: tuple[str] = (
        'gemma2-9b-it',
        'gemma-7b-it',
        'llama3-groq-70b-8192-tool-use-preview',
        'llama3-groq-8b-8192-tool-use-preview',
        'llama-3.1-70b-versatile',
        'llama-3.1-8b-instant',
        'llama-3.2-1b-preview',
        'llama-3.2-3b-preview',
        'llama-3.2-11b-vision-preview',
        'llama-3.2-90b-vision-preview',
        'llama-guard-3-8b',
        'llama3-70b-8192',
        'llama3-8b-8192',
        'mixtral-8x7b-32768'
    )
```

</details>

<details>
<summary>Groq Handler `__init__` function</summary>

```py
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.api_base = groq_handler_config.BASE_URL
        self.default_model = groq_handler_config.DEFAULT_MODEL
        self.default_mode = groq_handler_config.DEFAULT_MODE
        self.supported_modes = groq_handler_config.SUPPORTED_MODES
        self.chat_completion_models = groq_handler_config.CHAT_MODELS
```

</details>

@user1:
Hmm.. I think it is better to retrieve the chat_completion_models via an API call as you have done already. This is in case it changes in the future. Everything else looks good.

diff_hunk: @@ -0,0 +1,108 @@
+---
+title: Groq
+sidebarTitle: Groq
+---
+
+This documentation describes the integration of MindsDB with [Groq](https://groq.com/), a cloud service that simplifies the way developers interact with cutting-edge LLMs through its API.
+
+## Prerequisites
+
+Before proceeding, ensure the following prerequisites are met:
+
+1. Install MindsDB locally via [Docker](https://docs.mindsdb.com/setup/self-hosted/docker) or [Docker Desktop](https://docs.mindsdb.com/setup/self-hosted/docker-desktop).
+2. To use Groq within MindsDB, install the required dependencies following [this instruction](https://docs.mindsdb.com/setup/self-hosted/docker#install-dependencies).
+3. Obtain the Groq API key required to deploy and use Groq models within MindsDB. Get the API key from [here](https://console.groq.com/keys).
+
+## Setup
+
+Create an AI engine from the [Groq handler](https://github.com/mindsdb/mindsdb/tree/main/mindsdb/integrations/handlers/groq_handler).
+
+```sql
+CREATE ML_ENGINE groq_engine
+FROM groq
+USING
+      groq_api_key = 'api-key-value'
+```
+
+Create a model using `groq_engine` as an engine.
+
+```sql
+CREATE MODEL groq_model
+PREDICT answer
+USING
+      engine = 'groq_engine',   -- engine name as created via CREATE ML_ENGINE
+      model_name = 'model-name',              -- choose one of available models
+      prompt_template = 'prompt-to-the-model' -- prompt message to be completed by the model
+```
+
+## Usage
+
+The following usage examples utilize `groq_engine` to create a model with the `CREATE MODEL` statement.
path: mindsdb/integrations/handlers/groq_handler/README.md
text: @user1:
Since this is inheriting from the OpenAI integration, I believe that all of the parameters that are supported by the OpenAI integration are supported here as well?
Can we please list them here? You can use the [README](https://github.com/mindsdb/mindsdb/blob/main/mindsdb/integrations/handlers/openai_handler/README.md) of the OpenAI integration as a reference.

@author:
Should I edit that USAGE part to
```sql
CREATE MODEL groq_model
PREDICT answer
USING
      engine = 'groq_engine',   -- engine name as created via CREATE ML_ENGINE
      model_name = 'model-name',              -- choose one of available models
      prompt_template = 'prompt-to-the-model' -- prompt message to be completed by the model
      question_column = 'question',  -- optional, column name that stores user input
      context_column = 'context',  -- optional, column that stores context of the user input
      prompt_template = 'input your query here', -- optional, user provides instructions to the model here
      user_column = 'user_input', -- optional, stores user input
      assistant_column = 'conversation_context', -- optional, stores conversation context
      prompt = 'instruction to the model', -- optional stores instruction to the model
      max_tokens = 100, -- optional, token limit for answer
      temperature = 0.3, -- temp
```

@user1:
Yep, looks good.