Skip to content

Commit eac68d8

Browse files
committed
WIP
1 parent 71bc1d5 commit eac68d8

8 files changed

+69
-62
lines changed

.env.example

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx
2-
CLOUDFLARE_AI_GATEWAY=https://gateway.ai.cloudflare.com/v1/xxxxxxxxxxxxxxxx/yyyyyyyy
3-
OLLAMA_BASE_URL=http://localhost:11434
4-
OLLAMA_ENABLED=false
1+
USE_OLLAMA=1

.node_version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21.5.0
1+
22.3.0

.vscode/settings.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"colorraw",
3131
"datetime",
3232
"dirents",
33+
"distroless",
3334
"ducanh",
3435
"duckdb",
3536
"exintro",
@@ -71,23 +72,27 @@
7172
"Mandera",
7273
"Masó",
7374
"México",
75+
"myapp",
7476
"Nangarhar",
7577
"NDRRMA",
7678
"NEOC",
79+
"nextjs",
7780
"nonlatin",
7881
"OPENAI",
7982
"openstreetmap",
8083
"OPFS",
8184
"pageid",
8285
"Panjshir",
8386
"Parwan",
87+
"pgvector",
8488
"Pilon",
8589
"Pourriez",
8690
"qdrant",
8791
"qwen",
8892
"reliefweb",
8993
"replanner",
9094
"Rukum",
95+
"setuptools",
9196
"smollm",
9297
"Söhne",
9398
"souhaitez",
@@ -107,8 +112,10 @@
107112
"Urayasu",
108113
"USGS",
109114
"vectorstores",
115+
"vercel",
110116
"VFJJREVOV",
111117
"voir",
112-
"vous"
118+
"vous",
119+
"wiktorn"
113120
]
114121
}

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ all: \
44
update_reliefweb \
55
voyager
66

7+
.PHONY: setup
8+
setup:
9+
test ollama || $(MAKE) setup_ollama
10+
ollama pull qwen2.5:1.5b
11+
ollama pull snowflake-arctic-embed:22m
12+
13+
.PHONY: setup_ollama
14+
setup_ollama:
15+
curl -fsSL https://ollama.com/install.sh | sh
16+
717
.PHONY: fetch_nhk
818
fetch_nhk:
919
npm run site:www3.nhk.or.jp:fetch

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@ TRIDENT, an Interactive Smart Maps Assistant.
77
- TRIDENT is an AI assistant that can interactively create Smart Maps
88
- TRIDENT is based on OpenStreetMap data, specifically the Overpass API
99
- TRIDENT generates Overpass API queries based on user interaction, makes requests to the Overpass API, and visualizes the results as a map
10+
11+
## Development
12+
13+
### Minimum Requirements
14+
15+
- Node.js
16+
- npm
17+
- ollama
18+
19+
```bash
20+
make setup
21+
npm ci
22+
npm test
23+
```

docker-compose.yml

+18-31
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,29 @@
1-
version: "3.9"
2-
31
services:
4-
trident:
2+
nextjs:
53
build:
64
context: .
75
dockerfile: Dockerfile
6+
command: npm run dev
87
volumes:
98
- type: bind
109
source: ${LOCAL_WORKSPACE_FOLDER:-.}
1110
target: /app
12-
command: npm run dev
1311
ports:
1412
- 3000:3000
1513
networks:
16-
- myapp
17-
llama-cpp-server:
18-
image: local/llama.cpp:full
14+
- trident
15+
ollama:
16+
image: ollama/ollama
17+
volumes:
18+
- ollama:/root/.ollama
1919
ports:
20-
- 8080:8080
20+
- 11434:11434
2121
networks:
22-
- myapp
23-
tty: true
24-
command: >
25-
--server
26-
--model /models/${MODEL_NAME:-tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf}
27-
--ctx-size ${CONTEXT_SIZE:-2048}
28-
--threads ${THREADS:-8}
29-
--mlock --no-mmap --embedding
30-
--port 8080 --host 0.0.0.0
31-
volumes:
32-
- ~/llama.cpp/models:/models
33-
deploy:
34-
resources:
35-
reservations:
36-
devices:
37-
- driver: nvidia
38-
capabilities: [gpu]
22+
- trident
3923
overpass-api:
4024
# MEMO:
4125
# http://localhost:5000/api/interpreter?data=[out:json];rel(2220322);out;
4226
image: wiktorn/overpass-api
43-
ports:
44-
- 5000:80
45-
volumes:
46-
- overpass-db:/db
4727
environment:
4828
- OVERPASS_META=no
4929
- OVERPASS_MODE=init
@@ -53,10 +33,17 @@ services:
5333
- OVERPASS_USE_AREAS=true
5434
- OVERPASS_STOP_AFTER_INIT=false
5535
- OVERPASS_MAX_TIMEOUT=30000
36+
volumes:
37+
- overpass-db:/db
38+
ports:
39+
- 5000:80
40+
networks:
41+
- trident
5642

5743
networks:
58-
myapp:
59-
name: myapp
44+
trident:
45+
name: trident
6046

6147
volumes:
48+
ollama:
6249
overpass-db:

docs/USE_OLLAMA.md

+15-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using ollama with TRIDENT
22

3-
This guide explains how to set up and use ollama, particularly with the phi4:14b model, for enhanced language processing capabilities.
3+
This guide explains how to set up and use ollama, particularly with the qwen2.5:1.5b model, for enhanced language processing capabilities.
44

55
## Installation
66

@@ -11,65 +11,57 @@ curl -fsSL https://ollama.com/install.sh | sh
1111
```
1212

1313
This command will:
14+
1415
1. Download the ollama installation script
1516
2. Install ollama on your system
1617
3. Set up the ollama service
1718

18-
## Using phi4:14b Model
19-
20-
The phi4:14b model is recommended for its improved language processing capabilities, particularly for Japanese text.
21-
2219
### Download and Run
2320

24-
To use the phi4:14b model:
21+
To use the qwen2.5:1.5b model:
2522

2623
```bash
27-
ollama run phi4:14b
24+
ollama run qwen2.5:1.5b
2825
```
2926

3027
This will:
31-
1. Download the model if not already present (approximately 9.1GB)
28+
29+
1. Download the model if not already present
3230
2. Start an interactive session with the model
3331

3432
### Example Usage
3533

36-
Here's an example of using phi4:14b with Japanese text:
34+
Here's an example of using qwen2.5:1.5b with Japanese text:
3735

3836
```bash
39-
ollama run phi4:14b "こんにちは!簡単な自己紹介をお願いします。"
37+
ollama run qwen2.5:1.5b "こんにちは!簡単な自己紹介をお願いします。"
4038
```
4139

4240
Example response:
41+
4342
```
44-
こんにちは!私はOpenAIが開発した言語モデルです。質問に答えたり、情報を提供したりするのが得意です。
45-
さまざまなトピックについての知識を持っていますが、最新の出来事や特定の個人的な経験に関しては限界があります。
46-
プライバシーや安全性を尊重しながら、皆さんのお役に立てるよう努めています。何か質問や話したいことがあれば、
47-
遠慮なくどうぞ!
43+
こんにちは、私の名前はQwenです。AIの助手のような存在で、あなたが質問や要望をすると回答や情報提供を行います。私は学習データに基づいて人工知能技術を使って進化し続けますので、最新の情報を常に取り入れています。何かお困りのことであればいつでもお助けさせていただきますよ。
4844
```
4945

50-
## Features
51-
52-
- Supports multiple languages, with good Japanese language capabilities
53-
- Approximately 14 billion parameters for improved performance
54-
- Interactive command-line interface
55-
- Efficient response generation
56-
5746
## Troubleshooting
5847

5948
If you encounter any issues:
6049

6150
1. Verify ollama is running:
51+
6252
```bash
6353
systemctl status ollama
6454
```
6555

6656
2. Check model status:
57+
6758
```bash
6859
ollama list
6960
```
7061

7162
3. For model-specific issues, try removing and re-pulling the model:
63+
7264
```bash
73-
ollama rm phi4:14b
74-
ollama pull phi4:14b
65+
ollama rm qwen2.5:1.5b
66+
ollama pull qwen2.5:1.5b
7567
```

src/utils/ollamaModels.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export const ollamaModels: LLMModel[] = [
3838
modelDirName: "phi3.5/3.8b",
3939
},
4040
{
41-
modelName: "phi3:3.8b",
42-
modelDirName: "phi3/3.8b",
41+
modelName: "phi4:14b",
42+
modelDirName: "phi4/14b",
4343
},
4444
{
4545
modelName: "qwen2.5-coder:0.5b",

0 commit comments

Comments
 (0)