@elizaos/plugin-groq 2.0.0-alpha.8 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/auto-enable.ts +17 -0
- package/dist/browser/index.browser.js +376 -164
- package/dist/browser/index.browser.js.map +5 -4
- package/dist/cjs/index.node.cjs +382 -170
- package/dist/cjs/index.node.js.map +5 -4
- package/dist/node/index.node.js +376 -164
- package/dist/node/index.node.js.map +5 -4
- package/package.json +32 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @elizaos/plugin-groq
|
|
2
|
+
|
|
3
|
+
Groq LLM plugin for elizaOS - Fast inference with GPT-OSS models.
|
|
4
|
+
|
|
5
|
+
This plugin provides Groq API integration for elizaOS agents, enabling ultra-fast text generation, audio transcription, and text-to-speech synthesis.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 🚀 **Fast Inference** - Leverage Groq's LPU for industry-leading inference speeds
|
|
10
|
+
- 📝 **Text Generation** - Generate text with GPT-OSS models
|
|
11
|
+
- 🎤 **Audio Transcription** - Transcribe audio with Whisper models
|
|
12
|
+
- 🔊 **Text-to-Speech** - Generate speech with PlayAI voices
|
|
13
|
+
- 🔢 **Object Generation** - Generate structured JSON objects
|
|
14
|
+
- 🎯 **Tokenization** - Tokenize and detokenize text
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
### TypeScript/JavaScript (npm)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @elizaos/plugin-groq
|
|
22
|
+
# or
|
|
23
|
+
bun add @elizaos/plugin-groq
|
|
24
|
+
```
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### TypeScript
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { groqPlugin } from "@elizaos/plugin-groq";
|
|
31
|
+
|
|
32
|
+
// Add to your agent's plugins
|
|
33
|
+
const agent = new Agent({
|
|
34
|
+
plugins: [groqPlugin],
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
Set the following environment variables:
|
|
40
|
+
|
|
41
|
+
| Variable | Required | Default | Description |
|
|
42
|
+
| ------------------ | -------- | -------------------------------- | --------------------- |
|
|
43
|
+
| `GROQ_API_KEY` | Yes | - | Your Groq API key |
|
|
44
|
+
| `GROQ_BASE_URL` | No | `https://api.groq.com/openai/v1` | Custom API base URL |
|
|
45
|
+
| `GROQ_SMALL_MODEL` | No | `openai/gpt-oss-120b` | Model for small tasks |
|
|
46
|
+
| `GROQ_LARGE_MODEL` | No | `openai/gpt-oss-120b` | Model for large tasks |
|
|
47
|
+
| `GROQ_TTS_MODEL` | No | `canopylabs/orpheus-v1-english` | Text-to-speech model |
|
|
48
|
+
| `GROQ_TTS_VOICE` | No | `troy` | TTS voice name |
|
|
49
|
+
| `GROQ_TTS_RESPONSE_FORMAT` | No | `wav` | TTS response format |
|
|
50
|
+
|
|
51
|
+
## Model Capabilities
|
|
52
|
+
|
|
53
|
+
This plugin provides handlers for the following elizaOS model types:
|
|
54
|
+
|
|
55
|
+
| Model Type | Description |
|
|
56
|
+
| ----------------------- | ----------------------------------------------- |
|
|
57
|
+
| `TEXT_SMALL` | Fast text + structured output via native tool calling (tools, toolChoice, responseSchema) |
|
|
58
|
+
| `TEXT_LARGE` | Capable text + structured output via native tool calling (tools, toolChoice, responseSchema) |
|
|
59
|
+
| `TRANSCRIPTION` | Audio transcription with Whisper |
|
|
60
|
+
| `TEXT_TO_SPEECH` | Speech synthesis with PlayAI |
|
|
61
|
+
| `TEXT_TOKENIZER_ENCODE` | Tokenize text to tokens |
|
|
62
|
+
| `TEXT_TOKENIZER_DECODE` | Detokenize tokens to text |
|
|
63
|
+
|
|
64
|
+
## Development
|
|
65
|
+
|
|
66
|
+
### Building from Source
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# TypeScript
|
|
70
|
+
bun install
|
|
71
|
+
bun run build
|
|
72
|
+
# TypeScript
|
|
73
|
+
bun run test
|
|
74
|
+
# TypeScript
|
|
75
|
+
bun run format:check
|
package/auto-enable.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Auto-enable check for @elizaos/plugin-groq.
|
|
2
|
+
//
|
|
3
|
+
// Plugin manifest entry-point — referenced by package.json's
|
|
4
|
+
// `elizaos.plugin.autoEnableModule`. Keep this module light: env reads only,
|
|
5
|
+
// no service init, no transitive imports of the full plugin runtime. The
|
|
6
|
+
// auto-enable engine loads dozens of these per boot.
|
|
7
|
+
import type { PluginAutoEnableContext } from "@elizaos/core";
|
|
8
|
+
|
|
9
|
+
const ENV_KEYS = ["GROQ_API_KEY"] as const;
|
|
10
|
+
|
|
11
|
+
/** Enable when a Groq API key is present. */
|
|
12
|
+
export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
|
|
13
|
+
return ENV_KEYS.some((k) => {
|
|
14
|
+
const v = ctx.env[k];
|
|
15
|
+
return typeof v === "string" && v.trim() !== "";
|
|
16
|
+
});
|
|
17
|
+
}
|