Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

AI_Voice_-_Tools

AI Voice Assistant with Local Tools 🎙️🤖 A Python-based voice assistant that runs 100% locally using Whisper for speech-to-text, a local open-weights model (via LM Studio or Ollama) for reasoning, and local Python tools for external data fetching.

Your data and private queries never leave your machine; external APIs are only queried locally (read-only) when the AI explicitly decides it needs live data.

🚀 How It Works Listen: Continuously listens via microphone and detects your voice using sounddevice and numpy.

Transcribe: Converts your voice into text locally using OpenAI's Whisper (Medium).

Reason & Call Tools: Sends the text to your local LLM (e.g., Gemma), which handles phonetic error correction and triggers custom Python functions (Function Calling) if needed.

Speak: Responds back using Windows native text-to-speech.

⚙️ Quick Setup Run your local LLM server (e.g., LM Studio) listening on port 1234 (OpenAI-compatible endpoint).

Install dependencies:

Bash pip install openai requests numpy sounddevice whisper yfinance Configure your endpoint: If your local server runs on a different port or IP, update line 83 in main.py:

Python

Line 83

"http://localhost:1234/v1/chat/completions" Run the script:

Bash python main.py 🛠️ Included Read-Only Tools The AI automatically decides when to use these built-in Python tools:

Weather (tools/clima.py): Fetches real-time weather via free public APIs (wttr.in).

Stock Market (tools/finanzas.py): Checks live stock prices using yfinance.

How to add your own tools: Want to add a new custom function? It's super simple:

Create your python function and its JSON schema (following the structure in tools/).

Import your new tool at the top of main.py (around lines 2-3).

Add your schema to the tools array in the API payload (around line 102).

Handle the function call in the if/elif block (around line 120).

About

Connect any local AI to listen and speak. Also tools to connect with external API and get external information (Read only)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages