Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch committed Aug 8, 2024
1 parent fb67054 commit 4b9ef90
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/docs/self-hosting/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Environment variables for `tombursch/kitchenowl` and `tombursch/kitchenowl-backe
| `APPLE_CLIENT_SECRET` | | |
| `GOOGLE_CLIENT_ID` | | |
| `GOOGLE_CLIENT_SECRET` | | |
| `LLM_MODEL` | | Set a custom ingredient detection strategy for scraped recipes from the web. More at [Ingredient Parsing](./ingredient_parsing.md) |

Additionally, to setting these environment variables you can also override the start command to scale the backend up.
Add the following line or take a look at this exemplary [docker-compose.yml](https://github.com/TomBursch/kitchenowl/blob/main/docker-compose-postgres.yml) file:
Expand Down
24 changes: 24 additions & 0 deletions docs/docs/self-hosting/ingredient_parsing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Ingredient Detection

When scraping recipes from the web multiple strategies to map ingredients to household items are available.
The scraping only returns a list of ingredients (like `3 cloves garlic`, `1/2 teaspoon salt`, `2 carrots chopped`) from which we need to extract the ingredient name and description. The names are then mapped to existing household items.

The default method is to use a local [natural language processing (NLP) model](https://github.com/strangetom/ingredient-parser/) trained on English ingredients. To use this leave the `LLM_MODEL` environment variable empty.

Alternatively, you can use a [Large Language Model (LLM)](https://github.com/BerriAI/litellm), multiple models are supported. Using a LLM uses more resources but can provide better results, especially for languages other than English.
It can automatically translate the ingredient names to the household language for better item detection.

### OpenAI

To use OpenAi you need to set the following environment variables:

- `LLM_MODEL`: The model name (e.g. `gpt-3.5-turbo`)
- `OPENAI_API_KEY`: Your OpenAI API key

### Ollama

To use OpenAi you need to set the following environment variables:

- `LLM_MODEL`: The model name prefixed with `ollama` (e.g. `ollama/llama3.1`)
- `OPENAI_API_KEY`: Your OpenAI API key
- `LLM_API_URL`: The URL of the Ollama server (e.g. `http://localhost:11434`)

0 comments on commit 4b9ef90

Please sign in to comment.