intentiai
v0.1.3
Published
IntentiAI CLI - Intent-aware LLM routing that saves 60-90% on API costs
Maintainers
Readme
IntentiAI
Intent-aware LLM routing that saves 60-90% on API costs while maintaining quality.
Installation
npm install -g intentiaiQuick Start
# Login (opens browser for authentication)
intentiai auth login
# Create a project
intentiai project create "My Chatbot"
# Add intents
intentiai intent add "refund_request" -d "Customer wants a refund"
intentiai intent add "order_status" -d "Customer checking order status"
intentiai intent add "product_question" -d "Questions about products"
# Set up routing (cheap models for easy queries, GPT-4 for hard ones)
intentiai route add -i "order_status" -d easy -p groq -m "llama-3.1-8b-instant"
intentiai route add -i "product_question" -d easy -p groq -m "llama-3.1-8b-instant"
intentiai route add -i "refund_request" -d hard -p openai -m "gpt-4o"
# Set system prompts
intentiai prompt set -i "refund_request" -s "You are a helpful customer service agent. Help with refunds politely."
# Train the intent classifier
intentiai train start --samples 20 --watch
# Test your chatbot
intentiai test "Where is my order?"
intentiai test "I want a refund for my purchase"
# Get embed code for your website
intentiai deployHow It Works
- Intent Classification - Queries are classified into intents (refund_request, order_status, etc.)
- Difficulty Assessment - Each query is rated as easy, medium, or hard
- Smart Routing - Easy queries → fast/cheap models (Groq Llama), Hard queries → powerful models (GPT-4)
- Cost Savings - 60-90% reduction in LLM API costs
Commands
Authentication
intentiai auth login # Browser-based login (recommended)
intentiai auth login --no-browser # Terminal login with email/password
intentiai auth whoami # Show current user
intentiai auth logout # LogoutProject Management
intentiai project create "Name" # Create a new project
intentiai project list # List all projects
intentiai project select <id> # Select a project to work withIntent Management
intentiai intent add "name" -d "description" # Add an intent
intentiai intent list # List all intentsRouting Rules
Route queries to different models based on intent and difficulty:
easy→ Fast, cheap models (Groq Llama 3.1 8B)medium→ Balanced models (Groq Llama 3.3 70B)hard→ Powerful models (GPT-4o)
intentiai route add -i "intent_name" -d easy -p groq -m "llama-3.1-8b-instant"
intentiai route add -i "intent_name" -d medium -p groq -m "llama-3.3-70b-versatile"
intentiai route add -i "intent_name" -d hard -p openai -m "gpt-4o"
intentiai route listSystem Prompts
intentiai prompt set -i "intent_name" -s "Your system prompt here"
intentiai prompt get -i "intent_name"Training
intentiai train start --samples 20 --watch # Train the classifier
intentiai train status # Check training statusTesting & Deployment
intentiai test "Your test message" # Test a query
intentiai deploy # Get embed code and API infoAPI Integration
JavaScript/TypeScript
const response = await fetch('https://api.intentiai.com/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Project-Key': 'your_project_key'
},
body: JSON.stringify({
messages: [{ role: 'user', content: 'I want a refund' }]
})
});
const data = await response.json();
console.log(data.choices[0].message.content);Python (OpenAI SDK Compatible)
from openai import OpenAI
client = OpenAI(
base_url='https://api.intentiai.com/v1',
api_key='your_project_key'
)
response = client.chat.completions.create(
model='auto', # IntentiAI routes automatically
messages=[{'role': 'user', 'content': 'I want a refund'}]
)
print(response.choices[0].message.content)Links
- Website: https://www.intentiai.com
- Documentation: https://www.intentiai.com/docs
- Dashboard: https://www.intentiai.com/dashboard
License
MIT
