Skip to content

Commit e739819

Browse files
akshay326cursoragent
andcommitted
docs(execution): tighten throughput evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4ff34ea commit e739819

9 files changed

Lines changed: 153 additions & 260 deletions

File tree

apps/sim/blocks/utils.test.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
*/
44
import { beforeEach, describe, expect, it, vi } from 'vitest'
55

6-
const { mockIsHosted, mockIsAzureConfigured, mockIsOllamaConfigured, mockIsOpenRouterConfigured } =
7-
vi.hoisted(() => ({
8-
mockIsHosted: { value: false },
9-
mockIsAzureConfigured: { value: false },
10-
mockIsOllamaConfigured: { value: false },
11-
mockIsOpenRouterConfigured: { value: false },
12-
}))
6+
const { mockIsHosted, mockIsAzureConfigured, mockIsOllamaConfigured } = vi.hoisted(() => ({
7+
mockIsHosted: { value: false },
8+
mockIsAzureConfigured: { value: false },
9+
mockIsOllamaConfigured: { value: false },
10+
}))
1311

1412
const {
1513
mockGetHostedModels,
@@ -46,12 +44,6 @@ vi.mock('@/lib/core/config/env-flags', () => ({
4644
get isOllamaConfigured() {
4745
return mockIsOllamaConfigured.value
4846
},
49-
get isOpenRouterConfigured() {
50-
return mockIsOpenRouterConfigured.value
51-
},
52-
get isCohereConfigured() {
53-
return false
54-
},
5547
}))
5648

5749
vi.mock('@/providers/models', () => ({
@@ -114,7 +106,6 @@ describe('getApiKeyCondition / shouldRequireApiKeyForModel', () => {
114106
mockIsHosted.value = false
115107
mockIsAzureConfigured.value = false
116108
mockIsOllamaConfigured.value = false
117-
mockIsOpenRouterConfigured.value = false
118109
mockProviders.value = {
119110
base: { models: [], isLoading: false },
120111
ollama: { models: [], isLoading: false },
@@ -219,13 +210,6 @@ describe('getApiKeyCondition / shouldRequireApiKeyForModel', () => {
219210
expect(evaluateCondition('openrouter/anthropic/claude')).toBe(true)
220211
})
221212

222-
it('does not require API key for openrouter/ models when OpenRouter is configured', () => {
223-
mockIsOpenRouterConfigured.value = true
224-
expect(evaluateCondition('openrouter/deepseek/deepseek-v4-flash')).toBe(false)
225-
mockProviders.value.openrouter.models = ['openrouter/anthropic/claude']
226-
expect(evaluateCondition('openrouter/anthropic/claude')).toBe(false)
227-
})
228-
229213
it('is case-insensitive for store lookup', () => {
230214
mockProviders.value.ollama.models = ['Llama3:Latest']
231215
expect(evaluateCondition('llama3:latest')).toBe(false)

apps/sim/blocks/utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
isCohereConfigured,
55
isHosted,
66
isOllamaConfigured,
7-
isOpenRouterConfigured,
87
} from '@/lib/core/config/env-flags'
98
import { getScopesForService } from '@/lib/oauth/utils'
109
import { buildCanonicalIndex } from '@/lib/workflows/subblocks/visibility'
@@ -200,13 +199,6 @@ function shouldRequireApiKeyForModel(model: string): boolean {
200199
) {
201200
return false
202201
}
203-
if (
204-
isOpenRouterConfigured &&
205-
(normalizedModel.startsWith('openrouter/') ||
206-
getProviderFromStore(normalizedModel) === 'openrouter')
207-
) {
208-
return false
209-
}
210202
if (normalizedModel.startsWith('vllm/') || normalizedModel.startsWith('litellm/')) {
211203
return false
212204
}

apps/sim/lib/api-key/byok.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,6 @@ export async function getApiKeyWithBYOK(
187187
throw new Error(`API key is required for Ollama Cloud ${model}`)
188188
}
189189

190-
const isOpenRouterModel =
191-
provider === 'openrouter' ||
192-
model.startsWith('openrouter/') ||
193-
useProvidersStore.getState().providers.openrouter.models.includes(model)
194-
if (isOpenRouterModel) {
195-
if (userProvidedKey) {
196-
return { apiKey: userProvidedKey, isBYOK: false }
197-
}
198-
if (env.OPENROUTER_API_KEY) {
199-
return { apiKey: env.OPENROUTER_API_KEY, isBYOK: false }
200-
}
201-
throw new Error(`API key is required for OpenRouter ${model}`)
202-
}
203-
204190
const isBedrockModel = provider === 'bedrock' || model.startsWith('bedrock/')
205191
if (isBedrockModel) {
206192
return { apiKey: PROVIDER_PLACEHOLDER_KEY, isBYOK: false }

apps/sim/lib/core/config/env-flags.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,6 @@ export const isAzureConfigured = isTruthy(getEnv('NEXT_PUBLIC_AZURE_CONFIGURED')
261261
*/
262262
export const isCohereConfigured = isTruthy(getEnv('NEXT_PUBLIC_COHERE_CONFIGURED'))
263263

264-
/**
265-
* Whether an OpenRouter API key is pre-configured (`OPENROUTER_API_KEY`).
266-
* When true, Agent/Router/Evaluator blocks hide the API Key field for OpenRouter models
267-
* and resolve the key from the environment at execution time.
268-
* Client bundles also honor `NEXT_PUBLIC_OPENROUTER_CONFIGURED=true` so the field stays
269-
* hidden in the editor (server-only `OPENROUTER_API_KEY` never reaches the browser).
270-
*/
271-
export const isOpenRouterConfigured =
272-
Boolean(env.OPENROUTER_API_KEY) || isTruthy(getEnv('NEXT_PUBLIC_OPENROUTER_CONFIGURED'))
273-
274264
/**
275265
* Are invitations disabled globally
276266
* When true, workspace invitations are disabled for all users

apps/sim/lib/core/config/env.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ export const env = createEnv({
171171
LITELLM_API_KEY: z.string().optional(), // Optional bearer token for LiteLLM
172172
FIREWORKS_API_KEY: z.string().optional(), // Optional Fireworks AI API key for model listing
173173
TOGETHER_API_KEY: z.string().optional(), // Optional Together AI API key for model listing and inference
174-
OPENROUTER_API_KEY: z.string().optional(), // Optional OpenRouter API key for model listing and inference
175174
BASETEN_API_KEY: z.string().optional(), // Optional Baseten API key for model listing and inference
176175
COHERE_API_KEY: z.string().min(1).optional(), // Cohere API key for reranker (rerank-v4.0-pro, rerank-v4.0-fast, rerank-v3.5)
177176
COHERE_API_KEY_1: z.string().min(1).optional(), // Primary Cohere API key for rotation
@@ -541,7 +540,6 @@ export const env = createEnv({
541540
NEXT_PUBLIC_BEDROCK_DEFAULT_CREDENTIALS: z.string().optional(), // Hide Bedrock credential fields when deployment uses AWS default credential chain (IAM roles, instance profiles, ECS task roles, IRSA)
542541
NEXT_PUBLIC_AZURE_CONFIGURED: z.string().optional(), // Hide Azure credential fields when endpoint/key/version are pre-configured server-side
543542
NEXT_PUBLIC_COHERE_CONFIGURED: z.string().optional(), // Hide Cohere API key field on Knowledge block when COHERE_API_KEY is pre-configured server-side
544-
NEXT_PUBLIC_OPENROUTER_CONFIGURED: z.string().optional(), // Hide OpenRouter API key field when OPENROUTER_API_KEY is pre-configured server-side
545543
NEXT_PUBLIC_COPILOT_TRAINING_ENABLED: z.string().optional(),
546544
NEXT_PUBLIC_ENABLE_PLAYGROUND: z.string().optional(), // Enable component playground at /playground
547545
NEXT_PUBLIC_DOCUMENTATION_URL: z.string().url().optional(), // Custom documentation URL
@@ -615,7 +613,6 @@ export const env = createEnv({
615613
NEXT_PUBLIC_BEDROCK_DEFAULT_CREDENTIALS: process.env.NEXT_PUBLIC_BEDROCK_DEFAULT_CREDENTIALS,
616614
NEXT_PUBLIC_AZURE_CONFIGURED: process.env.NEXT_PUBLIC_AZURE_CONFIGURED,
617615
NEXT_PUBLIC_COHERE_CONFIGURED: process.env.NEXT_PUBLIC_COHERE_CONFIGURED,
618-
NEXT_PUBLIC_OPENROUTER_CONFIGURED: process.env.NEXT_PUBLIC_OPENROUTER_CONFIGURED,
619616
NEXT_PUBLIC_COPILOT_TRAINING_ENABLED: process.env.NEXT_PUBLIC_COPILOT_TRAINING_ENABLED,
620617
NEXT_PUBLIC_ENABLE_PLAYGROUND: process.env.NEXT_PUBLIC_ENABLE_PLAYGROUND,
621618
NEXT_PUBLIC_POSTHOG_ENABLED: process.env.NEXT_PUBLIC_POSTHOG_ENABLED,

apps/sim/scripts/load/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ Optional variables:
102102

103103
- `load:workflow` is an alias for `load:workflow:baseline`
104104
- All scenarios send `x-execution-mode: async`
105-
- Artillery output will show request counts and response codes, which is usually enough for quick local verification
105+
- The baseline asserts `202` responses, but completion throughput still requires querying `workflow_execution_logs.ended_at`; request counts alone do not measure workflow throughput
106106
- At these defaults, you should see `429` responses when approaching `ADMISSION_GATE_MAX_INFLIGHT=10`
107107
- If you still see lots of `429` or `ETIMEDOUT` responses locally, lower the rates again before increasing durations

bun.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)