This project contains the lab exercises for 2025 summerschool of University of applied sciences Karlsruhe
- Install uv: https://docs.astral.sh/uv/
- Install dependencies:
uv sync- Run backend (FastAPI) in your first terminal:
uv run uvicorn backend.app:app --reload --host 0.0.0.0 --port 8000- Run UI (Streamlit multipage app) in your second terminal:
BACKEND_URL=http://localhost:8000 uv run streamlit run ui/Home.py \
--server.showEmailPrompt false \
--server.runOnSave true- Open the UI at http://localhost:8501
- The backend is available at http://localhost:8000 (health check:
/healthz)
backend/: FastAPI app with routers for each day:/routers/day{1..5}/...ui/: Streamlit multipage app withHome.pyand page files inui/pages/- Day 1–2: Use a simple single-message input.
- Day 3–5: Use a full chat interface.
See Streamlit's documentation for more info: st.chat_input
This repository provides a pre-built FastAPI backend and a Streamlit UI so you can focus on the core logic of the exercises.
For each day, your main task is to implement the logic inside the backend. The UI is already connected to the backend endpoints. You will replace the stub/echo logic with your solutions.
-
Backend Logic: All exercise implementations go into the
backend/routers/directory. Each day has its own file:- Day 1: Open
backend/routers/day1.pyand implement the multilingual film critic, sentiment classifier, etc. - Day 2: Open
backend/routers/day2.pyfor Self-Consistency, Tool-Use, and Plan-and-Solve. - Day 3: Open
backend/routers/day3.pyfor the Basic RAG implementation. - Day 4: Open
backend/routers/day4.pyfor the Advanced RAG agent. - Day 5: Open
backend/routers/day5.pyfor the open-domain agent.
- Day 1: Open
-
Data Models: For tasks requiring structured data (like the Day 1 sentiment classifier), you may need to define or modify Pydantic models in
backend/models.py. -
UI (Optional): The UI is located in
ui/pages/. You generally do not need to change the UI code. It is set up to call the correct backend endpoint for each day. You can inspect the code to see how the frontend calls your backend code.