reworking files
This commit is contained in:
parent
9447fcee01
commit
90e1c4f801
@ -11,6 +11,122 @@ export const TOGETHER_DEFAULT_COST = {
|
|||||||
cacheWrite: 0.5,
|
cacheWrite: 0.5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const TOGETHER_MODEL_CATALOG = [
|
||||||
|
{
|
||||||
|
id: "zai-org/GLM-4.7",
|
||||||
|
name: "GLM 4.7 Fp8",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 202752,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 0.45,
|
||||||
|
output: 2.0,
|
||||||
|
cacheRead: 0.45,
|
||||||
|
cacheWrite: 2.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: "moonshotai/Kimi-K2-Instruct-0905",
|
||||||
|
name: "Kimi K2-Instruct 0905",
|
||||||
|
reasoning: false,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 262144,
|
||||||
|
maxTokens: 8192,
|
||||||
|
cost: {
|
||||||
|
input: 1.0,
|
||||||
|
output: 3.0,
|
||||||
|
cacheRead: 1.0,
|
||||||
|
cacheWrite: 3.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
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 as ("text" | "image")[],
|
||||||
|
cost: model.cost,
|
||||||
|
contextWindow: model.contextWindow,
|
||||||
|
maxTokens: model.maxTokens,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Together AI API response types
|
// Together AI API response types
|
||||||
interface TogetherModel {
|
interface TogetherModel {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@ -5,123 +5,11 @@ import {
|
|||||||
SYNTHETIC_MODEL_CATALOG,
|
SYNTHETIC_MODEL_CATALOG,
|
||||||
} from "../agents/synthetic-models.js";
|
} from "../agents/synthetic-models.js";
|
||||||
|
|
||||||
// Together AI constants and models - inline to avoid separate models file
|
import {
|
||||||
const TOGETHER_BASE_URL = "https://api.together.xyz/v1";
|
TOGETHER_BASE_URL,
|
||||||
const TOGETHER_MODEL_CATALOG = [
|
TOGETHER_MODEL_CATALOG,
|
||||||
{
|
buildTogetherModelDefinition,
|
||||||
id: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
} from "../agents/together-models.js";
|
||||||
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: "zai-org/GLM-4.7",
|
|
||||||
name: "GLM 4.7 Fp8",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 202752,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 0.45,
|
|
||||||
output: 2.0,
|
|
||||||
cacheRead: 0.45,
|
|
||||||
cacheWrite: 2.0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "moonshotai/Kimi-K2-Instruct-0905",
|
|
||||||
name: "Kimi K2-Instruct 0905",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
contextWindow: 262144,
|
|
||||||
maxTokens: 8192,
|
|
||||||
cost: {
|
|
||||||
input: 1.0,
|
|
||||||
output: 3.0,
|
|
||||||
cacheRead: 1.0,
|
|
||||||
cacheWrite: 3.0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
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,
|
||||||
@ -130,7 +18,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,
|
||||||
|
|||||||
@ -115,7 +115,7 @@ export async function setVeniceApiKey(key: string, agentDir?: string) {
|
|||||||
export const ZAI_DEFAULT_MODEL_REF = "zai/glm-4.7";
|
export const ZAI_DEFAULT_MODEL_REF = "zai/glm-4.7";
|
||||||
export const OPENROUTER_DEFAULT_MODEL_REF = "openrouter/auto";
|
export const OPENROUTER_DEFAULT_MODEL_REF = "openrouter/auto";
|
||||||
export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF = "vercel-ai-gateway/anthropic/claude-opus-4.5";
|
export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF = "vercel-ai-gateway/anthropic/claude-opus-4.5";
|
||||||
export const TOGETHER_DEFAULT_MODEL_REF = "together/meta-llama/Llama-3.3-70B-Instruct-Turbo";
|
export const TOGETHER_DEFAULT_MODEL_REF = "together/zai-org/GLM-4.7";
|
||||||
|
|
||||||
export async function setZaiApiKey(key: string, agentDir?: string) {
|
export async function setZaiApiKey(key: string, agentDir?: string) {
|
||||||
// Write to resolved agent dir so gateway finds credentials on startup.
|
// Write to resolved agent dir so gateway finds credentials on startup.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user