billy-sdk
v2.2.0
Published
Simple AI SDK for Node.js — generate, modify, validate, analyze, extract, and execute with natural language prompts
Maintainers
Readme
billy-sdk
The easiest AI SDK for Node.js — generate, modify, validate, analyze, extract, and execute with natural language prompts.
Documentation
Full documentation is available at:
→ plinio8899.github.io/billy-sdk
Includes guides for installation, providers, methods, type conversion, CLI, and use cases.
Quick Start
npm install billy-sdkimport billy from "billy-sdk";
const IA = billy();
await IA.create("genera 10 preguntas sobre la biblia");
console.log(IA.results);Features
| | |
|---|---|
| Multi-Provider | Groq (default, free), OpenAI, Anthropic |
| Type Conversion | Automatic parsing to number, array, object, boolean, JSON |
| Method Chaining | IA.asNumber().short().create("prompt") |
| Variable Injection | create("prompt {{var}}", { var: value }) |
| CLI | npx billy-sdk config set <key> |
| Streaming | IA.stream() — consume responses in real time |
| Memory | billy({ memory: 10 }) — automatic conversation history |
| Retry & Timeout | Built-in, configurable |
One-Minute Setup
# 1. Install
npm install billy-sdk
# 2. Set API key (Groq is free → https://console.groq.com)
# Option A: Environment variable (recommended)
export GROQ_API_KEY=gsk_your_key
# Option B: CLI (saves to ~/.billy-sdk/config.json)
npx billy-sdk config set gsk_your_key
# 3. Use it
echo 'import billy from "billy-sdk"; const IA = billy(); console.log(await IA.create("hola"));' | nodeExamples
See the examples/ directory for 11 runnable scripts: invoice extraction, ticket classification, NL-to-SQL, chatbot, sentiment analysis, email generator, summarizer, content moderation, test data generation, and basic RAG.
Requirements
- Node.js >= 18
- Internet connection
- API key (Groq offers a free tier)
License
MIT
