In Lesson 1, you built a RAG system that reads a document and answers questions about it accurately. In Lesson 2, you wrapped it in a Streamlit chat interface using app.py. Right now, that app only runs on your own computer. In this lesson, we deploy it to a real URL anyone can visit.
There is a big difference between telling someone you built an AI application and showing them a working link. The link wins every single time. When a potential client or employer can click your URL and see a real RAG system answer questions on the spot, the conversation changes immediately. It does not guarantee income, clients, employment, or freelance rates.
We will focus on Streamlit Community Cloud as your primary deployment path because it is genuinely free, it requires no server configuration, and it connects directly to GitHub.
Prepare Your Project for GitHub
⏱ 15 minutesStreamlit Community Cloud deploys directly from a GitHub repository. Before you can deploy, you need your app code in a clean, properly structured GitHub repo.
If you do not already have a GitHub account, go to github.com and create a free one. Then create a new repository and name it something descriptive like rag-document-assistant. Keep it public so Streamlit Community Cloud can read it.
rag-document-assistant/
├── app.py # Your Streamlit chat app from Lesson 2
├── requirements.txt # Python packages to install
└── .streamlit/
└── secrets.toml # Your API key (local only, never commit this)langchain-openai
langchain-community
langchain-chroma
langchain-text-splitters
chromadb
openai
streamlitNever commit your API key to GitHub. We handle the API key securely in Step 3 using Streamlit's built-in secrets management. Keep your local .streamlit/secrets.toml file out of the repository by adding it to a .gitignore file before your first commit.
Update Your App to Use Secrets Securely
⏱ 10 minutesIn Lesson 2, your app used a text input field for the API key. Before deploying to a public repository, you need to switch to Streamlit Secrets so the key never appears in your code.
In your app.py, replace the text input and direct key assignment:
# Remove the text input and direct assignment:
openai_api_key = st.text_input("OpenAI API Key", type="password")
os.environ["OPENAI_API_KEY"] = openai_api_key# Read the key from Streamlit Secrets instead:
os.environ["OPENAI_API_KEY"] = st.secrets["OPENAI_API_KEY"]The from openai import OpenAI and client = OpenAI() pattern from Lesson 2 stays the same — no changes needed to the OpenAI client architecture.
For your local secrets file, create a file at .streamlit/secrets.toml and add one line: OPENAI_API_KEY = "your-actual-key-here". Add .streamlit/secrets.toml to your .gitignore file.
Deploy on Streamlit Community Cloud
⏱ 10 minutesGo to share.streamlit.io and sign in with your GitHub account. Click the button to create a new app. Select your repository, choose the branch (main is the default), and specify your main app file as app.py.
Before clicking deploy, add your API key to the secrets section. Click the Advanced settings link and paste this line, replacing the placeholder with your actual key:
OPENAI_API_KEY = "sk-your-actual-openai-key-here"Click Deploy. Streamlit Cloud will install your dependencies from requirements.txt, start your app, and give you a public URL. The initial deployment typically takes two to four minutes.
Deployment Checklist
Test Your Live App
⏱ 5 minutesOpen your new URL in a private browser window or on your phone — both simulate what a first-time visitor will experience. Upload one of the Northwind practice text files using the file uploader in the sidebar, type a question about its contents into the chat input, and confirm that the app returns an accurate, document-specific answer.
- The file uploader accepts your text file without any error message
- The app processes the document in a reasonable amount of time (under 30 seconds for a standard document)
- The answer references the actual content of the document, not generic knowledge
- The app does not crash or show an error when you ask a second question
Streamlit Cloud free tier note: Apps on the free tier may pause after extended periods of inactivity to conserve resources. If an app has paused, the first visitor to arrive will trigger a restart, which typically takes 30–60 seconds. For portfolio demos, this is perfectly acceptable. For a production client deployment, you would use a paid tier or a different hosting platform.
Alternative Deployment Options
⏱ Reference onlyStreamlit Community Cloud
Free, no configuration, connects directly to GitHub. The simplest path for Streamlit apps.
Hugging Face Spaces
Alternative platform for hosting Streamlit apps. Good if you already use Hugging Face for ML models. Requires more configuration than Streamlit Community Cloud.
Railway
Runs any Python app, not just Streamlit. Good for clients who want a custom domain and more control.
Render
Similar to Railway. Reliable uptime and straightforward configuration. A solid step up when a client needs production-grade hosting.
For now, keep things simple. Get one working live URL and use it as a learning and portfolio proof point. Do not use private or confidential documents in this free demo.
What You Have Built — Your First Portfolio Piece
Step back for a moment and look at what you have put together across these three lessons. You built a system that loads a real document, breaks it into searchable pieces, converts those pieces into a format an AI can retrieve from, and answers questions using only the content in that document. You wrapped it in a professional chat interface. And you deployed it to a public URL that works on any device in the world.
That is more than a note-taking exercise. It is a functional demo built for learning and portfolio practice using Northwind Traders sample data.
The next step is to make it work for you. Take a screenshot of the app running in your browser. Copy the live URL. Write two sentences describing what it does — something like: "A RAG-powered document assistant that answers specific questions about any text file you upload, using retrieval-augmented generation to reduce hallucinations and ground answers in source content."
Add all three of those things to your GitHub repository README. Post the screenshot and the two-sentence description on LinkedIn as a simple update — no need for a long article.
One action to do today: Open your GitHub repository, update the README with a screenshot and your live URL, then post a single update on LinkedIn with the link and two sentences about what you built. This takes less than 20 minutes and is the highest-leverage use of what you just completed.
These three lessons have given you the foundation: what RAG is, how to build it, how to add a user interface, and how to deploy it to a real URL. The techniques you used here — document loading, chunking, embedding, retrieval, and generation — are the same techniques used in many production AI products being built for business today.
The question from this point forward is how to apply the same foundation safely to focused business workflows — support, HR, marketing, technical documentation, education, and more. Results vary, and this training does not guarantee income, clients, employment, or freelance rates.