@agentforge-io/llm-langchain 0.2.0 → 0.3.0
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/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/providers/groq-provider.d.ts +15 -0
- package/dist/providers/groq-provider.js +44 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
// The host wires which provider runs per tenant; this package only ships
|
|
17
17
|
// the adapters, not the resolution logic.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.GeminiProvider = exports.OpenAIProvider = void 0;
|
|
19
|
+
exports.GroqProvider = exports.GeminiProvider = exports.OpenAIProvider = void 0;
|
|
20
20
|
var openai_provider_1 = require("./providers/openai-provider");
|
|
21
21
|
Object.defineProperty(exports, "OpenAIProvider", { enumerable: true, get: function () { return openai_provider_1.OpenAIProvider; } });
|
|
22
22
|
var gemini_provider_1 = require("./providers/gemini-provider");
|
|
23
23
|
Object.defineProperty(exports, "GeminiProvider", { enumerable: true, get: function () { return gemini_provider_1.GeminiProvider; } });
|
|
24
|
+
var groq_provider_1 = require("./providers/groq-provider");
|
|
25
|
+
Object.defineProperty(exports, "GroqProvider", { enumerable: true, get: function () { return groq_provider_1.GroqProvider; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpenAIProvider, type OpenAIProviderOptions } from './openai-provider';
|
|
2
|
+
export interface GroqProviderOptions extends Omit<OpenAIProviderOptions, 'baseURL' | 'organization'> {
|
|
3
|
+
/** Override the default base URL. Only useful for a proxy/test setup;
|
|
4
|
+
* production points at https://api.groq.com/openai/v1. */
|
|
5
|
+
baseURL?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Groq inference provider. Same wire format as OpenAI Chat Completions,
|
|
9
|
+
* just at a different endpoint. The class extends OpenAIProvider so we
|
|
10
|
+
* inherit the entire stream-event translation pipeline — only the
|
|
11
|
+
* default base URL changes.
|
|
12
|
+
*/
|
|
13
|
+
export declare class GroqProvider extends OpenAIProvider {
|
|
14
|
+
constructor(opts: GroqProviderOptions);
|
|
15
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── Groq provider ──────────────────────────────────────────────────────────
|
|
3
|
+
//
|
|
4
|
+
// Groq runs OpenAI-compatible inference on their own LPU hardware — same
|
|
5
|
+
// wire format as OpenAI's `/v1/chat/completions`, just at
|
|
6
|
+
// `https://api.groq.com/openai/v1`. So this whole provider is the OpenAI
|
|
7
|
+
// adapter with the base URL pinned + a different id/displayName for
|
|
8
|
+
// telemetry attribution.
|
|
9
|
+
//
|
|
10
|
+
// Worth a separate class (not just an env override on OpenAIProvider)
|
|
11
|
+
// because:
|
|
12
|
+
// - Groq's free tier is the killer feature; the platform wants to
|
|
13
|
+
// attribute spend / quota separately in the dashboard
|
|
14
|
+
// - The model catalog is DIFFERENT (Llama 3, Mixtral, Gemma, etc.) —
|
|
15
|
+
// hardcoding them in the platform registration would lie about
|
|
16
|
+
// which provider answered the turn
|
|
17
|
+
// - Capability flags can diverge: some Groq-hosted models don't
|
|
18
|
+
// expose tool calling even though OpenAI's catalog does
|
|
19
|
+
//
|
|
20
|
+
// Don't confuse with Grok (xAI). They sound alike but:
|
|
21
|
+
// - Grok = xAI's own model family ("grok-2", "grok-2-mini"), served
|
|
22
|
+
// at api.x.ai. Uses GrokProvider in the platform.
|
|
23
|
+
// - Groq = inference service serving open-weight models. Uses THIS
|
|
24
|
+
// provider in the platform.
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.GroqProvider = void 0;
|
|
27
|
+
const openai_provider_1 = require("./openai-provider");
|
|
28
|
+
/**
|
|
29
|
+
* Groq inference provider. Same wire format as OpenAI Chat Completions,
|
|
30
|
+
* just at a different endpoint. The class extends OpenAIProvider so we
|
|
31
|
+
* inherit the entire stream-event translation pipeline — only the
|
|
32
|
+
* default base URL changes.
|
|
33
|
+
*/
|
|
34
|
+
class GroqProvider extends openai_provider_1.OpenAIProvider {
|
|
35
|
+
constructor(opts) {
|
|
36
|
+
super({
|
|
37
|
+
apiKey: opts.apiKey,
|
|
38
|
+
baseURL: opts.baseURL ?? 'https://api.groq.com/openai/v1',
|
|
39
|
+
id: opts.id ?? 'groq',
|
|
40
|
+
displayName: opts.displayName ?? 'Groq',
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.GroqProvider = GroqProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/llm-langchain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "LangChain-backed LLM providers (OpenAI, Grok, Gemini) implementing the framework-free `LLMProvider` contract from @agentforge-io/core. Drop-in replacements for AnthropicProvider — same stream events, same tool schema, no changes to the agent runner.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|