This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
I built Pacer, a voice-guided, AI-powered running coach that lives in your pocket and forces you to look at the real world.
You put your headphones on, start the app, and put your phone away. From there, Pacer acts as your companion on the trail. It gives you pacing advice, encouragement, and—most importantly—periodically prompts you to look up from your screen and notice your surroundings (the wind, the trees, the clouds).
It is built for runners, hikers, and walkers who want the guidance of a coach without ever having to look at a screen. With Pacer, the screen time is literally zero. The AI is just the prep step and the background companion; the real experience is the run.
Code
github link : https://github.com/sanjaynep/ollama-practice
code snippet:
import whisper
import ollama
from elevenlabs import generate, play, set_api_key, VoiceSettings
# 1. THE EARS: Local Open-Source Whisper (Transcription)
def record_and_transcribe(duration=5):
audio_data = sd.rec(int(duration * SAMPLE_RATE), samplerate=SAMPLE_RATE, channels=1, dtype='float32')
sd.wait()
result = whisper_model.transcribe(audio_data.flatten(), fp16=False)
return result["text"].strip()
# 2. THE BRAIN: Local Open-Source Llama 3 (Reasoning)
def get_ai_response(user_input):
chat_history.append({"role": "user", "content": user_input})
response = ollama.chat(model='llama3', messages=chat_history)
ai_message = response['message']['content']
chat_history.append({"role": "assistant", "content": ai_message})
return ai_message
# 3. THE MOUTH: Cloud ElevenLabs (Expressive Voice)
def speak(text):
audio = generate(
text=text,
voice="Rachel",
model="eleven_multilingual_v2",
voice_settings=VoiceSettings(stability=0.6, similarity_boost=0.75, style=0.3)
)
play(audio)
How I Built It
Pacer is built on a hybrid architecture that leverages open-weight models for the core processing, and a cloud API only for the final output polish.
The Brain (Open-Weight / Local): I use Llama 3 (8B) via Ollama for the AI reasoning. It runs 100% locally on the machine. I gave it a strict system prompt to keep responses to 1-2 sentences and to actively remind the runner to observe nature.
The Ears (Open-Source / Local): I use OpenAI's Whisper (Base) model running locally via the whisper Python library to transcribe the runner's voice in real-time.
The Mouth (Cloud API): I use the ElevenLabs API for Text-to-Speech. I initially tried offline TTS (pyttsx3), but the robotic voice broke the immersion of a human coach.
The Loop: The app runs a background thread that triggers the LLM every 90 seconds to proactively check in with the runner. If the runner presses the spacebar (mapped to a bluetooth headphone button), it records 5 seconds of audio, transcribes locally, thinks locally, and speaks via the cloud.
Why Does Open Innovation Matter?
Open innovation is the only reason this app functions in the real world.
Running happens outside—often in canyons, forests, or trail systems with zero cell service. If I relied on a closed API (like OpenAI or Anthropic) for the LLM and Whisper, the app would literally crash the moment the runner loses a data signal. Because Llama 3 and Whisper run locally, the core reasoning and listening capabilities of the coach are guaranteed to work offline.
Furthermore, closed APIs cost money per token. A 45-minute run with continuous back-and-forth chatting would cost a few dollars via a cloud provider. Running Llama 3 locally costs exactly $0, meaning the runner can talk to their coach for hours for free.
Finally, a running app is highly personal. By keeping the STT and LLM local, the runner's voice data and conversational context never leave their device.
The only non-open piece is ElevenLabs, which I used for the expressive voice. A robotic voice makes for a terrible running coach. However, because the LLM and STT are offline, the app only pings the server for a few seconds to generate short audio clips, which works even on spotty 3G data, while the heavy lifting stays local and private.
Prize Categories
- Best Use of ElevenLabs (Giving an open-source Llama 3 agent a highly expressive, human-like voice to make the running coach immersive)
- Touch Grass Main Track (Zero screen time, actively prompts the user to look at their physical surroundings while running outside)
Top comments (0)