@yarlisai/sdk
v0.1.0
Published
Unified AI SDK — compose router, memory, and agents into a single entry point. Part of the Yarlis AI ecosystem.
Maintainers
Readme
@yarlisai/sdk
Unified AI SDK for the Yarlis ecosystem. Composes the router, memory, and agent systems into a single entry point.
Install
npm install @yarlisai/sdkQuick Start
import { YarlisAI } from "@yarlisai/sdk";
import { InMemoryStore } from "@yarlisai/memory";
import { createYPID } from "@yarlisai/contracts";
const ai = new YarlisAI({
domain: "rtm",
router: {
providers: [
{
provider: "anthropic",
apiKey: process.env.ANTHROPIC_API_KEY,
models: [{
id: "claude-sonnet-4-6",
provider: "anthropic",
capabilities: ["chat", "code", "reasoning"],
tier: "powerful",
contextWindow: 200000,
costPer1kInput: 0.003,
costPer1kOutput: 0.015,
supportsTools: true,
supportsVision: true,
}],
enabled: true,
},
{
provider: "ollama",
baseUrl: "http://localhost:11434/v1",
models: [{
id: "llama3",
provider: "ollama",
capabilities: ["chat", "code"],
tier: "local",
contextWindow: 8192,
costPer1kInput: 0,
costPer1kOutput: 0,
}],
enabled: true,
},
],
defaultStrategy: "local-first",
fallback: "claude-sonnet-4-6",
},
memory: { store: new InMemoryStore() },
});
// Simple chat
const response = await ai.chat([{ role: "user", content: "Hello!" }]);
// Chat with memory (remembers context across calls)
const userId = createYPID("rtm", "user");
const memResponse = await ai.chatWithMemory(userId, "Why is my app slow?");License
MIT
