- dependencies in requirements.txt 'frozen' to allow repo to age gracefully
- improved README
- If you are comfortable working with venv's, use Option 1
- If you don't see the point of venv's, use Option 2
- Option 3 and Docker. If you know, you know. If you don't know, AVOID
/.devcontainer/devcontainer.json has deliberately been misnamed ".devcontainer.json". This is to avoid VSCode or Docker launching Devcontainer for a user unfamiliar with the purpose and functionality of Devcontainers. To use, rename the filename to "devcontainer.json"
/shared/constants.py contains default OpenRouter settings including default LLMs.
graph TD
A[Start] --> B[Ensure Git is installed]
B --> C[Go to working directory]
C --> D[Clone repo: git clone <repo-url>]
D --> E{Choose setup option}
E -->|Option 1: Conda/venv| F[Prerequisites:<br>1. Anaconda or Python installed<br>2. Familiarity with command line]
F --> G[cd into subdirectory]
G --> H[Create venv:<br>conda create -n myenv python=3.11.10<br>or<br>python -m venv myenv]
H --> I[Activate venv:<br>conda activate myenv<br>or<br>myenv\Scripts\activate Windows<br>source myenv/bin/activate Unix]
I --> J[pip install -r requirements.txt]
J --> K[Ensure Streamlit is installed:<br>pip install streamlit]
K --> L[streamlit run filename.py]
E -->|Option 2: VSCode + Devcontainer| M[Prerequisites:<br>1. VSCode installed<br>2. Remote-Containers extension in VSCode]
M --> N[Open repo folder in VSCode]
N --> O[Ensure .devcontainer folder exists in repo]
O --> P[Use command palette: Ctrl+Shift+P]
P --> Q[Select 'Remote-Containers: Reopen in Container']
Q --> R[Wait for container to build and start]
E -->|Option 3: Docker| S[Prerequisites:<br>1. Docker installed and running<br>2. Familiarity with command line]
S --> T[cd into subdirectory]
T --> U[Ensure Dockerfile exists in repo]
U --> V[docker build -t my-app .]
V --> W[docker run -p 8501:8501 my-app]
W --> X[Access app at http://localhost⁄8501]
L --> Y[Access Streamlit app in web browser]
R --> Z[Follow any additional setup instructions in VSCode terminal]
X --> AA[End]
Y --> AA
Z --> AA
style A fill:#f9f,stroke:#333,stroke-width:2px,color:#000
style E fill:#bbf,stroke:#333,stroke-width:2px,color:#000
style AA fill:#bfb,stroke:#333,stroke-width:2px,color:#000
Starter examples for building LLM apps with Streamlit and OpenRouter, using OpenRouter OAuth PCKE.
- requirements.txt is frozen to allow repo to age gracefully
- improved README
OpenRouter is a single access point, cost centre and API standard in a landscape of a growing number of LLMs. This repo is a minimum working example of using a single API to access multiple language models, including OpenAI's o1-mini and o1-preview, Anthropic's Claude, Google's Gemini and many more.
Current examples include:
- Chatbot
- File Q&A
- Langchain Quickstart
- Langchain PromptTemplate
- LangChain Search (requires a Serper.dev API key)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run Chatbot.py
Not needed!
- Click the Connect OpenRouter button on the sidebar on the left and your API key will be auto-applied using an OAuth PKCE flow.
- If using LangChain search, enter your Serper API key in the field provided (also on the sidebar on the left of the screen