Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions src/data/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@
"description": "SambaNova Systems provides hardware-software integrated solutions optimized specifically for running large-scale machine learning workloads efficiently. Their technology aims at accelerating model training times while ensuring high performance during inference phases across diverse applications.",
"base_url": "https://api.sambanova.ai"
},
{
"id": "saladcloud",
"name": "SaladCloud AI Gateway",
"object": "provider",
"description": "SaladCloud AI Gateway provides OpenAI-compatible access to qwen3.6-35b-a3b with streaming, reasoning, tool calling, structured outputs, and text and image inputs.",
"base_url": "https://ai.salad.cloud/v1"
},
{
"id": "segmind",
"name": "Segmind",
Expand Down
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const SILICONFLOW: string = 'siliconflow';
export const CEREBRAS: string = 'cerebras';
export const INFERENCENET: string = 'inference-net';
export const SAMBANOVA: string = 'sambanova';
export const SALADCLOUD: string = 'saladcloud';
export const LEMONFOX_AI: string = 'lemonfox-ai';
export const UPSTAGE: string = 'upstage';
export const LAMBDA: string = 'lambda';
Expand Down Expand Up @@ -157,6 +158,7 @@ export const VALID_PROVIDERS = [
CEREBRAS,
INFERENCENET,
SAMBANOVA,
SALADCLOUD,
LEMONFOX_AI,
UPSTAGE,
LAMBDA,
Expand Down
2 changes: 2 additions & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import OracleConfig from './oracle';
import IOIntelligenceConfig from './iointelligence';
import AIBadgrConfig from './aibadgr';
import OVHcloudConfig from './ovhcloud';
import SaladCloudConfig from './saladcloud';

const Providers: { [key: string]: ProviderConfigs } = {
openai: OpenAIConfig,
Expand Down Expand Up @@ -148,6 +149,7 @@ const Providers: { [key: string]: ProviderConfigs } = {
iointelligence: IOIntelligenceConfig,
aibadgr: AIBadgrConfig,
ovhcloud: OVHcloudConfig,
saladcloud: SaladCloudConfig,
};

export default Providers;
20 changes: 20 additions & 0 deletions src/providers/saladcloud/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ProviderAPIConfig } from '../types';

const DEFAULT_SALADCLOUD_BASE_URL = 'https://ai.salad.cloud/v1';

const SaladCloudAPIConfig: ProviderAPIConfig = {
getBaseURL: () => DEFAULT_SALADCLOUD_BASE_URL,
headers: ({ providerOptions }) => ({
Authorization: `Bearer ${providerOptions.apiKey}`,
}),
getEndpoint: ({ fn }) => {
switch (fn) {
case 'chatComplete':
return '/chat/completions';
default:
return '';
}
},
};

export default SaladCloudAPIConfig;
31 changes: 31 additions & 0 deletions src/providers/saladcloud/chatComplete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { ProviderConfig } from '../types';

export const SaladCloudChatCompleteExcludedParams = [
'audio',
'logit_bias',
'logprobs',
'metadata',
'modalities',
'parallel_tool_calls',
'prediction',
'prompt_cache_key',
'safety_identifier',
'service_tier',
'store',
'top_logprobs',
'verbosity',
'web_search_options',
];

export const SaladCloudChatCompleteDefaults = {
model: 'qwen3.6-35b-a3b',
};

export const SaladCloudChatCompleteExtraParams: ProviderConfig = {
top_k: {
param: 'top_k',
},
chat_template_kwargs: {
param: 'chat_template_kwargs',
},
};
46 changes: 46 additions & 0 deletions src/providers/saladcloud/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { SALADCLOUD } from '../../globals';
import SaladCloudAPIConfig from './api';
import {
SaladCloudChatCompleteDefaults,
SaladCloudChatCompleteExcludedParams,
SaladCloudChatCompleteExtraParams,
} from './chatComplete';

describe('SaladCloud provider', () => {
const providerOptions = { provider: SALADCLOUD, apiKey: 'test-key' };

it('uses the SaladCloud OpenAI-compatible chat completions endpoint', () => {
const baseURLArgs = {
providerOptions,
} as Parameters<typeof SaladCloudAPIConfig.getBaseURL>[0];
const endpointArgs = {
fn: 'chatComplete',
providerOptions,
} as Parameters<typeof SaladCloudAPIConfig.getEndpoint>[0];
const headerArgs = {
providerOptions,
} as Parameters<typeof SaladCloudAPIConfig.headers>[0];

expect(SaladCloudAPIConfig.getBaseURL(baseURLArgs)).toEqual(
'https://ai.salad.cloud/v1'
);
expect(SaladCloudAPIConfig.getEndpoint(endpointArgs)).toEqual(
'/chat/completions'
);
expect(SaladCloudAPIConfig.headers(headerArgs)).toEqual({
Authorization: 'Bearer test-key',
});
});

it('defaults to the 35B model without disabling reasoning', () => {
expect(SaladCloudChatCompleteDefaults).toEqual({
model: 'qwen3.6-35b-a3b',
});
expect(SaladCloudChatCompleteExcludedParams).not.toContain(
'reasoning_effort'
);
expect(SaladCloudChatCompleteExtraParams.chat_template_kwargs).toEqual({
param: 'chat_template_kwargs',
});
});
});
23 changes: 23 additions & 0 deletions src/providers/saladcloud/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { SALADCLOUD } from '../../globals';
import { chatCompleteParams, responseTransformers } from '../open-ai-base';
import { ProviderConfigs } from '../types';
import SaladCloudAPIConfig from './api';
import {
SaladCloudChatCompleteDefaults,
SaladCloudChatCompleteExcludedParams,
SaladCloudChatCompleteExtraParams,
} from './chatComplete';

const SaladCloudConfig: ProviderConfigs = {
chatComplete: chatCompleteParams(
SaladCloudChatCompleteExcludedParams,
SaladCloudChatCompleteDefaults,
SaladCloudChatCompleteExtraParams
),
api: SaladCloudAPIConfig,
responseTransforms: responseTransformers(SALADCLOUD, {
chatComplete: true,
}),
};

export default SaladCloudConfig;
4 changes: 4 additions & 0 deletions src/tests/resources/testVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ const testVariables: TestVariables = {
model: 'Qwen/Qwen2.5-Coder-3B-Instruct',
},
},
saladcloud: {
apiKey: process.env.SALAD_CLOUD_API_KEY,
chatCompletions: { model: 'qwen3.6-35b-a3b' },
},
};

export default testVariables;