Add Together AI provider with new models, remove together-models.ts
This commit is contained in:
parent
59247b52cf
commit
ead9ab9b8c
@ -359,6 +359,113 @@ async function buildOllamaProvider(): Promise<ProviderConfig> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildTogetherProvider(): ProviderConfig {
|
||||||
|
return {
|
||||||
|
baseUrl: "https://api.together.xyz/v1",
|
||||||
|
api: "openai-completions",
|
||||||
|
models: [
|
||||||
|
{
|
||||||
|
id: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
||||||
|
name: "Llama 3.3 70B Instruct Turbo",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.88,
|
||||||
|
output: 0.88,
|
||||||
|
cacheRead: 0.88,
|
||||||
|
cacheWrite: 0.88,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
|
||||||
|
name: "Llama 4 Scout 17B 16E Instruct",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text", "image"],
|
||||||
|
contextWindow: 10000000,
|
||||||
|
maxTokens: 32768,
|
||||||
|
cost: {
|
||||||
|
input: 0.18,
|
||||||
|
output: 0.59,
|
||||||
|
cacheRead: 0.18,
|
||||||
|
cacheWrite: 0.18,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
|
||||||
|
name: "Llama 4 Maverick 17B 128E Instruct FP8",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text", "image"],
|
||||||
|
contextWindow: 20000000,
|
||||||
|
maxTokens: 32768,
|
||||||
|
cost: {
|
||||||
|
input: 0.27,
|
||||||
|
output: 0.85,
|
||||||
|
cacheRead: 0.27,
|
||||||
|
cacheWrite: 0.27,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "deepseek-ai/DeepSeek-V3.1",
|
||||||
|
name: "DeepSeek V3.1",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.6,
|
||||||
|
output: 1.25,
|
||||||
|
cacheRead: 0.6,
|
||||||
|
cacheWrite: 0.6,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "deepseek-ai/DeepSeek-R1",
|
||||||
|
name: "DeepSeek R1",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 3.0,
|
||||||
|
output: 7.0,
|
||||||
|
cacheRead: 3.0,
|
||||||
|
cacheWrite: 3.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "Qwen/Qwen2.5-72B-Instruct-Turbo",
|
||||||
|
name: "Qwen 2.5 72B Instruct Turbo",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.35,
|
||||||
|
output: 0.8,
|
||||||
|
cacheRead: 0.35,
|
||||||
|
cacheWrite: 0.35,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
||||||
|
name: "Mixtral 8x7B Instruct v0.1",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 32768,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.6,
|
||||||
|
output: 0.6,
|
||||||
|
cacheRead: 0.6,
|
||||||
|
cacheWrite: 0.6,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export async function resolveImplicitProviders(params: {
|
export async function resolveImplicitProviders(params: {
|
||||||
agentDir: string;
|
agentDir: string;
|
||||||
}): Promise<ModelsConfig["providers"]> {
|
}): Promise<ModelsConfig["providers"]> {
|
||||||
@ -418,6 +525,13 @@ export async function resolveImplicitProviders(params: {
|
|||||||
providers.ollama = { ...(await buildOllamaProvider()), apiKey: ollamaKey };
|
providers.ollama = { ...(await buildOllamaProvider()), apiKey: ollamaKey };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const togetherKey =
|
||||||
|
resolveEnvApiKeyVarName("together") ??
|
||||||
|
resolveApiKeyFromProfiles({ provider: "together", store: authStore });
|
||||||
|
if (togetherKey) {
|
||||||
|
providers.together = { ...buildTogetherProvider(), apiKey: togetherKey };
|
||||||
|
}
|
||||||
|
|
||||||
return providers;
|
return providers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,121 +0,0 @@
|
|||||||
import type { ModelDefinitionConfig } from "../config/types.js";
|
|
||||||
|
|
||||||
export const TOGETHER_BASE_URL = "https://api.together.xyz/v1";
|
|
||||||
export const TOGETHER_DEFAULT_MODEL_ID = "meta-llama/Llama-3.3-70B-Instruct-Turbo";
|
|
||||||
export const TOGETHER_DEFAULT_MODEL_REF = `together/${TOGETHER_DEFAULT_MODEL_ID}`;
|
|
||||||
|
|
||||||
export const TOGETHER_MODEL_CATALOG = [
|
|
||||||
{
|
|
||||||
id: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
||||||
name: "Llama 3.3 70B Instruct Turbo",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 131072,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 0.88,
|
|
||||||
output: 0.88,
|
|
||||||
cacheRead: 0.88,
|
|
||||||
cacheWrite: 0.88,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
|
|
||||||
name: "Llama 4 Scout 17B 16E Instruct",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text", "image"],
|
|
||||||
contextWindow: 10000000,
|
|
||||||
maxTokens: 32768,
|
|
||||||
cost: {
|
|
||||||
input: 0.18,
|
|
||||||
output: 0.59,
|
|
||||||
cacheRead: 0.18,
|
|
||||||
cacheWrite: 0.18,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
|
|
||||||
name: "Llama 4 Maverick 17B 128E Instruct FP8",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text", "image"],
|
|
||||||
contextWindow: 20000000,
|
|
||||||
maxTokens: 32768,
|
|
||||||
cost: {
|
|
||||||
input: 0.27,
|
|
||||||
output: 0.85,
|
|
||||||
cacheRead: 0.27,
|
|
||||||
cacheWrite: 0.27,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "deepseek-ai/DeepSeek-V3.1",
|
|
||||||
name: "DeepSeek V3.1",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 131072,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 0.6,
|
|
||||||
output: 1.25,
|
|
||||||
cacheRead: 0.6,
|
|
||||||
cacheWrite: 0.6,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "deepseek-ai/DeepSeek-R1",
|
|
||||||
name: "DeepSeek R1",
|
|
||||||
reasoning: true,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 131072,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 3.0,
|
|
||||||
output: 7.0,
|
|
||||||
cacheRead: 3.0,
|
|
||||||
cacheWrite: 3.0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "Qwen/Qwen2.5-72B-Instruct-Turbo",
|
|
||||||
name: "Qwen 2.5 72B Instruct Turbo",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 131072,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 0.35,
|
|
||||||
output: 0.8,
|
|
||||||
cacheRead: 0.35,
|
|
||||||
cacheWrite: 0.35,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
|
||||||
name: "Mixtral 8x7B Instruct v0.1",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 32768,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 0.6,
|
|
||||||
output: 0.6,
|
|
||||||
cacheRead: 0.6,
|
|
||||||
cacheWrite: 0.6,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export function buildTogetherModelDefinition(
|
|
||||||
model: (typeof TOGETHER_MODEL_CATALOG)[number],
|
|
||||||
): ModelDefinitionConfig {
|
|
||||||
return {
|
|
||||||
id: model.id,
|
|
||||||
name: model.name,
|
|
||||||
api: "openai-completions",
|
|
||||||
reasoning: model.reasoning,
|
|
||||||
input: [...model.input],
|
|
||||||
cost: model.cost,
|
|
||||||
contextWindow: model.contextWindow,
|
|
||||||
maxTokens: model.maxTokens,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -4,11 +4,111 @@ import {
|
|||||||
SYNTHETIC_DEFAULT_MODEL_REF,
|
SYNTHETIC_DEFAULT_MODEL_REF,
|
||||||
SYNTHETIC_MODEL_CATALOG,
|
SYNTHETIC_MODEL_CATALOG,
|
||||||
} from "../agents/synthetic-models.js";
|
} from "../agents/synthetic-models.js";
|
||||||
import {
|
|
||||||
buildTogetherModelDefinition,
|
// Together AI constants and models - inline to avoid separate models file
|
||||||
TOGETHER_BASE_URL,
|
const TOGETHER_BASE_URL = "https://api.together.xyz/v1";
|
||||||
TOGETHER_MODEL_CATALOG,
|
const TOGETHER_MODEL_CATALOG = [
|
||||||
} from "../agents/together-models.js";
|
{
|
||||||
|
id: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
||||||
|
name: "Llama 3.3 70B Instruct Turbo",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.88,
|
||||||
|
output: 0.88,
|
||||||
|
cacheRead: 0.88,
|
||||||
|
cacheWrite: 0.88,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "meta-llama/Llama-4-Scout-17B-16E-Instruct",
|
||||||
|
name: "Llama 4 Scout 17B 16E Instruct",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text", "image"],
|
||||||
|
contextWindow: 10000000,
|
||||||
|
maxTokens: 32768,
|
||||||
|
cost: {
|
||||||
|
input: 0.18,
|
||||||
|
output: 0.59,
|
||||||
|
cacheRead: 0.18,
|
||||||
|
cacheWrite: 0.18,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
|
||||||
|
name: "Llama 4 Maverick 17B 128E Instruct FP8",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text", "image"],
|
||||||
|
contextWindow: 20000000,
|
||||||
|
maxTokens: 32768,
|
||||||
|
cost: {
|
||||||
|
input: 0.27,
|
||||||
|
output: 0.85,
|
||||||
|
cacheRead: 0.27,
|
||||||
|
cacheWrite: 0.27,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "deepseek-ai/DeepSeek-V3.1",
|
||||||
|
name: "DeepSeek V3.1",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.6,
|
||||||
|
output: 1.25,
|
||||||
|
cacheRead: 0.6,
|
||||||
|
cacheWrite: 0.6,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "deepseek-ai/DeepSeek-R1",
|
||||||
|
name: "DeepSeek R1",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 3.0,
|
||||||
|
output: 7.0,
|
||||||
|
cacheRead: 3.0,
|
||||||
|
cacheWrite: 3.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "Qwen/Qwen2.5-72B-Instruct-Turbo",
|
||||||
|
name: "Qwen 2.5 72B Instruct Turbo",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 131072,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.35,
|
||||||
|
output: 0.8,
|
||||||
|
cacheRead: 0.35,
|
||||||
|
cacheWrite: 0.35,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function buildTogetherModelDefinition(
|
||||||
|
model: (typeof TOGETHER_MODEL_CATALOG)[number],
|
||||||
|
): ModelDefinitionConfig {
|
||||||
|
return {
|
||||||
|
id: model.id,
|
||||||
|
name: model.name,
|
||||||
|
api: "openai-completions",
|
||||||
|
reasoning: model.reasoning,
|
||||||
|
input: model.input as ("text" | "image")[],
|
||||||
|
cost: model.cost,
|
||||||
|
contextWindow: model.contextWindow,
|
||||||
|
maxTokens: model.maxTokens,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
import {
|
import {
|
||||||
buildVeniceModelDefinition,
|
buildVeniceModelDefinition,
|
||||||
VENICE_BASE_URL,
|
VENICE_BASE_URL,
|
||||||
@ -16,6 +116,7 @@ import {
|
|||||||
VENICE_MODEL_CATALOG,
|
VENICE_MODEL_CATALOG,
|
||||||
} from "../agents/venice-models.js";
|
} from "../agents/venice-models.js";
|
||||||
import type { ClawdbotConfig } from "../config/config.js";
|
import type { ClawdbotConfig } from "../config/config.js";
|
||||||
|
import type { ModelDefinitionConfig } from "../config/types.models.js";
|
||||||
import {
|
import {
|
||||||
OPENROUTER_DEFAULT_MODEL_REF,
|
OPENROUTER_DEFAULT_MODEL_REF,
|
||||||
TOGETHER_DEFAULT_MODEL_REF,
|
TOGETHER_DEFAULT_MODEL_REF,
|
||||||
|
|||||||
@ -68,10 +68,5 @@ export {
|
|||||||
MOONSHOT_DEFAULT_MODEL_ID,
|
MOONSHOT_DEFAULT_MODEL_ID,
|
||||||
MOONSHOT_DEFAULT_MODEL_REF,
|
MOONSHOT_DEFAULT_MODEL_REF,
|
||||||
} from "./onboard-auth.models.js";
|
} from "./onboard-auth.models.js";
|
||||||
export {
|
// Together AI constants are now defined inline in onboard-auth.config-core.ts
|
||||||
buildTogetherModelDefinition,
|
export { TOGETHER_DEFAULT_MODEL_REF } from "./onboard-auth.credentials.js";
|
||||||
TOGETHER_BASE_URL,
|
|
||||||
TOGETHER_DEFAULT_MODEL_ID,
|
|
||||||
TOGETHER_DEFAULT_MODEL_REF,
|
|
||||||
TOGETHER_MODEL_CATALOG,
|
|
||||||
} from "../agents/together-models.js";
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user