DEV Community

Arman khan
Arman khan

Posted on

World’s Largest Hackathon Writing Challenge

WLH Challenge: Building with Bolt Submission

🚀 Llama-3.2 Chat & Summarizer

A 3-hour zero-to-deploy journey with Bolt.new
Submission for the World’s Largest Hackathon Writing Challenge
🌟 What I built
A dual-mode Streamlit app that lets you:
Chat with Llama-3.2-3B-Instruct in real time
Summarize any PDF or URL in three bullet points
View source instantly with one-click “Show me the code” links
Live demo 👉 huggingface.co/spaces/your-username/llama-chat-summarizer
⚡ How Bolt.new changed my workflow

Table

Before (local) With Bolt.new
45 min scaffolding repo & CI 30 s prompt → full repo
Manual CUDA / bitsandbytes pain Auto-detected GPU image
Spaces build logs in dark terminal Inline AI debugger
🧩 Sponsor challenge: fit Llama-3.2 into 8 GB VRAM
Problem: Free HF Spaces kills containers > 8 GB.
Bolt solution (auto-generated):

dockerfile

.bolt/Dockerfile

FROM huggingface/transformers-pytorch-gpu:4.43
RUN pip install bitsandbytes --no-cache-dir
ENV TRANSFORMERS_CACHE=/data/.cache
ENV BNB_CUDA_VERSION=121

Result: RAM dropped from 14 GB → 7.2 GB → container stays alive.

💬 Favorite prompt & snippet

“Add a sidebar toggle ‘Chat ↔ Summarize’. In Summarize mode allow PDF upload or URL; on submit run Llama-3.2 with system prompt ‘Summarize in 3 bullets’ and stream the response.”

Bolt spit out:
Python
import streamlit as st
from transformers import pipeline

@st.cache_resource
def load_llama():
return pipeline(
"text-generation",
model="meta-llama/Llama-3.2-3B-Instruct",
torch_dtype="auto",
device_map="auto",
model_kwargs={"load_in_4bit": True}
)

llm = load_llama()

mode = st.sidebar.radio("Mode", ["Chat", "Summarize"])

if mode == "Summarize":
file = st.file_uploader("Upload PDF", type="pdf")
url = st.text_input("Or paste URL")
if st.button("Summarize"):
txt = extract_pdf(file) if file else extract_url(url)
bullets = llm(
f"<|system|>\nSummarize in 3 bullets<|user|>\n{txt}<|assistant|>",
max_new_tokens=120
)[0]["generated_text"]

st.markdown(bullets)

🎨 Style & presentation hacks
Glass-morphism cards via custom CSS injected with st.markdown(..., unsafe_allow_html=True)
Animated cursor with st.empty() + time.sleep(0.03) stream
Open in VS Code badge auto-generated by Bolt
🔄 Mindset shift
Describe intent → AI writes & hosts → you polish UX.
No more YAML, no more requirements.txt archaeology.
🙌 Credits
me – @arman Khan
Bolt.new – the silent co-founder 🦾

Thanks for reading! Give the live demo a spin and drop feedback in the comments.

Top comments (0)