5to1r
v0.1.0
Published
Observability and tracing for AI agents.
Maintainers
Readme
@5to1r/sdk
Observability and tracing for AI agents. Gain full visibility into your agent's decision-making process, tool usage, and LLM costs.
Installation
npm install @5to1r/sdk
# or
yarn add @5to1r/sdkQuickstart
- Get your API Key from the 5to1r Dashboard.
- Set it as an environment variable:
export FIVETOONE_API_KEY=your_sk_live_...- Instrument your agent:
import { traceAgent, llmCall, toolCall } from '@5to1r/sdk';
const agent = traceAgent(async (query: string) => {
// LLM Call
await llmCall({
input: query,
output: "Thinking...",
modelId: "gpt-4o",
costUsd: 0.002,
latencyMs: 800
});
// Tool Use
await toolCall({
toolName: "web_search",
input: { q: query },
output: "Found results...",
latencyMs: 1200
});
return "Final Answer";
});Features
- traceAgent Wrapper: Automatically captures run lifecycle and errors.
- Granular Spans: Manually record LLMs, tools, and custom decisions.
- Environment Aware: Automatically picks up API keys from
process.env. - Lightweight: Minimal dependencies, optimized for Node.js and Edge runtimes.
License
MIT
