Skip to content

Commit 0890d3b

Browse files
authored
Merge pull request #369 from Ayush7614/feat/provider-together-ai
feat(providers): add Together AI cloud provider
2 parents bce53c3 + 244d7ee commit 0890d3b

5 files changed

Lines changed: 58 additions & 1 deletion

File tree

src/chrome/src/providers/manager.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,18 @@ export class ProviderManager {
424424
apiKeyUrl: 'https://dashscope.console.aliyun.com/apiKey',
425425
enabled: false,
426426
},
427+
together: {
428+
type: 'openai',
429+
category: 'cloud',
430+
label: 'Together AI',
431+
providerName: 'together',
432+
baseUrl: 'https://api.together.xyz/v1',
433+
model: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
434+
supportsStreamUsageOptions: true,
435+
apiKey: '',
436+
apiKeyUrl: 'https://api.together.ai/settings/api-keys',
437+
enabled: false,
438+
},
427439
openrouter: {
428440
type: 'openai',
429441
category: 'router',

src/chrome/src/ui/settings.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,20 @@ function renderProviders() {
18491849
...COST_ESTIMATE_FIELDS,
18501850
],
18511851
},
1852+
together: {
1853+
fields: [
1854+
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'tgp_...' },
1855+
{ key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
1856+
suggestions: [
1857+
'meta-llama/Llama-3.3-70B-Instruct-Turbo',
1858+
'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
1859+
'Qwen/Qwen2.5-72B-Instruct-Turbo',
1860+
'deepseek-ai/DeepSeek-V3',
1861+
] },
1862+
{ key: 'baseUrl', labelKey: 'st.provider.field.api_base_url', type: 'text', placeholder: 'https://api.together.xyz/v1' },
1863+
...COST_ESTIMATE_FIELDS,
1864+
],
1865+
},
18521866
groq: {
18531867
fields: [
18541868
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'gsk_...' },

src/firefox/src/providers/manager.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,18 @@ export class ProviderManager {
402402
apiKeyUrl: 'https://dashscope.console.aliyun.com/apiKey',
403403
enabled: false,
404404
},
405+
together: {
406+
type: 'openai',
407+
category: 'cloud',
408+
label: 'Together AI',
409+
providerName: 'together',
410+
baseUrl: 'https://api.together.xyz/v1',
411+
model: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
412+
supportsStreamUsageOptions: true,
413+
apiKey: '',
414+
apiKeyUrl: 'https://api.together.ai/settings/api-keys',
415+
enabled: false,
416+
},
405417
openrouter: {
406418
type: 'openai',
407419
category: 'router',

src/firefox/src/ui/settings.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,20 @@ function renderProviders() {
18051805
...COST_ESTIMATE_FIELDS,
18061806
],
18071807
},
1808+
together: {
1809+
fields: [
1810+
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'tgp_...' },
1811+
{ key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
1812+
suggestions: [
1813+
'meta-llama/Llama-3.3-70B-Instruct-Turbo',
1814+
'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
1815+
'Qwen/Qwen2.5-72B-Instruct-Turbo',
1816+
'deepseek-ai/DeepSeek-V3',
1817+
] },
1818+
{ key: 'baseUrl', labelKey: 'st.provider.field.api_base_url', type: 'text', placeholder: 'https://api.together.xyz/v1' },
1819+
...COST_ESTIMATE_FIELDS,
1820+
],
1821+
},
18081822
groq: {
18091823
fields: [
18101824
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'gsk_...' },

test/run.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13094,6 +13094,7 @@ test('categoryFor: cloud family (openai / anthropic / gemini / mistral / deepsee
1309413094
assert.equal(PM.categoryFor('mistral', { type: 'openai' }), 'cloud');
1309513095
assert.equal(PM.categoryFor('deepseek', { type: 'openai' }), 'cloud');
1309613096
assert.equal(PM.categoryFor('xai', { type: 'openai' }), 'cloud');
13097+
assert.equal(PM.categoryFor('together', { type: 'openai' }), 'cloud');
1309713098
assert.equal(PM.categoryFor('claude_subscription', { type: 'anthropic_oauth' }), 'cloud');
1309813099
}
1309913100
});
@@ -14460,13 +14461,17 @@ test('_defaultConfigs: new cloud providers present and disabled by default', ()
1446014461
for (const PM of [ProviderManagerCh, ProviderManagerFx]) {
1446114462
const mgr = new PM();
1446214463
const defaults = mgr._defaultConfigs();
14463-
for (const id of ['gemini', 'mistral', 'deepseek', 'xai']) {
14464+
for (const id of ['gemini', 'mistral', 'deepseek', 'xai', 'together']) {
1446414465
assert.ok(defaults[id], `${PM.name}: missing default config for ${id}`);
1446514466
assert.equal(defaults[id].category, 'cloud', `${PM.name}: ${id} should be cloud`);
1446614467
assert.equal(defaults[id].enabled, false, `${PM.name}: ${id} should default to disabled`);
1446714468
assert.ok(defaults[id].baseUrl, `${PM.name}: ${id} missing baseUrl`);
1446814469
assert.ok(defaults[id].model, `${PM.name}: ${id} missing default model`);
1446914470
}
14471+
assert.equal(defaults.together.type, 'openai', `${PM.name}: together should use OpenAI-compatible provider`);
14472+
assert.equal(defaults.together.baseUrl, 'https://api.together.xyz/v1');
14473+
assert.equal(defaults.together.model, 'meta-llama/Llama-3.3-70B-Instruct-Turbo');
14474+
assert.equal(defaults.together.supportsStreamUsageOptions, true);
1447014475
}
1447114476
});
1447214477

0 commit comments

Comments
 (0)