Skip to content

Commit 6a534fa

Browse files
authored
Add GroqCloud integration documentation (#8)
* Add GroqCloud integration documentation * update cli download urls
1 parent b4d87f7 commit 6a534fa

6 files changed

Lines changed: 147 additions & 4 deletions

File tree

src/assets/docs/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ The MaIN CLI (`mcli`) is your companion tool for managing AI workflows and servi
1414
> - Set execution policies
1515
> - Create uninstaller
1616
17-
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1tAAAAAAABD0eIFVX7HhjwDubuEr1T9w?e=m0daA8)
17+
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1tAAAAAAABD0eIFVX7HhjwDubuEr1T9w?e=63TNH0)
1818

1919
```bash
2020
.\install-mcli.ps1
2121
```
2222

2323
### (Linux/Mac)
24-
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1zAAAAAAABMMmdRp0OgzMEwBFB4Gftvg?e=ilXsHh)
24+
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1zAAAAAAABMMmdRp0OgzMEwBFB4Gftvg?e=vz96CR)
2525
> - You might need some sudo permissions to set default model path or run api scripts
2626
2727
```bash

src/assets/docs/docs-index.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@
154154
"path": "examples/example-chat-reasoning-deepseek"
155155
}
156156
]
157+
},
158+
{
159+
"title": "GroqCloud Integration",
160+
"children": [
161+
{
162+
"title": "Basic chat",
163+
"path": "examples/example-chat-basic-groqcloud"
164+
}
165+
]
157166
}
158167
]
159168
},
@@ -205,6 +214,10 @@
205214
{
206215
"title": "DeepSeek",
207216
"path": "integrations/deepseek"
217+
},
218+
{
219+
"title": "GroqCloud",
220+
"path": "integrations/groqcloud"
208221
}
209222
]
210223
}

src/assets/docs/examples/example-chat-basic-gemini.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ public async Task Start()
2525
4. **Send a message**`.WithMessage("Is the killer whale the smartest animal?")`
2626
5. **Run the chat**`.CompleteAsync(interactive: true);`
2727

28-
This example demonstrates how effortlessly Gemini's Gemini's 2.0-flash model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration.
28+
This example demonstrates how effortlessly Gemini's 2.0-flash model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 💬 GroqCloud Chat Example
2+
3+
The **GroqCloudChatExample** demonstrates how to integrate GroqCloud's LLaMA 3 model into the framework with minimal setup, showcasing its performance and simplicity for interactive chat.
4+
5+
### 📝 Code Example
6+
7+
```csharp
8+
public async Task Start()
9+
{
10+
GroqCloudExample.Setup(); //We need to provide GroqCloud API key
11+
Console.WriteLine("(GroqCloud) ChatExample is running!");
12+
13+
await AIHub.Chat()
14+
.WithModel("llama3-8b-8192")
15+
.WithMessage("Which color do people like the most?")
16+
.CompleteAsync(interactive: true);
17+
}
18+
```
19+
20+
## 🔹 How It Works
21+
1. **Set up GroqCloud API**`GroqCloudExample.Setup()` (API key is required)
22+
2. **Initialize a chat session**`AIHub.Chat()`
23+
3. **Choose a model**`.WithModel("llama3-8b-8192")`
24+
4. **Send a message**`.WithMessage("Which color do people like the most?")`
25+
5. **Run the chat**`.CompleteAsync(interactive: true);`
26+
27+
This example demonstrates how effortlessly GroqCloud's LLAMA 3 model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration.

src/assets/docs/integrations/deepseek.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Once you configure DeepSeek as the backend, **everything in the MaIN framework w
7979

8080
- **No additional configuration is required** to use DeepSeek with any MaIN-based feature.
8181
- Whether you're interacting with chat models, agents, or external data sources, the behavior remains consistent.
82-
- The integration allows MaIN to work seamlessly with Gemini, enabling you to use the full power of the framework without worrying about backend-specific configurations.
82+
- The integration allows MaIN to work seamlessly with DeepSeek, enabling you to use the full power of the framework without worrying about backend-specific configurations.
8383

8484
---
8585

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# 🧠 GroqCloud Integration with MaIN Framework
2+
3+
This documentation provides a quick guide for integrating GroqCloud into your MaIN-based application. The integration process is simple and ensures that everything in the MaIN framework works seamlessly with GroqCloud as the backend, without requiring any additional modifications to existing functionality.
4+
5+
## 🚀 Quick Start
6+
7+
Integrating GroqCloud with MaIN requires minimal configuration. All you need to do is specify your GroqCloud API key and set the backend type to GroqCloud. Once this is done, you can use the full functionality of the MaIN framework, and everything will work as expected, without the need for further adjustments.
8+
9+
### 📝 Code Example
10+
11+
#### Using `appsettings.json`
12+
13+
To configure GroqCloud in your `appsettings.json`, add the following section:
14+
15+
```json
16+
{
17+
"MaIN": {
18+
"BackendType": "GroqCloud",
19+
"GroqCloudKey": "<YOUR_GROQ_KEY>"
20+
}
21+
}
22+
```
23+
24+
#### Simple Console Initialization
25+
26+
Alternatively, you can set the backend type and GroqCloud key programmatically during initialization using `MaINBootstrapper.Initialize`:
27+
28+
```csharp
29+
MaINBootstrapper.Initialize(configureSettings: (options) =>
30+
{
31+
options.BackendType = BackendType.GroqCloud;
32+
options.GroqCloudKey = "<YOUR_GROQ_KEY>";
33+
});
34+
```
35+
36+
#### Using ServiceBuilder for API-based Use Cases
37+
38+
If you're setting up MaIN in an API or web-based application (e.g., ASP.NET Core), you can configure it using `ServiceBuilder`:
39+
40+
```csharp
41+
services.AddMaIN(configuration, (options) =>
42+
{
43+
options.BackendType = BackendType.GroqCloud;
44+
options.GroqCloudKey = "<YOUR_GROQ_KEY>";
45+
});
46+
```
47+
48+
### 📦 Using Environment Variables
49+
50+
If you prefer not to store your GroqCloud key in your `appsettings.json` or directly in the code, you can set it using an environment variable. This will automatically be detected by the MaIN framework.
51+
52+
For example, you can set the `GROQ_API_KEY` environment variable in different platforms:
53+
54+
- **On Windows (Command Prompt):**
55+
56+
```bash
57+
set GROQ_API_KEY=<YOUR_GROQ_KEY>
58+
```
59+
60+
- **On Windows (PowerShell):**
61+
62+
```bash
63+
$env:GROQ_API_KEY="<YOUR_GROQ_KEY>"
64+
```
65+
66+
- **On macOS/Linux:**
67+
68+
```bash
69+
export GROQ_API_KEY=<YOUR_GROQ_KEY>
70+
```
71+
72+
This way, you can securely store your API key in the environment without the need for hardcoding it.
73+
74+
---
75+
76+
## 🔹 What’s Included with GroqCloud Integration
77+
78+
Once you configure GroqCloud as the backend, **everything in the MaIN framework works the same way**. This includes all the core functionality such as chat, agents, and data retrieval tasks, which continue to operate without needing any special changes to the logic or structure.
79+
80+
- **No additional configuration is required** to use GroqCloud with any MaIN-based feature.
81+
- Whether you're interacting with chat models, agents, or external data sources, the behavior remains consistent.
82+
- The integration allows MaIN to work seamlessly with GroqCloud, enabling you to use the full power of the framework without worrying about backend-specific configurations.
83+
84+
---
85+
86+
## ⚠️ Important Considerations
87+
88+
When using GroqCloud models with the MaIN framework, please note these current limitations:
89+
90+
- Image Generation: GroqCloud models do not support direct image generation. Using features that rely on generating images will throw a `NotSupportedException`.
91+
- Embeddings: GroqCloud models do not support generating embeddings (e.g., for file processing that requires text vectorization). Any MaIN functionality dependent on embeddings will result in a `NotSupportedException`.
92+
93+
Please ensure your application's design accounts for these limitations to prevent errors. If these functionalities are crucial for your application, you might want to consider using a different backend, such as OpenAI or Gemini.
94+
95+
---
96+
97+
## 🔧 Features
98+
99+
- **Simple Setup**: All you need to do is specify your GroqCloud key and set the backend type to GroqCloud, either via `appsettings.json`, environment variables, or programmatically.
100+
- **Environment Variable Support**: Supports storing your GroqCloud key securely as an environment variable, making it easy to configure on different platforms.
101+
- **Seamless Operation**: Once GroqCloud is configured, everything within the MaIN framework works identically with GroqCloud, with no need for adjustments or special handling for different tasks.
102+
103+
This integration ensures that your application remains flexible and easy to manage, allowing you to focus on using the features of MaIN while leveraging GroqCloud powerful capabilities.

0 commit comments

Comments
 (0)