aidu-ai-llm
Small Python LLM playground from PHBern to help people to understand how to build AI-Tutors
with:
- reusable LLM utilities under
src/aidu/ai/llm - a FastAPI chat backend in
serve/app.py - a minimal Vite frontend in
web/
Quick Example
pip install aidu-ai-llm aidu-support
then run the example app:
aidu-ai-llm-example
Development Prerequisites
The following tools are required to build and run the project:
- make — for running common development and build tasks
- Python (>=3.11) — backend runtime
- uv (latest) — Python package manager and environment runner
- Node.js (>=18, includes npm) — required to build the frontend (TypeScript via Vite)
💡 Notes
uvreplacespip,venv, etc. → state of the art: no manual environment activation needednpmis included with Node.js, so you don’t need to install it separately
Quick Start
Copy .env_example to .env and add your OpenAI Token there.
When you have ensured the prerequisites, this should work. Clean up, install dependencies, build frontend, and run the server:
make clean # clean up python backend and web frontend
make web.install # install web frontend dependencies
make web.build # build web frontend
make install # install python dependencies
make serve # run FastAPI server
Open: http://localhost:8000
Then you can interact with the chat interface.
Project Layout
serve/
app.py FastAPI app (chat/session endpoints + static web mount)
src/aidu/ai/llm/
client.py OpenAI client wrapper
requester.py Base class interacting with ai client
builder.py Prompt template builder
safeformat.py Safe string formatting helpers
tool_registry.py Tool registration/execution helpers
spec.py Plugin spec definitions
evaluator.py Evaluator overloads Requestor
test/
curl_tests.sh Curl-based API smoke checks
web/
index.html Chat page shell
src/main.ts Browser chat logic
HELP.md License/help notes
Useful Commands
make smoke.client # runs smoke test on a individual file
make smoke.requester # runs smoke test on a individual file
make smoke.actor # runs smoke test on a individual file
make serve # run FastAPI server
make curl # run curl tests against above server
cd web && make clean # clean up web frontend
cd web && make install # install frontend deps
cd web && make build # build frontend
Notes
- Requires
OPENAI_API_KEYin your environment (or.env). - The frontend talks to the backend session endpoints under
/sessions/....
Metadata
Release files for aidu-ai-llm 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aidu_ai_llm-0.1.6.tar.gz | 1.0 MB | Without provenance | Details for aidu_ai_llm-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aidu_ai_llm-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for aidu_ai_llm-0.1.6-py3-none-any.whl |
Total release size: 2.1 MB
Release files / aidu_ai_llm-0.1.6.tar.gz
| Download URL | aidu_ai_llm-0.1.6.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb9ef5fa588a5187ce70fbd1f9c8455a404aee3e4315601a096d18798ec648d9
|
|
BLAKE2b-256 checksum How to use checksums |
03c12b14d166889881d462e2757704b2030cc0c7bb5f5acb997576b395569bcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / aidu_ai_llm-0.1.6-py3-none-any.whl
| Download URL | aidu_ai_llm-0.1.6-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1d28c0e0db59bb5c1adb21b2cfc27f5c0505a90e5b6a18736feb72edb194342
|
|
BLAKE2b-256 checksum How to use checksums |
af57e4a580135128607de479d96dc410e3e10e93dbff90356fd3a9d7445077cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Security for aidu-ai-llm 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.