mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 08:03:39 +00:00
feat(ai): Rename package to @mariozechner/pi-ai and improve documentation
- Changed package name from @mariozechner/ai to @mariozechner/pi-ai - Fixed generate-models.ts to fetch from models.dev API instead of local file - Completely rewrote README with practical examples: - Image input with base64 encoding - Proper tool calling with context management - Streaming with completion indicators - Abort signal usage - Provider-specific options (reasoning/thinking) - Custom model definitions for local/self-hosted LLMs - Environment variables explanation - Bumped version to 0.5.9 and published
This commit is contained in:
parent
796e48b80e
commit
d46a98ec10
13 changed files with 388 additions and 210 deletions
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -2716,7 +2716,7 @@
|
|||
},
|
||||
"packages/agent": {
|
||||
"name": "@mariozechner/pi-agent",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-tui": "^0.5.8",
|
||||
|
|
@ -3098,7 +3098,7 @@
|
|||
},
|
||||
"packages/ai": {
|
||||
"name": "@mariozechner/ai",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.60.0",
|
||||
|
|
@ -3134,7 +3134,7 @@
|
|||
},
|
||||
"packages/pods": {
|
||||
"name": "@mariozechner/pi",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-agent": "^0.5.8",
|
||||
|
|
@ -3150,7 +3150,7 @@
|
|||
},
|
||||
"packages/tui": {
|
||||
"name": "@mariozechner/pi-tui",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime-types": "^2.1.4",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
],
|
||||
"scripts": {
|
||||
"clean": "npm run clean --workspaces",
|
||||
"build": "npm run build -w @mariozechner/pi-tui && npm run build -w @mariozechner/ai && npm run build -w @mariozechner/pi-agent && npm run build -w @mariozechner/pi",
|
||||
"build": "npm run build -w @mariozechner/pi-tui && npm run build -w @mariozechner/pi-ai && npm run build -w @mariozechner/pi-agent && npm run build -w @mariozechner/pi",
|
||||
"check": "biome check --write . && npm run check --workspaces && tsc --noEmit",
|
||||
"test": "npm run test --workspaces --if-present",
|
||||
"version:patch": "npm version patch -ws --no-git-tag-version && node scripts/sync-versions.js",
|
||||
|
|
|
|||
4
packages/agent/package-lock.json
generated
4
packages/agent/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@mariozechner/pi-agent",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@mariozechner/pi-agent",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/tui": "^0.1.1",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mariozechner/pi-agent",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"description": "General-purpose agent with tool calling and session persistence",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
"prepublishOnly": "npm run clean && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-tui": "^0.5.8",
|
||||
"@mariozechner/pi-tui": "^0.5.9",
|
||||
"@types/glob": "^8.1.0",
|
||||
"chalk": "^5.5.0",
|
||||
"glob": "^11.0.3",
|
||||
|
|
|
|||
|
|
@ -1,69 +1,230 @@
|
|||
# @mariozechner/ai
|
||||
# @mariozechner/pi-ai
|
||||
|
||||
Unified API for OpenAI, Anthropic, and Google Gemini LLM providers with streaming, tool calling, and thinking support.
|
||||
Unified LLM API with automatic model discovery, provider configuration, token and cost tracking, and simple context persistence and hand-off to other models mid-session.
|
||||
|
||||
## Supported Providers
|
||||
|
||||
- **OpenAI**
|
||||
- **Anthropic**
|
||||
- **Google**
|
||||
- **Groq**
|
||||
- **Cerebras**
|
||||
- **xAI**
|
||||
- **OpenRouter**
|
||||
- **Any OpenAI-compatible API**: Ollama, vLLM, LM Studio, etc.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @mariozechner/ai
|
||||
npm install @mariozechner/pi-ai
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
```typescript
|
||||
import { AnthropicLLM } from '@mariozechner/ai/providers/anthropic';
|
||||
import { OpenAICompletionsLLM } from '@mariozechner/ai/providers/openai-completions';
|
||||
import { GoogleLLM } from '@mariozechner/ai/providers/gemini';
|
||||
import { createLLM } from '@mariozechner/pi-ai';
|
||||
|
||||
// Pick your provider - same API for all
|
||||
const llm = new AnthropicLLM('claude-sonnet-4-0');
|
||||
// const llm = new OpenAICompletionsLLM('gpt-5-mini');
|
||||
// const llm = new GoogleLLM('gemini-2.5-flash');
|
||||
const llm = createLLM('openai', 'gpt-4o-mini');
|
||||
|
||||
// Basic completion
|
||||
const response = await llm.complete({
|
||||
messages: [{ role: 'user', content: 'Hello!' }]
|
||||
});
|
||||
|
||||
console.log(response.content);
|
||||
```
|
||||
|
||||
// Streaming with thinking
|
||||
const streamResponse = await llm.complete({
|
||||
messages: [{ role: 'user', content: 'Explain quantum computing' }]
|
||||
}, {
|
||||
onText: (chunk) => process.stdout.write(chunk),
|
||||
onThinking: (chunk) => process.stderr.write(chunk),
|
||||
// Provider specific config
|
||||
thinking: { enabled: true }
|
||||
## Image Input
|
||||
|
||||
```typescript
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
const imageBuffer = readFileSync('image.png');
|
||||
const base64Image = imageBuffer.toString('base64');
|
||||
|
||||
const response = await llm.complete({
|
||||
messages: [{
|
||||
role: 'user',
|
||||
content: [
|
||||
{ type: 'text', text: 'What is in this image?' },
|
||||
{ type: 'image', data: base64Image, mimeType: 'image/png' }
|
||||
]
|
||||
}]
|
||||
});
|
||||
```
|
||||
|
||||
// Tool calling
|
||||
## Tool Calling
|
||||
|
||||
```typescript
|
||||
const tools = [{
|
||||
name: 'calculator',
|
||||
description: 'Perform calculations',
|
||||
name: 'get_weather',
|
||||
description: 'Get current weather for a location',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
expression: { type: 'string' }
|
||||
location: { type: 'string' }
|
||||
},
|
||||
required: ['expression']
|
||||
required: ['location']
|
||||
}
|
||||
}];
|
||||
|
||||
const toolResponse = await llm.complete({
|
||||
messages: [{ role: 'user', content: 'What is 15 * 27?' }],
|
||||
tools
|
||||
});
|
||||
const messages = [];
|
||||
messages.push({ role: 'user', content: 'What is the weather in Paris?' });
|
||||
|
||||
if (toolResponse.toolCalls) {
|
||||
for (const call of toolResponse.toolCalls) {
|
||||
console.log(`Tool: ${call.name}, Args:`, call.arguments);
|
||||
const response = await llm.complete({ messages, tools });
|
||||
messages.push(response);
|
||||
|
||||
if (response.toolCalls) {
|
||||
for (const call of response.toolCalls) {
|
||||
// Call your actual function
|
||||
const result = await getWeather(call.arguments.location);
|
||||
|
||||
// Add tool result to context
|
||||
messages.push({
|
||||
role: 'toolResult',
|
||||
content: JSON.stringify(result),
|
||||
toolCallId: call.id,
|
||||
isError: false
|
||||
});
|
||||
}
|
||||
|
||||
// Continue conversation with tool results
|
||||
const followUp = await llm.complete({ messages, tools });
|
||||
messages.push(followUp);
|
||||
console.log(followUp.content);
|
||||
}
|
||||
```
|
||||
|
||||
## Streaming
|
||||
|
||||
```typescript
|
||||
const response = await llm.complete({
|
||||
messages: [{ role: 'user', content: 'Write a story' }]
|
||||
}, {
|
||||
onText: (chunk, complete) => {
|
||||
process.stdout.write(chunk);
|
||||
if (complete) console.log('\n[Text streaming complete]');
|
||||
},
|
||||
onThinking: (chunk, complete) => {
|
||||
process.stderr.write(chunk);
|
||||
if (complete) console.error('\n[Thinking complete]');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Abort Signal
|
||||
|
||||
```typescript
|
||||
const controller = new AbortController();
|
||||
|
||||
// Abort after 5 seconds
|
||||
setTimeout(() => controller.abort(), 5000);
|
||||
|
||||
try {
|
||||
const response = await llm.complete({
|
||||
messages: [{ role: 'user', content: 'Write a long story' }]
|
||||
}, {
|
||||
signal: controller.signal,
|
||||
onText: (chunk) => process.stdout.write(chunk)
|
||||
});
|
||||
} catch (error) {
|
||||
if (error.name === 'AbortError') {
|
||||
console.log('Request was aborted');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Development
|
||||
## Provider-Specific Options
|
||||
|
||||
This package is part of the pi monorepo. See the main README for development instructions.
|
||||
### OpenAI Reasoning (o1, o3)
|
||||
```typescript
|
||||
const llm = createLLM('openai', 'o1-mini');
|
||||
|
||||
await llm.complete(context, {
|
||||
reasoningEffort: 'medium' // 'minimal' | 'low' | 'medium' | 'high'
|
||||
});
|
||||
```
|
||||
|
||||
### Anthropic Thinking
|
||||
```typescript
|
||||
const llm = createLLM('anthropic', 'claude-3-7-sonnet-latest');
|
||||
|
||||
await llm.complete(context, {
|
||||
thinking: {
|
||||
enabled: true,
|
||||
budgetTokens: 2048 // Optional thinking token limit
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Google Gemini Thinking
|
||||
```typescript
|
||||
const llm = createLLM('google', 'gemini-2.0-flash-thinking-exp');
|
||||
|
||||
await llm.complete(context, {
|
||||
thinking: { enabled: true }
|
||||
});
|
||||
```
|
||||
|
||||
## Custom Models
|
||||
|
||||
### Local Models (Ollama, vLLM, etc.)
|
||||
```typescript
|
||||
import { OpenAICompletionsLLM } from '@mariozechner/pi-ai';
|
||||
|
||||
const model = {
|
||||
id: 'llama3.1:8b',
|
||||
provider: 'ollama',
|
||||
baseUrl: 'http://localhost:11434/v1',
|
||||
reasoning: false,
|
||||
input: ['text'],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 8192,
|
||||
maxTokens: 4096,
|
||||
name: 'Llama 3.1 8B'
|
||||
};
|
||||
|
||||
const llm = new OpenAICompletionsLLM(model, 'dummy-key');
|
||||
```
|
||||
|
||||
### Custom OpenAI-Compatible Endpoints
|
||||
```typescript
|
||||
const model = {
|
||||
id: 'custom-model',
|
||||
provider: 'custom',
|
||||
baseUrl: 'https://your-api.com/v1',
|
||||
reasoning: true,
|
||||
input: ['text', 'image'],
|
||||
cost: { input: 0.5, output: 1.5, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 32768,
|
||||
maxTokens: 8192,
|
||||
name: 'Custom Model'
|
||||
};
|
||||
|
||||
const llm = new OpenAICompletionsLLM(model, 'your-api-key');
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Set these environment variables to use `createLLM` without passing API keys:
|
||||
|
||||
```bash
|
||||
OPENAI_API_KEY=sk-...
|
||||
ANTHROPIC_API_KEY=sk-ant-...
|
||||
GEMINI_API_KEY=...
|
||||
GROQ_API_KEY=gsk_...
|
||||
CEREBRAS_API_KEY=csk-...
|
||||
XAI_API_KEY=xai-...
|
||||
OPENROUTER_API_KEY=sk-or-...
|
||||
```
|
||||
|
||||
When set, you can omit the API key parameter:
|
||||
```typescript
|
||||
// Uses OPENAI_API_KEY from environment
|
||||
const llm = createLLM('openai', 'gpt-4o-mini');
|
||||
|
||||
// Or pass explicitly
|
||||
const llm = createLLM('openai', 'gpt-4o-mini', 'sk-...');
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@mariozechner/ai",
|
||||
"version": "0.5.8",
|
||||
"description": "Unified API for OpenAI, Anthropic, and Google Gemini LLM providers",
|
||||
"name": "@mariozechner/pi-ai",
|
||||
"version": "0.5.9",
|
||||
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env tsx
|
||||
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { writeFileSync } from "fs";
|
||||
import { join, dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
|
|
@ -164,10 +164,11 @@ async function fetchOpenRouterModels(): Promise<NormalizedModel[]> {
|
|||
}
|
||||
}
|
||||
|
||||
function loadModelsDevData(): NormalizedModel[] {
|
||||
async function loadModelsDevData(): Promise<NormalizedModel[]> {
|
||||
try {
|
||||
console.log("Loading models from models.json...");
|
||||
const data = JSON.parse(readFileSync(join(packageRoot, "src/models.json"), "utf-8"));
|
||||
console.log("Fetching models from models.dev API...");
|
||||
const response = await fetch("https://models.dev/api.json");
|
||||
const data = await response.json();
|
||||
|
||||
const models: NormalizedModel[] = [];
|
||||
|
||||
|
|
@ -232,7 +233,7 @@ function loadModelsDevData(): NormalizedModel[] {
|
|||
async function generateModels() {
|
||||
// Fetch all models
|
||||
const openRouterModels = await fetchOpenRouterModels();
|
||||
const modelsDevModels = loadModelsDevData();
|
||||
const modelsDevModels = await loadModelsDevData();
|
||||
|
||||
// Combine models (models.dev takes priority for Groq/Cerebras)
|
||||
const allModels = [...modelsDevModels, ...openRouterModels];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// @mariozechner/ai - Unified API for OpenAI, Anthropic, and Google Gemini
|
||||
// @mariozechner/pi-ai - Unified LLM API with automatic model discovery
|
||||
// This package provides a common interface for working with multiple LLM providers
|
||||
|
||||
export const version = "0.5.8";
|
||||
|
|
|
|||
|
|
@ -6,54 +6,6 @@ import type { Model } from "./types.js";
|
|||
export const PROVIDERS = {
|
||||
groq: {
|
||||
models: {
|
||||
"deepseek-r1-distill-llama-70b": {
|
||||
id: "deepseek-r1-distill-llama-70b",
|
||||
name: "DeepSeek R1 Distill Llama 70B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.75,
|
||||
output: 0.99,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"llama3-70b-8192": {
|
||||
id: "llama3-70b-8192",
|
||||
name: "Llama 3 70B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.59,
|
||||
output: 0.79,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 8192,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"llama-3.3-70b-versatile": {
|
||||
id: "llama-3.3-70b-versatile",
|
||||
name: "Llama 3.3 70B Versatile",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.59,
|
||||
output: 0.79,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 32768,
|
||||
} satisfies Model,
|
||||
"llama-3.1-8b-instant": {
|
||||
id: "llama-3.1-8b-instant",
|
||||
name: "Llama 3.1 8B Instant",
|
||||
|
|
@ -86,37 +38,37 @@ export const PROVIDERS = {
|
|||
contextWindow: 131072,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"gemma2-9b-it": {
|
||||
id: "gemma2-9b-it",
|
||||
name: "Gemma 2 9B",
|
||||
"llama3-70b-8192": {
|
||||
id: "llama3-70b-8192",
|
||||
name: "Llama 3 70B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.2,
|
||||
output: 0.2,
|
||||
input: 0.59,
|
||||
output: 0.79,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 8192,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"mistral-saba-24b": {
|
||||
id: "mistral-saba-24b",
|
||||
name: "Mistral Saba 24B",
|
||||
"deepseek-r1-distill-llama-70b": {
|
||||
id: "deepseek-r1-distill-llama-70b",
|
||||
name: "DeepSeek R1 Distill Llama 70B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: false,
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.79,
|
||||
output: 0.79,
|
||||
input: 0.75,
|
||||
output: 0.99,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32768,
|
||||
maxTokens: 32768,
|
||||
contextWindow: 131072,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"llama3-8b-8192": {
|
||||
id: "llama3-8b-8192",
|
||||
|
|
@ -134,22 +86,54 @@ export const PROVIDERS = {
|
|||
contextWindow: 8192,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"openai/gpt-oss-120b": {
|
||||
id: "openai/gpt-oss-120b",
|
||||
name: "GPT OSS 120B",
|
||||
"gemma2-9b-it": {
|
||||
id: "gemma2-9b-it",
|
||||
name: "Gemma 2 9B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: true,
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.15,
|
||||
output: 0.75,
|
||||
input: 0.2,
|
||||
output: 0.2,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 8192,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"llama-3.3-70b-versatile": {
|
||||
id: "llama-3.3-70b-versatile",
|
||||
name: "Llama 3.3 70B Versatile",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.59,
|
||||
output: 0.79,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 32768,
|
||||
} satisfies Model,
|
||||
"mistral-saba-24b": {
|
||||
id: "mistral-saba-24b",
|
||||
name: "Mistral Saba 24B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.79,
|
||||
output: 0.79,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32768,
|
||||
maxTokens: 32768,
|
||||
} satisfies Model,
|
||||
"openai/gpt-oss-20b": {
|
||||
id: "openai/gpt-oss-20b",
|
||||
name: "GPT OSS 20B",
|
||||
|
|
@ -166,6 +150,22 @@ export const PROVIDERS = {
|
|||
contextWindow: 131072,
|
||||
maxTokens: 32768,
|
||||
} satisfies Model,
|
||||
"openai/gpt-oss-120b": {
|
||||
id: "openai/gpt-oss-120b",
|
||||
name: "GPT OSS 120B",
|
||||
provider: "groq",
|
||||
baseUrl: "https://api.groq.com/openai/v1",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.15,
|
||||
output: 0.75,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 32768,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-4-maverick-17b-128e-instruct": {
|
||||
id: "meta-llama/llama-4-maverick-17b-128e-instruct",
|
||||
name: "Llama 4 Maverick 17B",
|
||||
|
|
@ -1118,6 +1118,22 @@ export const PROVIDERS = {
|
|||
contextWindow: 131072,
|
||||
maxTokens: 96000,
|
||||
} satisfies Model,
|
||||
"qwen/qwq-32b": {
|
||||
id: "qwen/qwq-32b",
|
||||
name: "Qwen: QwQ 32B",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.075,
|
||||
output: 0.15,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-saba": {
|
||||
id: "mistralai/mistral-saba",
|
||||
name: "Mistral: Saba",
|
||||
|
|
@ -1582,22 +1598,6 @@ export const PROVIDERS = {
|
|||
contextWindow: 131072,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-3.1-70b-instruct": {
|
||||
id: "meta-llama/llama-3.1-70b-instruct",
|
||||
name: "Meta: Llama 3.1 70B Instruct",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.09999999999999999,
|
||||
output: 0.28,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-3.1-405b-instruct": {
|
||||
id: "meta-llama/llama-3.1-405b-instruct",
|
||||
name: "Meta: Llama 3.1 405B Instruct",
|
||||
|
|
@ -1614,6 +1614,22 @@ export const PROVIDERS = {
|
|||
contextWindow: 32768,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-3.1-70b-instruct": {
|
||||
id: "meta-llama/llama-3.1-70b-instruct",
|
||||
name: "Meta: Llama 3.1 70B Instruct",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.09999999999999999,
|
||||
output: 0.28,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 131072,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-nemo": {
|
||||
id: "mistralai/mistral-nemo",
|
||||
name: "Mistral: Mistral Nemo",
|
||||
|
|
@ -1630,22 +1646,6 @@ export const PROVIDERS = {
|
|||
contextWindow: 32000,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-7b-instruct-v0.3": {
|
||||
id: "mistralai/mistral-7b-instruct-v0.3",
|
||||
name: "Mistral: Mistral 7B Instruct v0.3",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.028,
|
||||
output: 0.054,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32768,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-7b-instruct:free": {
|
||||
id: "mistralai/mistral-7b-instruct:free",
|
||||
name: "Mistral: Mistral 7B Instruct (free)",
|
||||
|
|
@ -1678,6 +1678,22 @@ export const PROVIDERS = {
|
|||
contextWindow: 32768,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-7b-instruct-v0.3": {
|
||||
id: "mistralai/mistral-7b-instruct-v0.3",
|
||||
name: "Mistral: Mistral 7B Instruct v0.3",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.028,
|
||||
output: 0.054,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32768,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"microsoft/phi-3-mini-128k-instruct": {
|
||||
id: "microsoft/phi-3-mini-128k-instruct",
|
||||
name: "Microsoft: Phi-3 Mini 128K Instruct",
|
||||
|
|
@ -1710,22 +1726,6 @@ export const PROVIDERS = {
|
|||
contextWindow: 128000,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-3-70b-instruct": {
|
||||
id: "meta-llama/llama-3-70b-instruct",
|
||||
name: "Meta: Llama 3 70B Instruct",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.3,
|
||||
output: 0.39999999999999997,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 8192,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-3-8b-instruct": {
|
||||
id: "meta-llama/llama-3-8b-instruct",
|
||||
name: "Meta: Llama 3 8B Instruct",
|
||||
|
|
@ -1742,6 +1742,22 @@ export const PROVIDERS = {
|
|||
contextWindow: 8192,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"meta-llama/llama-3-70b-instruct": {
|
||||
id: "meta-llama/llama-3-70b-instruct",
|
||||
name: "Meta: Llama 3 70B Instruct",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.3,
|
||||
output: 0.39999999999999997,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 8192,
|
||||
maxTokens: 16384,
|
||||
} satisfies Model,
|
||||
"mistralai/mixtral-8x22b-instruct": {
|
||||
id: "mistralai/mixtral-8x22b-instruct",
|
||||
name: "Mistral: Mixtral 8x22B Instruct",
|
||||
|
|
@ -1838,22 +1854,6 @@ export const PROVIDERS = {
|
|||
contextWindow: 128000,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-tiny": {
|
||||
id: "mistralai/mistral-tiny",
|
||||
name: "Mistral Tiny",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.25,
|
||||
output: 0.25,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32768,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-small": {
|
||||
id: "mistralai/mistral-small",
|
||||
name: "Mistral Small",
|
||||
|
|
@ -1870,6 +1870,22 @@ export const PROVIDERS = {
|
|||
contextWindow: 32768,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"mistralai/mistral-tiny": {
|
||||
id: "mistralai/mistral-tiny",
|
||||
name: "Mistral Tiny",
|
||||
provider: "openrouter",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.25,
|
||||
output: 0.25,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32768,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"mistralai/mixtral-8x7b-instruct": {
|
||||
id: "mistralai/mixtral-8x7b-instruct",
|
||||
name: "Mistral: Mixtral 8x7B Instruct",
|
||||
|
|
@ -2457,6 +2473,21 @@ export const PROVIDERS = {
|
|||
contextWindow: 16385,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"gpt-3.5-turbo": {
|
||||
id: "gpt-3.5-turbo",
|
||||
name: "OpenAI: GPT-3.5 Turbo",
|
||||
provider: "openai",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.5,
|
||||
output: 1.5,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 16385,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"gpt-4": {
|
||||
id: "gpt-4",
|
||||
name: "OpenAI: GPT-4",
|
||||
|
|
@ -2487,21 +2518,6 @@ export const PROVIDERS = {
|
|||
contextWindow: 8191,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
"gpt-3.5-turbo": {
|
||||
id: "gpt-3.5-turbo",
|
||||
name: "OpenAI: GPT-3.5 Turbo",
|
||||
provider: "openai",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.5,
|
||||
output: 1.5,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 16385,
|
||||
maxTokens: 4096,
|
||||
} satisfies Model,
|
||||
},
|
||||
},
|
||||
anthropic: {
|
||||
|
|
@ -2581,9 +2597,9 @@ export const PROVIDERS = {
|
|||
contextWindow: 200000,
|
||||
maxTokens: 64000,
|
||||
} satisfies Model,
|
||||
"claude-3-5-haiku-20241022": {
|
||||
id: "claude-3-5-haiku-20241022",
|
||||
name: "Anthropic: Claude 3.5 Haiku (2024-10-22)",
|
||||
"claude-3-5-haiku-latest": {
|
||||
id: "claude-3-5-haiku-latest",
|
||||
name: "Anthropic: Claude 3.5 Haiku",
|
||||
provider: "anthropic",
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
|
|
@ -2596,9 +2612,9 @@ export const PROVIDERS = {
|
|||
contextWindow: 200000,
|
||||
maxTokens: 8192,
|
||||
} satisfies Model,
|
||||
"claude-3-5-haiku-latest": {
|
||||
id: "claude-3-5-haiku-latest",
|
||||
name: "Anthropic: Claude 3.5 Haiku",
|
||||
"claude-3-5-haiku-20241022": {
|
||||
id: "claude-3-5-haiku-20241022",
|
||||
name: "Anthropic: Claude 3.5 Haiku (2024-10-22)",
|
||||
provider: "anthropic",
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
|
|
|
|||
4
packages/pods/package-lock.json
generated
4
packages/pods/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@mariozechner/pi",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@mariozechner/pi",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ai-sdk/openai": "^2.0.5",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mariozechner/pi",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"description": "CLI tool for managing vLLM deployments on GPU pods",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"node": ">=20.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-agent": "^0.5.8",
|
||||
"@mariozechner/pi-agent": "^0.5.9",
|
||||
"chalk": "^5.5.0"
|
||||
},
|
||||
"devDependencies": {}
|
||||
|
|
|
|||
4
packages/tui/package-lock.json
generated
4
packages/tui/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@mariozechner/tui",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@mariozechner/tui",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime-types": "^2.1.4",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mariozechner/pi-tui",
|
||||
"version": "0.5.8",
|
||||
"version": "0.5.9",
|
||||
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue