Groq-Unity is an open-source Unity integration for Groq's AI APIs.
🚀 Built on top of jgravelle/GroqApiLibrary, fully adapted for Unity with samples and MonoBehaviour support.
- ✅ Chat Completion with Mixtral / LLaMA models
- 🎙️ Speech Synthesis (TTS) using
playai-ttsvoices - 🧾 Transcription using
whisper-large-v3 - 🧮 Function Calling & Tool Use from within Unity
- 🔊 Built-in audio player for TTS & transcription demos
- 🔧 Simple MonoBehaviour components for easy use in scenes
- Unity 6+(tested)
- A valid Groq API Key
- Clone or download this repository
- (Optional) If you want are integrating these scripts into your project, install NuGet for Unity and the packages: "System.Net.Http.Json"
- Add your Groq API Key in the relevant script or config field
- Open the sample scene, enable one of the 5 sample gameobjects, hit play.
- For TTS sample, go to https://console.groq.com/playground?model=playai-tts and accept the terms.
| Feature | Scene / Script | Description |
|---|---|---|
| 🔡 Chat | GroqChat.cs |
Simple text prompt and response using Mixtral |
| 🗣️ TTS | GroqTTS.cs |
Uses playai-tts to generate speech from text and play it |
| 🎧 Transcription | WhisperTranscriber.cs |
Record mic input and transcribe with whisper-large-v3 |
| 🧰 Tool Calling | GroqToolSample.cs |
Run a tool (e.g. spawn colored cubes) via structured function call |
| 🎛️ Voice Enum | GroqTTS.cs |
Enum of all available voices for TTS selection in the Editor |