Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
84e9767
support groq_base_url
AlbertDeFusco Aug 26, 2025
cf0fe00
add required headers
AlbertDeFusco Aug 27, 2025
395445c
format and lint
AlbertDeFusco Aug 27, 2025
19848ec
Merge branch 'main' into groq-proxy
AlbertDeFusco Aug 27, 2025
dd5e4ee
Merge remote-tracking branch 'origin/main' into groq-proxy
AlbertDeFusco Sep 9, 2025
7dbd305
new kimi k2 model
AlbertDeFusco Sep 9, 2025
3de790a
Merge remote-tracking branch 'origin/main' into groq-proxy
AlbertDeFusco Sep 16, 2025
01a7a5c
generalize openaiclient
AlbertDeFusco Sep 16, 2025
15fb6bc
add provider member for ollama
AlbertDeFusco Sep 17, 2025
413e35e
recover optional configuration in constructor
AlbertDeFusco Sep 17, 2025
d04d7f1
models obtain from client instances
AlbertDeFusco Sep 17, 2025
d637732
streamline the agentic response handler
AlbertDeFusco Sep 17, 2025
f28e84a
allow env prefix to be different from provider name
AlbertDeFusco Sep 17, 2025
635d5d5
add anacondaaiclient to configured clients
AlbertDeFusco Sep 17, 2025
b53cfd3
anacondaclient config message
AlbertDeFusco Sep 17, 2025
88de9d3
determine actual run version
AlbertDeFusco Sep 17, 2025
6618a60
format
AlbertDeFusco Sep 17, 2025
abf0601
publish groq-client.ts
AlbertDeFusco Sep 17, 2025
87df184
client may not exist for provider
AlbertDeFusco Sep 17, 2025
736a387
write a version file in the bumper
AlbertDeFusco Sep 17, 2025
6fed5ad
export version string from lib
AlbertDeFusco Sep 17, 2025
c1e1bfa
get version from lib
AlbertDeFusco Sep 17, 2025
c8d1272
lint
AlbertDeFusco Sep 17, 2025
d401570
need explicit type for logger
AlbertDeFusco Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ai/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"mod.ts",
"openai-client.ts",
"ollama-client.ts",
"groq-client.ts",
"mcp-client.ts",
"mcp-config.example.json",
"MCP_INTEGRATION.md",
Expand Down
95 changes: 95 additions & 0 deletions packages/ai/groq-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { RuntOpenAIClient } from "./openai-client.ts";
import type { OpenAIConfig } from "./openai-client.ts";
import type { AiModel } from "@runt/lib";
import { logger, VERSION } from "@runt/lib";

export class GroqClient extends RuntOpenAIClient {
override provider: string = "groq";
override defaultConfig: OpenAIConfig = {
baseURL: "https://api.groq.com/openai/v1",
};

override getConfigMessage(): string {
const configMessage = `# Groq Configuration Required

Groq API key not found. Please set \`GROQ_API_KEY\` environment variable.`;
return configMessage;
}

override discoverAiModels(): Promise<AiModel[]> {
if (!this.isReady()) {
logger.warn(
`${this.provider} client not ready, returning empty models list`,
);
return Promise.resolve([]);
}
const groqModels: AiModel[] = [
{
provider: "groq",
name: "moonshotai/kimi-k2-instruct-0905",
displayName: "Kimi K2 Instruct 0905",
capabilities: ["completion", "tools", "thinking"],
},
{
provider: "groq",
name: "moonshotai/kimi-k2-instruct",
displayName: "Kimi K2 Instruct",
capabilities: ["completion", "tools", "thinking"],
},
{
provider: "groq",
name: "llama3-8b-8192",
displayName: "Llama 3.1 8B",
capabilities: ["completion", "tools", "thinking"],
},
{
provider: "groq",
name: "llama3-70b-8192",
displayName: "Llama 3.1 70B",
capabilities: ["completion", "tools", "thinking"],
},
{
provider: "groq",
name: "mixtral-8x7b-32768",
displayName: "Mixtral 8x7B",
capabilities: ["completion", "tools"],
},
{
provider: "groq",
name: "gemma2-9b-it",
displayName: "Gemma 2 9B",
capabilities: ["completion", "tools"],
},
];
return Promise.resolve(groqModels);
}
}

export class AnacondaAIClient extends GroqClient {
override provider: string = "anaconda";
override envPrefix: string = "RUNT";
override defaultConfig: OpenAIConfig = {
baseURL: "https://anaconda.com/api/assistant/v3/groq",
defaultHeaders: {
"X-Client-Version": VERSION,
"X-Client-Source": "anaconda-runt-dev",
},
};

override async discoverAiModels(): Promise<AiModel[]> {
const models = await super.discoverAiModels();

for (const model of models) {
model.provider = "anaconda";
}

return models;
}

override getConfigMessage(): string {
const configMessage = `# Anaconda/Runt Configuration Required

RUNT API key not found. Please set \`RUNT_API_KEY\` environment variable.`;
return configMessage;
}
}
Loading