Skip to content

Commit a340b4f

Browse files
committed
update seafile ai deployment
1 parent 89491f6 commit a340b4f

File tree

6 files changed

+83
-20
lines changed

6 files changed

+83
-20
lines changed

manual/extension/seafile-ai.md

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
From Seafile 13, users can enable ***Seafile AI*** to support the following features:
44

5+
!!! note "Prerequisites of Seafile AI deployment"
6+
To deploy Seafile AI, you have to deploy [Metadat mmanagement](./metadata-server.md) extension firstly. Then you can follow this manual to deploy Seafile AI.
7+
58
- File tags, file and image summaries, text translation, sdoc writing assistance
69
- Given an image, generate its corresponding tags (including objects, weather, color, etc.)
710
- Detect faces in images and encode them
@@ -35,30 +38,85 @@ The Seafile AI basic service will use API calls to external large language model
3538

3639
2. Modify `.env`, insert or modify the following fields:
3740

38-
=== "Use ***gpt-4o-mini*** model"
41+
=== "OpenAI"
3942

4043
```
4144
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
4245

4346
ENABLE_SEAFILE_AI=true
47+
SEAFILE_AI_LLM_TYPE=openai
4448
SEAFILE_AI_LLM_KEY=<your openai LLM access key>
49+
SEAFILE_AI_LLM_MODEL=gpt-4o-mini # recommend
4550
```
46-
=== "Use other models"
51+
=== "Deepseek"
4752
```
4853
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
4954

5055
ENABLE_SEAFILE_AI=true
51-
SEAFILE_AI_LLM_TYPE=other
52-
SEAFILE_AI_LLM_URL=https://api.openai.com/v1 # your LLM API endpoint
56+
SEAFILE_AI_LLM_TYPE=deepseek
5357
SEAFILE_AI_LLM_KEY=<your LLM access key>
54-
SEAFILE_AI_LLM_MODEL=gpt-4o-mini # your model id
58+
SEAFILE_AI_LLM_MODEL=deepseek-chat # recommend
59+
```
60+
=== "Azure OpenAI"
61+
```
62+
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
63+
64+
ENABLE_SEAFILE_AI=true
65+
SEAFILE_AI_LLM_TYPE=azure
66+
SEAFILE_AI_LLM_URL= # your deployment url, leave blank to use default endpoint
67+
SEAFILE_AI_LLM_KEY=<your API key>
68+
SEAFILE_AI_LLM_MODEL=<your_deployment_name>
5569
```
70+
=== "Ollama"
71+
```
72+
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
73+
74+
ENABLE_SEAFILE_AI=true
75+
SEAFILE_AI_LLM_TYPE=ollama
76+
SEAFILE_AI_LLM_URL=<your LLM endpoint>
77+
SEAFILE_AI_LLM_KEY=<your LLM access key>
78+
SEAFILE_AI_LLM_MODEL=<your model-id>
79+
```
80+
=== "HuggingFace"
81+
```
82+
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
83+
84+
ENABLE_SEAFILE_AI=true
85+
SEAFILE_AI_LLM_TYPE=huggingface
86+
SEAFILE_AI_LLM_URL=<LLM Provider>/<your huggingface API endpoint>
87+
SEAFILE_AI_LLM_KEY=<your huggingface API key>
88+
SEAFILE_AI_LLM_MODEL=<model-id>
89+
```
90+
=== "Self-proxy Server"
91+
```
92+
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
93+
94+
ENABLE_SEAFILE_AI=true
95+
SEAFILE_AI_LLM_TYPE=proxy
96+
SEAFILE_AI_LLM_URL=<your proxy url>
97+
SEAFILE_AI_LLM_KEY=<your proxy virtual key>
98+
SEAFILE_AI_LLM_MODEL=<model-id>
99+
```
100+
=== "Other"
101+
Seafile AI utilizes [LiteLLM](https://docs.litellm.ai/docs/) to interact with LLM services. For a complete list of supported LLM providers, please refer to [this documentation](https://docs.litellm.ai/docs/providers). Then fill the following fields in your `.env`:
102+
103+
```
104+
COMPOSE_FILE='...,seafile-ai.yml' # add seafile-ai.yml
105+
ENABLE_SEAFILE_AI=true
106+
107+
# according to your situation
108+
SEAFILE_AI_LLM_TYPE=...
109+
SEAFILE_AI_LLM_URL=...
110+
SEAFILE_AI_LLM_KEY=...
111+
SEAFILE_AI_LLM_MODEL=...
112+
```
113+
114+
For example, if you are using a LLM service with ***OpenAI-compatible endpoints***, you should set `SEAFILE_AI_LLM_TYPE` to `other` or `openai`, and set other LLM configuration items accurately.
56115

57-
!!! note "About use custom model"
116+
117+
!!! note "About model selection"
58118

59-
Seafile AI supports the use of custom large models, but the following conditions must be met:
60-
- OpenAI compatibility API
61-
- The large model supports multi-modality (such as supporting images, etc.)
119+
Seafile AI supports using large model providers from [LiteLLM](https://docs.litellm.ai/docs/providers) or large model services with OpenAI-compatible endpoints. Therefore, Seafile AI is compatible with most custom large model services except the default model (*gpt-4o-mini*), but in order to ensure the normal use of Seafile AI features, you need to select a **multimodal large model** (such as supporting image input and recognition)
62120

63121

64122
3. Restart Seafile server:
@@ -87,11 +145,11 @@ The Seafile AI basic service will use API calls to external large language model
87145
| `REDIS_HOST` | Redis server host |
88146
| `REDIS_PORT` | Redis server port |
89147
| `REDIS_PASSWORD` | Redis server password |
90-
| `SEAFILE_AI_LLM_TYPE` | Large Language Model (LLM) Type. `openai` (default) will use OpenAI's ***gpt-4o-mini*** model and `other` for user-custom models which support multimodality |
91-
| `SEAFILE_AI_LLM_URL` | LLM API endpoint, only needs to be specified when `SEAFILE_AI_LLM_TYPE=other`. Default is `https://api.openai.com/v1` |
148+
| `SEAFILE_AI_LLM_TYPE` | Large Language Model (LLM) Type. Default is `openai`. |
149+
| `SEAFILE_AI_LLM_URL` | LLM API endpoint. Default is `` (none) |
92150
| `SEAFILE_AI_LLM_KEY` | LLM API key |
93151
| `FACE_EMBEDDING_SERVICE_URL` | Face embedding service url |
94-
| `SEAFILE_AI_LLM_MODEL` | LLM model id (or name), only needs to be specified when `SEAFILE_AI_LLM_TYPE=other`. Default is ***gpt-4o-mini*** |
152+
| `SEAFILE_AI_LLM_MODEL` | LLM model id (or name). Default is ***gpt-4o-mini*** |
95153

96154
then start your Seafile AI server:
97155

manual/repo/docker/ce/env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ NOTIFICATION_SERVER_URL=
7777

7878
## Seafile AI
7979
ENABLE_SEAFILE_AI=false
80+
SEAFILE_AI_LLM_TYPE=openai
8081
SEAFILE_AI_LLM_URL=
81-
SEAFILE_AI_LLM_KEY=
82+
SEAFILE_AI_LLM_KEY= # your llm key
83+
SEAFILE_AI_LLM_MODEL=gpt-4o-mini
8284

8385
## Metadata server
8486
MD_FILE_COUNT_LIMIT=100000

manual/repo/docker/pro/env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ NOTIFICATION_SERVER_URL=
119119

120120
## Seafile AI
121121
ENABLE_SEAFILE_AI=false
122+
SEAFILE_AI_LLM_TYPE=openai
122123
SEAFILE_AI_LLM_URL=
123-
SEAFILE_AI_LLM_KEY=
124+
SEAFILE_AI_LLM_KEY= # your llm key
125+
SEAFILE_AI_LLM_MODEL=gpt-4o-mini
124126

125127
## Metadata server
126128
MD_FILE_COUNT_LIMIT=100000

manual/repo/docker/seafile-ai.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ services:
77
# ports:
88
# - 8888:8888
99
environment:
10-
- SEAFILE_AI_LLM_TYPE=${SEAFILE_AI_LLM_TYPE:-openai}
11-
- SEAFILE_AI_LLM_URL=${SEAFILE_AI_LLM_URL:-https://api.openai.com/v1}
12-
- SEAFILE_AI_LLM_KEY=${SEAFILE_AI_LLM_KEY:?Variable is not set or empty}
10+
- SEAFILE_AI_LLM_TYPE=${SEAFILE_AI_LLM_TYPE:-}
11+
- SEAFILE_AI_LLM_URL=${SEAFILE_AI_LLM_URL:-}
12+
- SEAFILE_AI_LLM_KEY=${SEAFILE_AI_LLM_KEY:-}
1313
- SEAFILE_AI_LLM_MODEL=${SEAFILE_AI_LLM_MODEL:-gpt-4o-mini}
1414
- FACE_EMBEDDING_SERVICE_URL=${FACE_EMBEDDING_SERVICE_URL:-http://face-embedding:8886}
1515
- FACE_EMBEDDING_SERVICE_KEY=${FACE_EMBEDDING_SERVICE_KEY:-${JWT_PRIVATE_KEY:?Variable is not set or empty}}

manual/repo/docker/seafile-ai/env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ FACE_EMBEDDING_SERVICE_URL=
2020
SEAFILE_AI_LLM_TYPE=openai
2121
SEAFILE_AI_LLM_URL=
2222
SEAFILE_AI_LLM_KEY=... # your llm key
23+
SEAFILE_AI_LLM_MODEL=gpt-4o-mini
2324

2425
INNER_SEAHUB_SERVICE_URL= # https://seafile.example.com

manual/repo/docker/seafile-ai/seafile-ai.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ services:
77
ports:
88
- 8888:8888
99
environment:
10-
- SEAFILE_AI_LLM_TYPE=${SEAFILE_AI_LLM_TYPE:-openai}
11-
- SEAFILE_AI_LLM_URL=${SEAFILE_AI_LLM_URL:-https://api.openai.com/v1}
12-
- SEAFILE_AI_LLM_KEY=${SEAFILE_AI_LLM_KEY:?Variable is not set or empty}
10+
- SEAFILE_AI_LLM_TYPE=${SEAFILE_AI_LLM_TYPE:-}
11+
- SEAFILE_AI_LLM_URL=${SEAFILE_AI_LLM_URL:-}
12+
- SEAFILE_AI_LLM_KEY=${SEAFILE_AI_LLM_KEY:-}
1313
- SEAFILE_AI_LLM_MODEL=${SEAFILE_AI_LLM_MODEL:-gpt-4o-mini}
1414
- FACE_EMBEDDING_SERVICE_URL=${FACE_EMBEDDING_SERVICE_URL:-}
1515
- FACE_EMBEDDING_SERVICE_KEY=${FACE_EMBEDDING_SERVICE_KEY:-${JWT_PRIVATE_KEY:?Variable is not set or empty}}

0 commit comments

Comments
 (0)