Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
AmineDjeghri/generative-ai-project-template: Template for a new generative ai project using uv, nicegui, fastapi, llms (cloud & local with litellm and ollama, cpu/gpu) and langfuse for llm observability

AmineDjeghri/generative-ai-project-template: Template for a new generative ai project using uv, nicegui, fastapi, llms (cloud & local with litellm and ollama, cpu/gpu) and langfuse for llm observability

4 hours ago

Generative AI Project Template

Generative AI Project Template logo

A FastAPI backend and NiceGUI frontend for chat, document extraction and RAG, with local Ollama or cloud models through LiteLLM. Includes uv workspace tooling, tests, evaluation tools, Docker Compose and GitHub releases.

Frontend screenshot

Get started

Requires Make, Bash, Git and uv. uv provisions Python 3.14.8.

git clone https://github.com/AmineDjeghri/generative-ai-project-template.git
cd generative-ai-project-template
make install-dev
cp .env.example .env

Configure INFERENCE_ and EMBEDDINGS_ in .env for your model provider, then start the app:

make run-app

Open the frontend at or backend API docs at . For local Ollama, install it with make install-ollama, then use make run-app-with-ollama to prepare the models and start both services.

Other ways to run

| Command | Use | |------------------------------------------|----------------------------------------------------------------| | make docker-compose | Backend, frontend and Ollama in containers; Compose 2.24+ | | make docker-compose-cuda | Same stack with GPU access for Ollama; NVIDIA drivers required | | make docker-compose-rebuild | Rebuild containers after source changes | | make run-backend / make run-frontend | Start either application separately |

Python PyTorch extras are optional for model development; Ollama inference runs outside Python. See Setup for provider URLs, CUDA variants and timeouts.

Develop

Install Git hooks once with make pre-commit-install. For offline work, run make test-local; before a PR, configure the integration services and run make check. That includes live LLM/Ollama/API tests; Testing lists the requirements. make help lists all targets.

| Task | Guide | |--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------| | Install, run or configure providers | Setup | | Add routes, settings or dependencies | Project structure | | Prepare a contribution | Contributing and conventions | | Run tests | Testing | | Publish or retry a release | Release | | Start your own project | Use this template and rename guide |

Preview documentation with make deploy-doc-local.

Chat with me