š¤ Local AI Agent with Custom Tools
This demo simulates how tools work. In real use, connect to Hugging Face Inference Providers or run models locally with llama.cpp/ollama.
š ļø Available Tools (Click to Toggle)
āļø What's Happening
Click "Send" to see the agent loop in action...
š What's the Point? Custom vs Hosted Tools
Custom/Local Tools (like the ones above):
- You write the code ā e.g.,
calculate(), getCurrentTime(), rollDice()
- They run on YOUR machine or YOUR server
- Use for: private data, no API costs, instant, deterministic operations
- The AI only decides WHEN to call them and WHAT arguments to pass
Hosted Tools / External APIs:
- Someone else runs them ā e.g., web search (Serper, Brave), weather APIs, stock prices
- You pay per call or have rate limits
- Use for: real-time data, info outside the model's knowledge cutoff
The Agent Loop:
- You send a message
- AI sees available tools, decides if one is needed
- If yes: AI outputs a tool call (just JSON ā it can't actually run code!)
- YOUR code catches this, runs the actual function, gets the result
- You send the result back to the AI
- AI formats a final answer using that result