summaryrefslogtreecommitdiff
path: root/README.md
blob: fd7eb8fffbb15817fd0f5e4d982bf72c95889289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Commis

An AI-powered personal chef that tracks your pantry, logs what you've eaten, and generates recipe suggestions and grocery lists — all running locally via Ollama.

## Requirements

- Python 3.11+
- [Ollama](https://ollama.com) running locally with a model pulled (e.g. `ollama pull llama3.1`)

## Setup

```bash
pip install -r requirements.txt
cp .env.example .env   # then edit .env
uvicorn main:app --reload
```

Open [http://localhost:8000](http://localhost:8000).

### `.env`

```
OLLAMA_HOST=http://localhost:11434
MODEL_NAME=llama3.1
DATABASE_URL=sqlite:///./chef.db
OLLAMA_TIMEOUT=120
SYSTEM_PROMPT=You are a professional chef assistant...
```

`MODEL_NAME` can be any model you have pulled locally. `SYSTEM_PROMPT` controls the AI's priorities for recipe and grocery generation — edit it to change the style, dietary focus, or constraints. The chat tab uses its own dynamic prompt built from your kitchen context.

## Features

**Pantry** — Add ingredients with quantities, units, categories, and expiry dates. Items expiring within 7 days are highlighted.

**Meal Log** — Record what you eat with optional ingredient tracking. Commis uses the last 14 days of history to avoid recommending things you've recently had.

**Recipe Suggestions** — "Generate Menu" asks Ollama for 8–12 diverse recipe ideas based on your pantry and meal history. Recipes use a type badge (breakfast / lunch / dinner), show time and serving estimates, and display full ingredients and instructions. Each card has:
- **Make This** — jumps to the meal log pre-filled with the recipe
- **Swap** — opens a prompt where you can optionally describe what you want, then replaces that card with a new AI suggestion
- **Remove** — removes the recipe from this week's suggestions

**Grocery List** — "Generate List" produces a cost-estimated shopping list grouped by store section (produce, dairy, protein, etc.). If a weekly menu exists, the list is scoped to those recipes and subtracts what you already have. Without a menu it suggests general pantry staples. Checking off an individual item immediately adds it to your pantry. "Mark All Purchased" does the same for everything at once.

**Chat** — A persistent chat tab where you can talk to Commis directly. It has full visibility into your current pantry, this week's recipes, and your grocery list, and maintains conversation history for the duration of the browser session.

## API

Interactive docs at [http://localhost:8000/docs](http://localhost:8000/docs) once the server is running.