-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvenice.ts
More file actions
134 lines (119 loc) · 3.56 KB
/
Copy pathvenice.ts
File metadata and controls
134 lines (119 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import type { ModelTier } from '../types/index.js'
export const VENICE_BASE_URL = 'https://api.venice.ai/api/v1'
export const VENICE_MODELS = {
coordinator: {
id: 'qwen3-235b-a22b-instruct-2507',
tier: 'mid' as ModelTier,
contextWindow: 128000,
supportsTee: false,
supportsReasoning: true,
description: 'Task planning and synthesis',
},
research: {
id: 'kimi-k2-6',
tier: 'mid' as ModelTier,
contextWindow: 256000,
supportsTee: false,
supportsWebSearch: true,
supportsWebScraping: true,
description: 'Web research and on-chain data gathering',
},
audit: {
id: 'qwen3-235b-a22b-thinking-2507',
tier: 'mid' as ModelTier,
contextWindow: 128000,
supportsTee: false,
supportsReasoning: true,
supportsResponseSchema: true,
description: 'Deep reasoning and structured analysis',
},
report: {
id: 'kimi-k2-5',
tier: 'mid' as ModelTier,
contextWindow: 256000,
supportsTee: false,
description: 'Result synthesis and report generation',
},
tee: {
id: 'e2ee-qwen3-5-122b-a10b',
tier: 'open' as ModelTier,
contextWindow: 32000,
supportsTee: true,
supportsE2EE: true,
description: 'Private inference in hardware enclave',
},
'e2ee-qwen3-6-35b-a3b': {
id: 'e2ee-qwen3-6-35b-a3b',
tier: 'open' as ModelTier,
contextWindow: 128000,
supportsTee: true,
supportsE2EE: true,
description: 'TEE counsel/intelligence agent',
},
'e2ee-gemma-4-26b-a4b-uncensored-p': {
id: 'e2ee-gemma-4-26b-a4b-uncensored-p',
tier: 'open' as ModelTier,
contextWindow: 128000,
supportsTee: true,
supportsE2EE: true,
isUncensored: true,
description: 'TEE reflection agent — uncensored',
},
image: {
id: 'ideogram-v4',
description: 'Chart and visual generation',
pricePerImage: 0.04,
},
tts: {
id: 'tts-kokoro',
description: 'Audio summary generation',
pricePerMillion: 3.5,
},
} as const
export type VeniceAgentModel = keyof typeof VENICE_MODELS
export const VENICE_CRYPTO_RPC_NETWORKS = {
'ethereum-mainnet': 1,
'ethereum-sepolia': 11155111,
'base-mainnet': 8453,
'base-sepolia': 84532,
'arbitrum-mainnet': 42161,
'optimism-mainnet': 10,
'polygon-mainnet': 137,
'linea-mainnet': 59144,
'avalanche-mainnet': 43114,
'bsc-mainnet': 56,
'zksync-mainnet': 324,
} as const
export type VeniceNetwork = keyof typeof VENICE_CRYPTO_RPC_NETWORKS
export function chainIdToVeniceNetwork(
chainId: number
): VeniceNetwork | undefined {
return (
Object.entries(VENICE_CRYPTO_RPC_NETWORKS).find(
([, id]) => id === chainId
)?.[0] as VeniceNetwork | undefined
)
}
export const VENICE_ENDPOINTS = {
chat: `${VENICE_BASE_URL}/chat/completions`,
image: `${VENICE_BASE_URL}/image/generate`,
tts: `${VENICE_BASE_URL}/audio/speech`,
stt: `${VENICE_BASE_URL}/audio/transcriptions`,
embeddings: `${VENICE_BASE_URL}/embeddings`,
rpc: (network: VeniceNetwork) =>
`${VENICE_BASE_URL}/crypto/rpc/${network}`,
models: `${VENICE_BASE_URL}/models`,
x402Balance: (address: string) =>
`${VENICE_BASE_URL}/x402/balance/${address}`,
x402TopUp: `${VENICE_BASE_URL}/x402/top-up`,
x402Transactions: (address: string) =>
`${VENICE_BASE_URL}/x402/transactions/${address}`,
teeAttestation: (model: string, nonce: string) =>
`${VENICE_BASE_URL}/tee/attestation?model=${model}&nonce=${nonce}`,
} as const
export const VENICE_RATE_LIMITS = {
requestsPerMinute: 100,
creditsPerDay: 10_000_000,
} as const
export const VENICE_X402_MIN_BALANCE_USD = 2
export const VENICE_X402_TOP_UP_AMOUNT_USD = 10