No project description provided
Project description
Jarvion – Real-Time AI Assistant (OpenAI + Gemini + ElevenLabs + TTS)
Jarvion is an advanced, real-time, bilingual AI assistant framework inspired by Jarvis.
It listens to your voice, understands speech in real time, responds conversationally, and speaks back naturally using ElevenLabs or pyttsx3.
This README covers:
- pip installation & local testing
- programmatic use and CLI examples
- configuration (API keys, voices, thresholds)
- packaging & publishing to PyPI
- troubleshooting & tips
- security & privacy notes
📦 Installation (pip)
Install the released package from PyPI:
pip install jarvion
If you want the local development version (install from source):
git clone https://github.com/<yourusername>/jarvion.git
cd jarvion
pip install .
Or build and install the wheel locally:
pip install build
python -m build
pip install dist/jarvion-1.0.0-py3-none-any.whl
To uninstall:
pip uninstall jarvion
⚙️ Quickstart — Programmatic Usage
Minimal example (listening + speaking using default config):
from jarvion.core import Jarvis, Config
cfg = Config(
openai_key="YOUR_OPENAI_KEY", # optional if using Gemini-only
ai_provider="openai", # "openai", "gemini", or "both"
elevenlabs_key="YOUR_ELEVENLABS_KEY", # optional; use pyttsx3 fallback if absent
eleven_voice="21m00Tcm4TlvDq8ikWAM", # ElevenLabs voice ID (not voice name)
speak_chunk_threshold=300, # number of characters to buffer before speaking
interrupt_on_user_speech=True # whether TTS stops when user starts speaking
)
jarvis = Jarvis(cfg)
jarvis.start() # starts background listener and TTS player
# programmatic input (like simulating user speech)
jarvis.send_text("Tell me a joke about penguins.")
# stop later
jarvis.stop()
Notes
send_text()lets you feed text directly (useful for GUIs, tests, or remote control).speak_chunk_thresholdcontrols how long an assistant response accumulates before being synthesized and played.
🗣️ CLI Usage
If setup.py defines a console entry point (jarvion=jarvion.core:main), after installation you can run:
jarvion
This will launch the full-duplex assistant (listen + speak). Say exit or quit to stop.
🧩 Using ElevenLabs TTS
ElevenLabs requires a voice ID (not the display name). To get voice IDs:
- Sign in at https://elevenlabs.io/app/voices
- Click a voice — the URL contains the voice ID, e.g.:
https://elevenlabs.io/app/voice/21m00Tcm4TlvDq8ikWAM→ voice id =21m00Tcm4TlvDq8ikWAM - Put that ID in
Config.eleven_voice.
Programmatic ElevenLabs test (quick):
import requests
ELEVEN_API_KEY = "YOUR_KEY"
VOICE_ID = "21m00Tcm4TlvDq8ikWAM"
url = f"https://api.elevenlabs.io/v1/text-to-speech/{VOICE_ID}"
headers = {"xi-api-key": ELEVEN_API_KEY, "Content-Type": "application/json"}
data = {"text": "Hello from ElevenLabs!", "voice_settings": {"stability":0.5,"similarity_boost":0.75}}
r = requests.post(url, headers=headers, json=data)
if r.status_code == 200:
with open("out.wav","wb") as f: f.write(r.content)
🔁 Example: GUI Integration (Tkinter)
import tkinter as tk
from jarvion.core import Jarvis, Config
cfg = Config(openai_key="YOUR_OPENAI_KEY", ai_provider="openai")
jarvis = Jarvis(cfg)
jarvis.start()
def send():
text = entry.get()
jarvis.send_text(text)
entry.delete(0, tk.END)
root = tk.Tk()
entry = tk.Entry(root, width=60)
entry.pack(side=tk.LEFT)
tk.Button(root, text="Send", command=send).pack(side=tk.RIGHT)
root.mainloop()
🛠 Packaging & Publishing (PyPI)
- Ensure your
setup.py,pyproject.toml(optional), andREADME.mdare ready.README.mdwill be used for the long description. - Build distributions:
pip install build twine
python -m build
- Upload to PyPI (you’ll be prompted for credentials):
twine upload dist/*
- Install from PyPI to test:
pip install jarvion
jarvion
Local testing (install wheel directly)
pip install dist/jarvion-1.0.0-py3-none-any.whl
🧰 Recommended requirements.txt
openai>=1.0.0
google-generativeai>=0.4.0
elevenlabs>=1.0.0 # optional, only if you use ElevenLabs SDK
pyttsx3>=2.90
SpeechRecognition>=3.10.0
pyaudio>=0.2.13 # or sounddevice + soundfile alternative
requests>=2.25.0
sounddevice>=0.4.0
soundfile>=0.11.0
Note:
pyaudiocan be tricky to install on Windows (use prebuilt wheels orpipwin install pyaudio).
🩺 Troubleshooting & Tips
1. Speaks only first/last words or cuts off mid-sentence
- Increase
speak_chunk_thresholdso Jarvis buffers more text before TTS. - If using ElevenLabs, ensure the full audio file is saved then played (
sd.wait()or write-then-play approach). - When using
pyttsx3, make sure you don’t call.stop()prematurely and avoid overlappingrunAndWait()calls.
2. "Method Not Allowed" on ElevenLabs URL
- Don’t open the TTS endpoint in a browser (that sends GET). Use
POSTwith your API key and JSON body.
3. msilib or cx_Freeze build errors on Python 3.13
-
Uninstall
cx_Freezeif you don’t need it:pip uninstall cx_Freeze
-
Or use Python 3.12 if you need
msilib-dependent builds.
4. Microphone issues on Windows
-
For
pyaudio, either install Visual C++ build tools or usepipwin:pip install pipwin pipwin install pyaudio
5. ElevenLabs voice not found
- Use the voice ID, not the display name.
6. Debugging
- Add logging prints around the TTS worker to verify buffer contents and playback flow.
- Use headphones to avoid TTS → microphone feedback.
🔐 Security & Privacy
-
Never commit API keys to source code. Use environment variables:
export OPENAI_API_KEY="sk-..." export ELEVENLABS_API_KEY="eleven-..."
-
Be mindful of sensitive data — voice streams and transcripts may be sent to third-party APIs (OpenAI/ElevenLabs). If you need local-only processing, rely on offline STT/TTS alternatives (Whisper local, pyttsx3).
📝 Versioning & Changelog
Keep a CHANGELOG.md and increment semantic versioning:
MAJOR.MINOR.PATCH(e.g.,1.0.0)- Example release notes: new features, bug fixes, breaking changes.
❤️ Contributing
Contributions welcome:
- Add new voice providers, better wake-word detection, GUI frontends, or integrations (Home Assistant, Alexa).
- Open a PR or issue on GitHub with a minimal repro and tests.
⚖️ License
MIT License © 2025 Salman Fareed Chishty
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jarvion-0.0.1-py3-none-any.whl.
File metadata
- Download URL: jarvion-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aadf84c60dacb6f81e6d6b350351002cfa72e943cddab51cc02230b03f78a9ac
|
|
| MD5 |
c662813cf92db6e8a54de3666082a33c
|
|
| BLAKE2b-256 |
b49b0e076684e41ecc521a95a46dba4eb592fd611cc43926c4ca3f77139d5dcd
|