Skip to content

Commit bbc5853

Browse files
committed
fix(providers): pin transport policy and lift the 60s cap on Groq and Cerebras
1 parent 5baa7a4 commit bbc5853

20 files changed

Lines changed: 137 additions & 1 deletion

File tree

apps/sim/providers/baseten/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1919
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
2020
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2121
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
22+
import { openAICompatTransport } from '@/providers/transport'
2223
import type {
2324
FunctionCallResponse,
2425
Message,
@@ -86,6 +87,7 @@ export const basetenProvider: ProviderConfig = {
8687
}
8788

8889
const client = new OpenAI({
90+
...openAICompatTransport(),
8991
apiKey: request.apiKey,
9092
baseURL: 'https://inference.baseten.co/v1',
9193
})

apps/sim/providers/cerebras/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1515
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1616
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1717
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
18+
import { openAICompatTransport } from '@/providers/transport'
1819
import type {
1920
ProviderConfig,
2021
ProviderRequest,
@@ -54,6 +55,7 @@ export const cerebrasProvider: ProviderConfig = {
5455
try {
5556
const client = new Cerebras({
5657
apiKey: request.apiKey,
58+
...openAICompatTransport(),
5759
})
5860

5961
const allMessages = []

apps/sim/providers/deepseek/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1313
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1414
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1515
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
16+
import { openAICompatTransport } from '@/providers/transport'
1617
import type {
1718
ProviderConfig,
1819
ProviderRequest,
@@ -50,6 +51,7 @@ export const deepseekProvider: ProviderConfig = {
5051

5152
try {
5253
const deepseek = new OpenAI({
54+
...openAICompatTransport(),
5355
apiKey: request.apiKey,
5456
baseURL: 'https://api.deepseek.com',
5557
})

apps/sim/providers/fireworks/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
2020
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
2121
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2222
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
23+
import { openAICompatTransport } from '@/providers/transport'
2324
import type {
2425
FunctionCallResponse,
2526
Message,
@@ -87,6 +88,7 @@ export const fireworksProvider: ProviderConfig = {
8788
}
8889

8990
const client = new OpenAI({
91+
...openAICompatTransport(),
9092
apiKey: request.apiKey,
9193
baseURL: 'https://api.fireworks.ai/inference/v1',
9294
})

apps/sim/providers/groq/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1818
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1919
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2020
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
21+
import { openAICompatTransport } from '@/providers/transport'
2122
import type {
2223
ProviderConfig,
2324
ProviderRequest,
@@ -50,7 +51,7 @@ export const groqProvider: ProviderConfig = {
5051
throw new Error('API key is required for Groq')
5152
}
5253

53-
const groq = new Groq({ apiKey: request.apiKey })
54+
const groq = new Groq({ apiKey: request.apiKey, ...openAICompatTransport() })
5455

5556
const allMessages = []
5657

apps/sim/providers/kimi/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1919
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
2020
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
2121
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
22+
import { openAICompatTransport } from '@/providers/transport'
2223
import type {
2324
ProviderConfig,
2425
ProviderRequest,
@@ -100,6 +101,7 @@ export const kimiProvider: ProviderConfig = {
100101

101102
try {
102103
const kimi = new OpenAI({
104+
...openAICompatTransport(),
103105
apiKey: request.apiKey,
104106
baseURL: KIMI_BASE_URL,
105107
})

apps/sim/providers/litellm/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1616
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1717
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1818
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
19+
import { openAICompatTransport } from '@/providers/transport'
1920
import type {
2021
Message,
2122
ProviderConfig,
@@ -110,6 +111,7 @@ export const litellmProvider: ProviderConfig = {
110111

111112
const apiKey = request.apiKey || env.LITELLM_API_KEY || 'empty'
112113
const litellm = new OpenAI({
114+
...openAICompatTransport(),
113115
apiKey,
114116
baseURL: `${baseUrl}/v1`,
115117
})

apps/sim/providers/meta/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1414
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1515
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1616
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
17+
import { openAICompatTransport } from '@/providers/transport'
1718
import type {
1819
ProviderConfig,
1920
ProviderRequest,
@@ -53,6 +54,7 @@ export const metaProvider: ProviderConfig = {
5354

5455
try {
5556
const meta = new OpenAI({
57+
...openAICompatTransport(),
5658
apiKey: request.apiKey,
5759
baseURL: META_BASE_URL,
5860
})

apps/sim/providers/mistral/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1414
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1515
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1616
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
17+
import { openAICompatTransport } from '@/providers/transport'
1718
import type {
1819
ProviderConfig,
1920
ProviderRequest,
@@ -61,6 +62,7 @@ export const mistralProvider: ProviderConfig = {
6162
}
6263

6364
const mistral = new OpenAI({
65+
...openAICompatTransport(),
6466
apiKey: request.apiKey,
6567
baseURL: 'https://api.mistral.ai/v1',
6668
})

apps/sim/providers/nvidia/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { createStreamingExecution } from '@/providers/streaming-execution'
1515
import { isAbortError, parseToolArguments } from '@/providers/streaming-tool-loop-shared'
1616
import { adaptOpenAIChatToolSchema } from '@/providers/tool-schema-adapter'
1717
import { enrichLastModelSegmentFromChatCompletions } from '@/providers/trace-enrichment'
18+
import { openAICompatTransport } from '@/providers/transport'
1819
import type {
1920
ProviderConfig,
2021
ProviderRequest,
@@ -60,6 +61,7 @@ export const nvidiaProvider: ProviderConfig = {
6061

6162
try {
6263
const nvidia = new OpenAI({
64+
...openAICompatTransport(),
6365
apiKey: request.apiKey,
6466
baseURL: NVIDIA_BASE_URL,
6567
})

0 commit comments

Comments
 (0)