feat: add Venice AI provider with 158 models
Some checks are pending
CI / build-check-test (push) Waiting to run

- Add venice.ts OAuth provider implementation
- Register Venice in BUILT_IN_OAUTH_PROVIDERS
- Add KnownProvider type entry for venice
- Map VENICE_API_KEY in env-api-keys.ts
- Set llama-3.3-70b as default Venice model in model-resolver.ts
- Add full Venice model catalog (158 models) to models.generated.ts
- Bump jae-tui and jae-agent-core to 0.62.1
This commit is contained in:
JAE 2026-03-25 16:01:41 +00:00
parent 71eeb5cb8f
commit 76c500497d
9 changed files with 2135 additions and 6 deletions

4
package-lock.json generated
View file

@ -8495,7 +8495,7 @@
}, },
"packages/agent": { "packages/agent": {
"name": "@jaeswift/jae-agent-core", "name": "@jaeswift/jae-agent-core",
"version": "0.62.0", "version": "0.62.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@jaeswift/jae-ai": "^0.62.0" "@jaeswift/jae-ai": "^0.62.0"
@ -8733,7 +8733,7 @@
}, },
"packages/tui": { "packages/tui": {
"name": "@jaeswift/jae-tui", "name": "@jaeswift/jae-tui",
"version": "0.62.0", "version": "0.62.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@types/mime-types": "^2.1.4", "@types/mime-types": "^2.1.4",

View file

@ -1,6 +1,6 @@
{ {
"name": "@jaeswift/jae-agent-core", "name": "@jaeswift/jae-agent-core",
"version": "0.62.0", "version": "0.62.1",
"description": "General-purpose agent with transport abstraction, state management, and attachment support", "description": "General-purpose agent with transport abstraction, state management, and attachment support",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",

View file

@ -126,6 +126,7 @@ export function getEnvApiKey(provider: any): string | undefined {
opencode: "OPENCODE_API_KEY", opencode: "OPENCODE_API_KEY",
"opencode-go": "OPENCODE_API_KEY", "opencode-go": "OPENCODE_API_KEY",
"kimi-coding": "KIMI_API_KEY", "kimi-coding": "KIMI_API_KEY",
venice: "VENICE_API_KEY",
}; };
const envVar = envMap[provider]; const envVar = envMap[provider];

File diff suppressed because it is too large Load diff

View file

@ -39,7 +39,8 @@ export type KnownProvider =
| "huggingface" | "huggingface"
| "opencode" | "opencode"
| "opencode-go" | "opencode-go"
| "kimi-coding"; | "kimi-coding"
| "venice";
export type Provider = KnownProvider | string; export type Provider = KnownProvider | string;
export type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh"; export type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh";
@ -89,6 +90,8 @@ export interface StreamOptions {
* Not supported by all providers (e.g., AWS Bedrock uses SDK auth). * Not supported by all providers (e.g., AWS Bedrock uses SDK auth).
*/ */
headers?: Record<string, string>; headers?: Record<string, string>;
/** Capability tags (e.g. 'tools', 'vision', 'reasoning', 'code', 'image-generation', etc.) */
tags?: string[];
/** /**
* Maximum delay in milliseconds to wait for a retry when the server requests a long wait. * Maximum delay in milliseconds to wait for a retry when the server requests a long wait.
* If the server's requested delay exceeds this value, the request fails immediately * If the server's requested delay exceeds this value, the request fails immediately
@ -328,6 +331,8 @@ export interface Model<TApi extends Api> {
contextWindow: number; contextWindow: number;
maxTokens: number; maxTokens: number;
headers?: Record<string, string>; headers?: Record<string, string>;
/** Capability tags (e.g. 'tools', 'vision', 'reasoning', 'code', 'image-generation', etc.) */
tags?: string[];
/** Compatibility overrides for OpenAI-compatible APIs. If not set, auto-detected from baseUrl. */ /** Compatibility overrides for OpenAI-compatible APIs. If not set, auto-detected from baseUrl. */
compat?: TApi extends "openai-completions" compat?: TApi extends "openai-completions"
? OpenAICompletionsCompat ? OpenAICompletionsCompat

View file

@ -25,6 +25,8 @@ export { antigravityOAuthProvider, loginAntigravity, refreshAntigravityToken } f
export { geminiCliOAuthProvider, loginGeminiCli, refreshGoogleCloudToken } from "./google-gemini-cli.js"; export { geminiCliOAuthProvider, loginGeminiCli, refreshGoogleCloudToken } from "./google-gemini-cli.js";
// OpenAI Codex (ChatGPT OAuth) // OpenAI Codex (ChatGPT OAuth)
export { loginOpenAICodex, openaiCodexOAuthProvider, refreshOpenAICodexToken } from "./openai-codex.js"; export { loginOpenAICodex, openaiCodexOAuthProvider, refreshOpenAICodexToken } from "./openai-codex.js";
// Venice AI (API Key)
export { loginVenice, veniceOAuthProvider, refreshVeniceToken } from "./venice.js";
export * from "./types.js"; export * from "./types.js";
@ -37,6 +39,7 @@ import { githubCopilotOAuthProvider } from "./github-copilot.js";
import { antigravityOAuthProvider } from "./google-antigravity.js"; import { antigravityOAuthProvider } from "./google-antigravity.js";
import { geminiCliOAuthProvider } from "./google-gemini-cli.js"; import { geminiCliOAuthProvider } from "./google-gemini-cli.js";
import { openaiCodexOAuthProvider } from "./openai-codex.js"; import { openaiCodexOAuthProvider } from "./openai-codex.js";
import { veniceOAuthProvider } from "./venice.js";
import type { OAuthCredentials, OAuthProviderId, OAuthProviderInfo, OAuthProviderInterface } from "./types.js"; import type { OAuthCredentials, OAuthProviderId, OAuthProviderInfo, OAuthProviderInterface } from "./types.js";
const BUILT_IN_OAUTH_PROVIDERS: OAuthProviderInterface[] = [ const BUILT_IN_OAUTH_PROVIDERS: OAuthProviderInterface[] = [
@ -45,6 +48,7 @@ const BUILT_IN_OAUTH_PROVIDERS: OAuthProviderInterface[] = [
geminiCliOAuthProvider, geminiCliOAuthProvider,
antigravityOAuthProvider, antigravityOAuthProvider,
openaiCodexOAuthProvider, openaiCodexOAuthProvider,
veniceOAuthProvider,
]; ];
const oauthProviderRegistry = new Map<string, OAuthProviderInterface>( const oauthProviderRegistry = new Map<string, OAuthProviderInterface>(

View file

@ -0,0 +1,54 @@
import type { OAuthCredentials, OAuthLoginCallbacks, OAuthProviderInterface } from "./types.js";
/**
* Venice AI API key provider.
*
* Venice uses API key authentication rather than OAuth, but implements
* OAuthProviderInterface so it integrates cleanly with JAE's /login flow.
*
* Get your API key at: https://venice.ai/settings/api
*/
export async function loginVenice(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials> {
callbacks.onProgress?.("To get an API key, visit https://venice.ai/settings/api");
const apiKey = await callbacks.onPrompt({
message: "Enter your Venice AI API key:",
placeholder: "e.g. your_venice_api_key",
});
if (!apiKey || !apiKey.trim()) {
throw new Error("No API key provided");
}
return {
access: apiKey.trim(),
refresh: "",
// API keys don't expire — set a 10-year window so the refresh path is never hit
expires: Date.now() + 1000 * 60 * 60 * 24 * 365 * 10,
};
}
export async function refreshVeniceToken(credentials: OAuthCredentials): Promise<OAuthCredentials> {
// API keys don't expire, just bump the expiry forward
return {
...credentials,
expires: Date.now() + 1000 * 60 * 60 * 24 * 365 * 10,
};
}
export const veniceOAuthProvider: OAuthProviderInterface = {
id: "venice",
name: "Venice AI (API Key)",
async login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials> {
return loginVenice(callbacks);
},
async refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials> {
return refreshVeniceToken(credentials);
},
getApiKey(credentials: OAuthCredentials): string {
return credentials.access;
},
};

View file

@ -35,6 +35,7 @@ export const defaultModelPerProvider: Record<KnownProvider, string> = {
opencode: "claude-opus-4-6", opencode: "claude-opus-4-6",
"opencode-go": "kimi-k2.5", "opencode-go": "kimi-k2.5",
"kimi-coding": "kimi-k2-thinking", "kimi-coding": "kimi-k2-thinking",
venice: "llama-3.3-70b",
}; };
export interface ScopedModel { export interface ScopedModel {

View file

@ -1,6 +1,6 @@
{ {
"name": "@jaeswift/jae-tui", "name": "@jaeswift/jae-tui",
"version": "0.62.0", "version": "0.62.1",
"description": "Terminal User Interface library with differential rendering for efficient text-based applications", "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",