Skip to content

@aeyeMulti-Provider AI for TypeScript

Intelligent model selection, type-safe context management, and comprehensive provider support.

Quick Example

typescript
import { AI } from '@aeye/ai';
import { OpenAIProvider } from '@aeye/openai';
import z from 'zod';

const openai = new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! });
const ai = AI.with().providers({ openai }).create();

// Define a tool
const getWeather = ai.tool({
  name: 'getWeather',
  description: 'Get weather for a city',
  schema: z.object({ city: z.string() }),
  call: async ({ city }) => ({ temp: 72, condition: 'sunny' }),
});

// Create a prompt that uses the tool
const advisor = ai.prompt({
  name: 'advisor',
  description: 'Travel advisor',
  content: 'Check the weather in {{city}} and suggest what to wear.',
  input: (input: { city: string }) => input,
  tools: [getWeather],
  schema: z.object({ suggestion: z.string() }),
});

const result = await advisor.get('result', { city: 'Paris' });
console.log(result?.suggestion);

Packages

PackageDescription
@aeye/coreCore primitives: Tool, Prompt, Agent, and shared types
@aeye/aiMain AI library with model selection, APIs, and hooks
@aeye/openaiOpenAI provider (chat, images, speech, transcription, embeddings)
@aeye/openrouterOpenRouter multi-provider gateway
@aeye/replicateReplicate open-source model provider
@aeye/awsAWS Bedrock provider (Converse API)
@aeye/modelsAuto-generated model registry with pricing and capabilities

Released under the GPL-3.0 License.