This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
LingoBuddy is a light, patient, and completely local AI language practice partner designed to help a friend practice conversational foreign languages (Spanish, French, German, Japanese, and more) without any fear of judgment.
Whenever my friend makes a grammar, spelling, or phrasing mistake, LingoBuddy gently inserts a bracketed correction [Correction: ...] into the conversation before replying naturally in the target language to keep the dialogue flowing.
I built LingoBuddy for a close friend who is practicing a new language but feels hesitant and self-conscious speaking with native speakers or posting in public chat groups.
When I showed them LingoBuddy running live on my machine, here is what they had to say:
"This takes away all the anxiety of making mistakes! I love that it points out where I messed up directly in brackets without interrupting the natural flow of the conversation."
Demo
Code
python
import streamlit as st
import ollama
st.set_page_config(page_title="LingoBuddy", page_icon="💬", layout="centered")
st.title("💬 LingoBuddy")
st.caption("Powered by 100% local, open-source AI (Gemma 2 via Ollama)")
# Sidebar Options
with st.sidebar:
st.header("⚙️ Practice Settings")
friend_name = st.text_input("Friend's Name", value="Alex")
target_lang = st.selectbox(
"Target Language",
["Spanish", "French", "German", "Japanese", "Hindi", "Italian"]
)
st.markdown("---")
st.markdown("🔒 **Privacy Guarantee:** Running 100% locally on your machine.")
# System Prompt for Gemma 2
SYSTEM_PROMPT = f"""You are LingoBuddy, a friendly and patient language practice partner for {friend_name}.
You are helping {friend_name} learn and practice {target_lang}.
Rules:
1. If {friend_name} makes a grammar, spelling, or phrasing mistake, gently point out the correction inside square brackets like this: [Correction: ...].
2. Respond naturally in {target_lang} to keep the conversation going. Keep responses short (1-3 sentences).
3. Be encouraging and patient at all times.
"""
# Chat History Setup
if "messages" not in st.session_state:
st.session_state.messages = [
{
"role": "assistant",
"content": f"¡Hola {friend_name}! I am your {target_lang} practice partner. Send me a message in {target_lang} or English to start practicing!"
}
]
# Display Chat Messages
for msg in st.session_state.messages:
st.chat_message(msg["role"]).write(msg["content"])
# User Input Field
if user_input := st.chat_input(f"Type a message in {target_lang}..."):
st.session_state.messages.append({"role": "user", "content": user_input})
st.chat_message("user").write(user_input)
ollama_messages = [{"role": "system", "content": SYSTEM_PROMPT}]
for m in st.session_state.messages:
ollama_messages.append({"role": m["role"], "content": m["content"]})
# Generate local response
with st.chat_message("assistant"):
with st.spinner("Thinking locally..."):
try:
response = ollama.chat(
model="gemma2:2b",
messages=ollama_messages
)
reply = response["message"]["content"]
st.write(reply)
st.session_state.messages.append({"role": "assistant", "content": reply})
except Exception as e:
st.error("Make sure Ollama is running in the background! Error: " + str(e))open-weight Gemma 2 locally via Ollama, zero chat data or personal details ever leave the laptop.
**Zero Operating Cost (0)**: Closed APIs charge per token, making prolonged learning sessions expensive over time. With Gemma 2 running locally, my friend can practice for unlimited hours completely free.
**100% Offline Resilience**: LingoBuddy requires no internet connection after setup, allowing my friend to practice anywhere — on commutes, flights, or in areas with spotty Wi-Fi.
## Prize Categories
Best Use of Gemma: Built using Google's open-weight Gemma 2 model (gemma2:2b) running locally via Ollama as the core language partner intelligence.
# Streamlit chat interface connects directly to local Ollama instance
What's Next for LingoBuddy
Future improvements include adding audio synthesis using open voice models so my friend can listen to correct pronunciations directly inside the chat interface.

Top comments (0)