@standardagents/groq 0.0.1-dev.ffffff → 0.13.2
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.txt +48 -0
- package/README.md +139 -3
- package/package.json +12 -12
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
PROPRIETARY SOFTWARE LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 FormKit Inc. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
UNLICENSED - DO NOT USE
|
|
6
|
+
|
|
7
|
+
This software and associated documentation files (the "Software") are the sole
|
|
8
|
+
and exclusive property of FormKit Inc. ("FormKit").
|
|
9
|
+
|
|
10
|
+
USE RESTRICTIONS
|
|
11
|
+
|
|
12
|
+
The Software is UNLICENSED and proprietary. NO PERMISSION is granted to use,
|
|
13
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
+
the Software, or to permit persons to whom the Software is furnished to do so,
|
|
15
|
+
under any circumstances, without prior written authorization from FormKit Inc.
|
|
16
|
+
|
|
17
|
+
UNAUTHORIZED USE PROHIBITED
|
|
18
|
+
|
|
19
|
+
Any use of this Software without a valid, written license agreement signed by
|
|
20
|
+
authorized officers of FormKit Inc. is strictly prohibited and constitutes
|
|
21
|
+
unauthorized use and infringement of FormKit's intellectual property rights.
|
|
22
|
+
|
|
23
|
+
LICENSING INQUIRIES
|
|
24
|
+
|
|
25
|
+
Organizations interested in licensing this Software should contact:
|
|
26
|
+
enterprise@formkit.com
|
|
27
|
+
|
|
28
|
+
A written license agreement must be executed before any use of this Software
|
|
29
|
+
is authorized.
|
|
30
|
+
|
|
31
|
+
NO WARRANTY
|
|
32
|
+
|
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
36
|
+
FORMKIT INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
37
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
38
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
39
|
+
|
|
40
|
+
GOVERNING LAW
|
|
41
|
+
|
|
42
|
+
This license shall be governed by and construed in accordance with the laws
|
|
43
|
+
of the jurisdiction in which FormKit Inc. is incorporated, without regard to
|
|
44
|
+
its conflict of law provisions.
|
|
45
|
+
|
|
46
|
+
FormKit Inc.
|
|
47
|
+
https://formkit.com
|
|
48
|
+
enterprise@formkit.com
|
package/README.md
CHANGED
|
@@ -1,7 +1,143 @@
|
|
|
1
1
|
# @standardagents/groq
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Groq provider for Standard Agents.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package wraps Groq's Chat Completions API behind the Standard Agents provider interface. It supports:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- model discovery
|
|
8
|
+
- Standard Agents message transformation to Groq chat payloads
|
|
9
|
+
- streaming and non-streaming generation
|
|
10
|
+
- local function tool calling on Groq models that support it
|
|
11
|
+
- reasoning controls on supported reasoning models
|
|
12
|
+
- Groq usage and cost calculation
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @standardagents/groq @standardagents/spec
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { groq } from '@standardagents/groq';
|
|
24
|
+
|
|
25
|
+
const provider = groq({
|
|
26
|
+
apiKey: process.env.GROQ_API_KEY!,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const result = await provider.generate({
|
|
30
|
+
model: 'llama-3.3-70b-versatile',
|
|
31
|
+
messages: [
|
|
32
|
+
{ role: 'user', content: 'Give me three short product name ideas.' },
|
|
33
|
+
],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
console.log(result.content);
|
|
37
|
+
console.log(result.usage?.cost);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Factory
|
|
41
|
+
|
|
42
|
+
The package exports:
|
|
43
|
+
|
|
44
|
+
- `groq(config)` - provider factory
|
|
45
|
+
- `GroqProvider` - provider class
|
|
46
|
+
- `groqProviderOptions` - Zod schema for provider-specific options
|
|
47
|
+
|
|
48
|
+
Factory config:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
type ProviderFactoryConfig = {
|
|
52
|
+
apiKey: string;
|
|
53
|
+
baseUrl?: string;
|
|
54
|
+
timeout?: number;
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Supported Features
|
|
59
|
+
|
|
60
|
+
Feature support is model-specific.
|
|
61
|
+
|
|
62
|
+
Typical supported capabilities include:
|
|
63
|
+
|
|
64
|
+
- streaming text generation
|
|
65
|
+
- JSON mode on supported chat models
|
|
66
|
+
- local function tool calling on supported models
|
|
67
|
+
- reasoning controls on supported reasoning models
|
|
68
|
+
|
|
69
|
+
Inspect the live model list and capabilities:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
const models = await provider.getModels?.();
|
|
73
|
+
const capabilities = await provider.getModelCapabilities?.('openai/gpt-oss-120b');
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Tool Calling Notes
|
|
77
|
+
|
|
78
|
+
This package only sends Standard Agents local tools to Groq models that support local/custom tool calling.
|
|
79
|
+
|
|
80
|
+
Important edge case:
|
|
81
|
+
|
|
82
|
+
- `compound-beta` and `compound-beta-mini` support Groq built-in/server-side tools, but not Standard Agents custom function tools
|
|
83
|
+
- this provider therefore strips local tools for Compound models instead of forwarding unsupported tool definitions
|
|
84
|
+
|
|
85
|
+
If you need Standard Agents function tools, use one of the normal Groq function-calling models instead of Compound.
|
|
86
|
+
|
|
87
|
+
## Reasoning Controls
|
|
88
|
+
|
|
89
|
+
The provider only sends `reasoning_format`, `include_reasoning`, and `reasoning_effort` when the target model is known to support Groq reasoning controls.
|
|
90
|
+
|
|
91
|
+
This avoids hard failures like:
|
|
92
|
+
|
|
93
|
+
- ``reasoning_format is not supported with this model``
|
|
94
|
+
|
|
95
|
+
## Provider Options
|
|
96
|
+
|
|
97
|
+
Common Groq-specific provider options:
|
|
98
|
+
|
|
99
|
+
- `citation_options`
|
|
100
|
+
- `disable_tool_validation`
|
|
101
|
+
- `include_reasoning`
|
|
102
|
+
- `reasoning_effort`
|
|
103
|
+
- `reasoning_format`
|
|
104
|
+
- `service_tier`
|
|
105
|
+
- `search_settings`
|
|
106
|
+
- `compound_custom`
|
|
107
|
+
- `documents`
|
|
108
|
+
|
|
109
|
+
Example:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const result = await provider.generate({
|
|
113
|
+
model: 'openai/gpt-oss-120b',
|
|
114
|
+
messages: [{ role: 'user', content: 'Solve this carefully.' }],
|
|
115
|
+
providerOptions: {
|
|
116
|
+
reasoning_format: 'parsed',
|
|
117
|
+
reasoning_effort: 'high',
|
|
118
|
+
service_tier: 'performance',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Icons
|
|
124
|
+
|
|
125
|
+
`getIcon(modelId?)` returns either the Groq provider icon or a model-lab icon derived from the model identifier when possible, such as:
|
|
126
|
+
|
|
127
|
+
- `openai/gpt-oss-120b` -> OpenAI icon
|
|
128
|
+
- `qwen/qwen3-32b` -> Qwen icon
|
|
129
|
+
- `llama-*` -> Meta icon
|
|
130
|
+
- `gemma*` -> Google icon
|
|
131
|
+
|
|
132
|
+
## Debugging
|
|
133
|
+
|
|
134
|
+
Use `inspectRequest()` to see the final Groq-native request body after model-specific transforms are applied:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
const inspected = await provider.inspectRequest?.({
|
|
138
|
+
model: 'llama-3.1-8b-instant',
|
|
139
|
+
messages: [{ role: 'user', content: 'hello' }],
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
console.log(inspected?.body);
|
|
143
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standardagents/groq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted",
|
|
@@ -20,13 +20,6 @@
|
|
|
20
20
|
"dist",
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsup",
|
|
25
|
-
"dev": "tsup --watch",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"test": "cd ../.. && vitest --dir packages/groq",
|
|
28
|
-
"test:run": "cd ../.. && vitest run --dir packages/groq"
|
|
29
|
-
},
|
|
30
23
|
"dependencies": {
|
|
31
24
|
"groq-sdk": "^1.1.2",
|
|
32
25
|
"zod": "^4.3.5"
|
|
@@ -35,9 +28,9 @@
|
|
|
35
28
|
"@standardagents/spec": "^0.10.0"
|
|
36
29
|
},
|
|
37
30
|
"devDependencies": {
|
|
38
|
-
"@standardagents/spec": "workspace:*",
|
|
39
31
|
"tsup": "^8.3.5",
|
|
40
|
-
"typescript": "^5.9.0"
|
|
32
|
+
"typescript": "^5.9.0",
|
|
33
|
+
"@standardagents/spec": "0.13.2"
|
|
41
34
|
},
|
|
42
35
|
"keywords": [
|
|
43
36
|
"standardagents",
|
|
@@ -47,5 +40,12 @@
|
|
|
47
40
|
"llm"
|
|
48
41
|
],
|
|
49
42
|
"author": "FormKit Inc.",
|
|
50
|
-
"license": "UNLICENSED"
|
|
51
|
-
|
|
43
|
+
"license": "UNLICENSED",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"dev": "tsup --watch",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"test": "cd ../.. && vitest --dir packages/groq",
|
|
49
|
+
"test:run": "cd ../.. && vitest run --dir packages/groq"
|
|
50
|
+
}
|
|
51
|
+
}
|