@johnhenry/aimatey-frontend
v0.3.1
Published
Frontend adapters for Aimatey - Universal AI Adapter System
Downloads
1,044
Maintainers
Readme
@johnhenry/aimatey-frontend
Note: Previously published as
[email protected].
Frontend adapters for Aimatey - Universal AI Adapter System.
Part of the aimatey monorepo.
Installation
npm install @johnhenry/aimatey-frontendOverview
Frontend adapters convert provider-specific request formats to the Universal IR (Intermediate Representation) format used internally by Aimatey. This allows your application to accept requests in any provider's format and route them to any backend.
Included Adapters
- OpenAI - OpenAI Chat Completions API format
- Anthropic - Anthropic Messages API format
- Gemini - Google Gemini API format
- Mistral - Mistral API format
- Ollama - Ollama API format
- Chrome AI - Chrome AI format
- Generic - Passthrough adapter for IR format
- TypeSafe (Jev) -
@typesafe-ai/sdk-shaped typed-decision calls, translated to the Decision IR (not chat -- seepackages/backend's "Typed-Decision Models" section) - Laya -
Router.predict()/Agent.system_one()-shaped typed-decision calls, translated to the Decision IR. Pairs withLayaBackendAdapterin@johnhenry/aimatey-native-laya, which runs Laya's real ONNX model in-process via@receptron/laya-- no hosted API, no Python service
Usage
import { OpenAIFrontendAdapter, AnthropicFrontendAdapter } from '@johnhenry/aimatey-frontend';
import { Bridge } from '@johnhenry/aimatey-core';
// Accept OpenAI-formatted requests
const openAIFrontend = new OpenAIFrontendAdapter();
// Accept Anthropic-formatted requests
const anthropicFrontend = new AnthropicFrontendAdapter();
// Create a bridge that accepts OpenAI format
const bridge = new Bridge(openAIFrontend, yourBackend);Generic Adapter
The Generic adapter passes IR format directly without conversion:
import { GenericFrontendAdapter, createGenericFrontend } from '@johnhenry/aimatey-frontend';
const frontend = createGenericFrontend();API Reference
See the TypeScript definitions for detailed API documentation.
License
MIT - see LICENSE for details.
