Skip to content

Commit

Permalink
Support more llms (#50)
Browse files Browse the repository at this point in the history
* Use Vercel AI SDK / Add support for Google/Anthropic/Ollama

* Update README.md

* Fix provider
  • Loading branch information
sakowicz authored Nov 10, 2024
1 parent 977fc82 commit 3b53d5d
Show file tree
Hide file tree
Showing 8 changed files with 995 additions and 40 deletions.
13 changes: 11 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ ACTUAL_BUDGET_ID=
CLASSIFICATION_SCHEDULE_CRON="0 */4 * * *"
CLASSIFY_ON_STARTUP=true
SYNC_ACCOUNTS_BEFORE_CLASSIFY=true
LLM_PROVIDER=openai
OPENAI_API_KEY=
OPENAI_MODEL=
OPENAI_BASE_URL=
OPENAI_MODEL=gpt-4-turbo
OPENAI_BASE_URL=https://api.openai.com/v1
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-3-5-sonnet-latest
ANTHROPIC_BASE_URL=https://api.anthropic.com/v1
GOOGLE_GENERATIVE_AI_API_KEY=
GOOGLE_GENERATIVE_AI_MODEL=gemini-1.5-flash
GOOGLE_GENERATIVE_AI_BASE_URL=https://generativelanguage.googleapis.com
OLLAMA_MODEL=phi3.5
OLLAMA_BASE_URL=
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
</p>

This is a project that allows you to categorize uncategorized transactions for [Actual Budget](https://actualbudget.org/)
using [OpenAI](https://openai.com/api/pricing/) or OpenAI specification compatible API, like a self-hosted [Ollama](https://github.com/ollama/ollama) server.
using [OpenAI](https://openai.com/api/pricing/), [Anthropic](https://www.anthropic.com/pricing#anthropic-api), [Google Generative AI](https://ai.google/discover/generativeai/), [Ollama](https://github.com/ollama/ollama) or any other compatible API.

## 🌟 Features

#### 📊 Classify transactions using OpenAI
#### 📊 Classify transactions using LLM

The app sends requests to the OpenAI API to classify transactions based on their description, amount, and notes.
The app sends requests to the LLM to classify transactions based on their description, amount, and notes.

#### 🔄 Sync accounts before classification

Expand Down Expand Up @@ -49,9 +49,18 @@ services:
- CLASSIFICATION_SCHEDULE_CRON=0 */4 * * * # How often to run classification.
- CLASSIFY_ON_STARTUP=true # Whether to classify transactions on startup (don't wait for cron schedule)
- SYNC_ACCOUNTS_BEFORE_CLASSIFY=false # Whether to sync accounts before classification
- OPENAI_API_KEY=your_openai_api_key
# - OPENAI_MODEL= # optional. required if you want to use a specific model, default is "gpt-3.5-turbo-instruct"
- LLM_PROVIDER=openai # Can be "openai", "anthropic", "google-generative-ai" or "ollama"
# - OPENAI_API_KEY= # optional. required if you want to use the OpenAI API
# - OPENAI_MODEL= # optional. required if you want to use a specific model, default is "gpt-4-turbo"
# - OPENAI_BASE_URL= # optional. required if you don't want to use the OpenAI API but OpenAI compatible API, ex: "http://ollama:11424/v1
# - ANTHROPIC_API_KEY= # optional. required if you want to use the Anthropic API
# - ANTHROPIC_MODEL= # optional. required if you want to use a specific model, default is "claude-3-5-sonnet-latest"
# - ANTHROPIC_BASE_URL= # optional. default: "https://api.anthropic.com/v1
# - GOOGLE_GENERATIVE_AI_API_KEY= # optional. required if you want to use the Google Generative AI API
# - GOOGLE_GENERATIVE_AI_MODEL= # optional. required if you want to use a specific model, default is "gemini-1.5-flash"
# - GOOGLE_GENERATIVE_AI_BASE_URL= # optional. default: "https://generativelanguage.googleapis.com"
# - OLLAMA_MODEL=phi3.5 # optional. required if you want to use a Ollama specific model, default is "phi3.5"
# - OLLAMA_BASE_URL= # optional. required for ollama provider
# - ACTUAL_E2E_PASSWORD= # optional. required if you have E2E encryption
# - NODE_TLS_REJECT_UNAUTHORIZED=0 # optional. required if you have trouble connecting to Actual server
```
Expand Down
Loading

0 comments on commit 3b53d5d

Please sign in to comment.