Spaces:
Sleeping
Sleeping
A newer version of the Streamlit SDK is available: 1.59.0
Deploying FinAgent to Hugging Face Spaces (from zero)
Everything in this folder is what gets uploaded. Nothing else from the project is needed. Total size ~71 MB.
Files included:
app.pyβ Streamlit entry point (HF runs this automatically)phase1_ingestion.py,phase2_retrieval.py,phase3_agent.py,phase4_tools.pyβ pipelinerequirements.txtβ Python deps (HF installs these)infosys-ar-25.pdfβ source document (BM25 reads it at startup)table_store.jsonβ pre-extracted financial tablesfinance_db/β pre-built ChromaDB vector store (so the app does NOT re-index on boot)README.mdβ contains the HF Space config header.gitignore,.env.example
Step 0 β Create a Hugging Face account (you have none)
- Go to https://huggingface.co/join
- Sign up (email + password, or Google/GitHub). Verify your email.
Step 1 β Get a free Groq API key
- Go to https://console.groq.com/keys β sign in β Create API Key β copy it. (Use a FRESH key β do not reuse one that was ever pasted into code/chat.)
Step 2 β Create the Space
- Go to https://huggingface.co/new-space
- Owner: you Β· Space name: e.g.
finagent - License: MIT (optional) Β· SDK: select Streamlit
- Hardware: CPU basic β FREE (2 vCPU, 16 GB RAM β enough)
- Visibility: Public (reviewers can open it) or Private (share access manually)
- Click Create Space.
Step 3 β Add your Groq key as a secret (NOT in code)
- Open your Space β Settings β Variables and secrets β New secret
- Name:
GROQ_API_KEYΒ· Value: your key β Save
Step 4 β Upload the files
Option A β Browser (simplest, no tools)
- Space β Files tab β Add file β Upload files
- Drag in all files from this folder, INCLUDING the
finance_db/folder and the PDF. (The browser uploader handles the 54 MB sqlite fine.) - Commit. The Space auto-builds.
Option B β Git (recommended for the large finance_db/)
# install git-lfs once: https://git-lfs.com β then: git lfs install
git clone https://huggingface.co/spaces/<your-username>/finagent
cd finagent
# copy everything from this folder into the clone:
cp -r /Users/sumitsaurabh/Downloads/RAG/huggingface_deploy/. .
# track large binaries with LFS so the push succeeds
git lfs track "*.sqlite3" "*.bin" "*.pdf"
git add .gitattributes .
git commit -m "Deploy FinAgent"
git push
If git asks for a password, use a HF access token (Settings β Access Tokens, role: write) as the password, not your account password.
Step 5 β Watch it build
- Space page shows Building β Running (first build ~3β5 min: installs torch, then first request downloads ~1 GB of models, ~1β2 min).
- Your public URL:
https://huggingface.co/spaces/<your-username>/finagent
Step 6 β Test
Open the URL, click an example question, hit Ask FinAgent. An answer with page citations should appear. Share the URL with your reviewer.
Notes & safety
- Key safety: it lives only in the Space secret, never in the repo. On the Groq free tier (no card) the worst case is an exhausted daily quota β no money risk.
- Protect your quota (optional): keep the Space private, or add a password gate.
- Sleeping: free Spaces sleep after inactivity and wake on the next visit (~30β60 s cold start). Fine for a demo.