signalloomai
v0.1.0
Published
Signal Loom AI — LangChain tool wrapper for LoomLens AI token cost estimation
Downloads
22
Maintainers
Readme
Signal Loom AI — LangChain Integration
Install
npm install signalloomaiRequires Node.js 18+.
Quick Start
import { LoomLensTool } from 'signalloomai';
// Initialize with your API key
const tool = new LoomLensTool({ apiKey: process.env.SIGNALLOOM_API_KEY });
// Get a cost estimate
const result = await tool.estimate({
job_description: 'Customer support agent with 5 sub-agents handling billing and shipping',
num_agents: 5,
estimated_runtime_minutes: 20,
complexity: 'standard',
target_models: [
'openai/gpt-4o',
'anthropic/claude-sonnet-4-20250514',
'google/gemini-2.5-flash',
],
});
console.log(`Cheapest model: ${result.cheapest_model}`);
console.log(`Savings vs most expensive: $${result.savings_vs_expensive}`);Use with LangChain Agents
import { LoomLensTool } from 'signalloomai';
import { ChatOpenAI } from '@langchain/openai';
import { createReactAgent } from 'langchain-agents';
// Initialize
const loomLensTool = new LoomLensTool({ apiKey: process.env.SIGNALLOOM_API_KEY });
const llm = new ChatOpenAI({ modelName: 'gpt-4o', temperature: 0 });
// Create agent with LoomLens as a tool
const agent = createReactAgent({
llm,
tools: [loomLensTool.toLangChainTool()],
});
// Run
const response = await agent.invoke({
input: 'Compare the cost of running a 10-agent research pipeline on GPT-4o vs Claude Sonnet 4',
});API Key
Get your API key at signalloomai.com.
Set it as an environment variable:
export SIGNALLOOM_API_KEY=sk_...Or pass it directly:
const tool = new LoomLensTool({ apiKey: 'sk_your_key_here' });Prompt Integrity
LoomLens AI does NOT log prompts or job descriptions.
We estimate cost based on token counts and model pricing — not by reading your content. See our full Prompt Integrity Policy.
Available Models
| Provider | Model |
|----------|-------|
| OpenAI | gpt-4o, gpt-4o-mini |
| Anthropic | claude-sonnet-4-20250514, claude-opus-4-6 |
| Google | gemini-2.5-flash, gemini-2.5-pro |
| DeepSeek | deepseek-chat-v3 |
| xAI | grok-3 |
| MiniMax | MiniMax-M2.7 |
