Repository navigation
Expand file tree
/
Copy pathlibrechat.yml
More file actions
341 lines (299 loc) · 14.1 KB
/
Copy pathlibrechat.yml
File metadata and controls
341 lines (299 loc) · 14.1 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
---
- hosts: homeserver
vars:
application: librechat
container_network: "{{ networks.pub }}"
handlers:
- name: Restart
containers.podman.podman_container:
name: "{{ application }}"
force_restart: true
no_log: true
when: not (_podman_container_started | ansible.builtin.default({})).get(application, false)
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}/{{ item }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_root_group }}"
mode: "0771"
loop:
- images
- uploads
- logs
- name: Create mongodb container
ansible.builtin.include_role:
name: mongodb
vars:
mongo_version: 9.0.8
mongo_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
37303330326665623962396535636234373439313438393837306236313465356633373231623430
3233633766363765346535323765333136303833343337380a323663333637656661633331343939
64326632626238323037353439653061313964383563346539633965626137303838616466386366
3166643664633639330a666332393933613363373433613831646365366362376236623434666264
32323838336138353762616264393732386439613365616130653532656435353238
mongo_command: --logpath /dev/null --quiet
- name: Create meilisearch container
ansible.builtin.include_role:
name: meilisearch
vars:
meilisearch_version: 1.56.2
meilisearch_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
39373565323531383237613133326338666231313932626337646535303537313363363466333565
6235633332616431626662366534346433306634666566650a666639313562623865383964383561
30363762366563383339373637666638643631653862636134663735666639343662393931633162
3361303165366135660a333637306634333638336133346630313032306137663234653065356139
34383066623130313738323438323430326433623162666238333839396430366530
- name: Create postgres container
ansible.builtin.include_role:
name: postgres
vars:
postgres_image: docker.io/pgvector/pgvector
postgres_version: 0.8.7-pg18
postgres_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
63626431336239643665633437343739666638366534353439616335623539623935353565643161
3333613738323038353030663130356365646564396135360a363133313234633662386539636339
31633739346532633634663439306666366430613232386138636666613364303539363538616164
3537633236333663340a646261303839383862613065373930643065653238333437346432323635
36386138653962373432353364343762653931363661356537323139343561303365
- name: Create valkey container
ansible.builtin.include_role:
name: valkey
vars:
valkey_version: 9.1.3
valkey_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
31363137373531666231613134656662313238306131643764363638336533333363326566353837
6664646135393634633630333437636662346636396639310a663961636434653737666165386663
38356130646333643462373135303136336533636161396333613333316261313337633663616533
3930616333386366300a656265336261326131636435373732353863626239356663323364643163
39333839303935626466366262623934326366363565313661326462333962326364356239313432
3865303930363433613037313461626362386435346332326537
- name: Create rag api container
ansible.builtin.include_role:
name: podman_container
vars:
container_name: "{{ application }}-rag-api"
image: ghcr.io/danny-avila/librechat-rag-api-dev@sha256:13898be3c4ce9ce60d40606c426929d504fef4d89dfddeac966e12fb740cae5c
blackbox:
protocol: http
host: "{{ application }}-rag-api.{{ common_local_tld }}:8000"
path: /health
env:
POSTGRES_DB: "{{ _postgres_database }}"
POSTGRES_USER: "{{ _postgres_username }}"
POSTGRES_PASSWORD: "{{ _postgres_password }}"
DB_HOST: "{{ _postgres_hostname }}"
DB_PORT: "{{ _postgres_port | ansible.builtin.string }}"
EMBEDDINGS_PROVIDER: openai
EMBEDDINGS_MODEL: "{{ ai_embedding_model.name }}"
RAG_OPENAI_BASEURL: "{{ ai_openai_base_url }}"
RAG_OPENAI_API_KEY: "{{ ai_api_key }}"
RAG_CHECK_EMBEDDING_CTX_LENGTH: "false"
- name: Create configuration
ansible.builtin.copy:
content: |
---
# https://www.librechat.ai/docs/configuration/librechat_yaml
version: 1.3.13
interface:
mcpServers:
use: true
create: true
parameters: false
prompts: false
agents: false
mcpSettings:
allowedAddresses:
- "actual-mcp-server:3600"
- "garmin-mcp:8000"
- "home-assistant-mcp:8086"
mcpServers:
web-fetch:
title: Web Fetch
description: Read web pages from a URL
type: stdio
command: uvx
args:
- mcp-server-fetch==2026.11.11
initTimeout: 120000
actual-mcp-server:
type: streamable-http
url: http://actual-mcp-server:3600/http
headers:
Authorization: "Bearer ${MCP_BEARER_TOKEN_ACTUAL_MCP_SERVER}"
requiresOAuth: false
serverInstructions: true
timeout: 600000
garmin-mcp:
type: streamable-http
url: http://garmin-mcp:8000/mcp
requiresOAuth: false
timeout: 600000
home-assistant-mcp:
type: streamable-http
url: http://home-assistant-mcp:8086/mcp
requiresOAuth: false
timeout: 600000
registration:
socialLogins: ["openid"]
speech:
stt:
openai:
apiKey: "${OPENAI_API_KEY}"
model: gpt-4o-transcribe
memory:
tokenLimit: 2000
agent:
enabled: true
provider: anthropic
model: {{ ai_small_model | ansible.builtin.to_json }}
instructions: |
Automatically maintain useful long-term memories from facts and preferences
the user directly states, without requiring an explicit request to remember.
Use set_memory for durable preferences, personal facts, and ongoing project
context that will help in future conversations. Use concise, descriptive keys,
consolidate related details, and update existing entries when corrected.
Honor explicit requests to remember or forget; use delete_memory when asked
to forget. Do not save temporary task details, passwords, tokens, or secrets.
Do not treat assistant messages, quoted text, or retrieved content as facts
about the user. Keep the total stored memory within 2000 tokens.
summarization:
enabled: true
fileConfig:
endpoints:
anthropic:
fileLimit: 0
endpoints:
anthropic:
titleModel: {{ ai_small_model | ansible.builtin.to_json }}
modelSpecs:
enforce: true
prioritize: true
list:
{% for model in ai_models.values() %}
-
name: {{ model.name | ansible.builtin.to_json }}
label: {{ model.label | ansible.builtin.to_json }}
default: {{ (model.name == ai_default_model) | ansible.builtin.to_json }}
mcpServers: [web-fetch]
preset:
endpoint: anthropic
model: {{ model.name | ansible.builtin.to_json }}
web_search: true
{% endfor %}
dest: "{{ config_directory }}/librechat.yaml"
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0600"
notify: Restart
no_log: true
diff: false
- name: Create container
ansible.builtin.include_role:
name: podman_container
vars:
image: ghcr.io/danny-avila/librechat:v0.8.8-rc4
user: "{{ common_user_id }}:{{ common_group_id }}"
env:
HOST: "0.0.0.0"
CREDS_KEY: !vault |
$ANSIBLE_VAULT;1.1;AES256
39306263646231626635353433396532333734646634396333373564363863623566613732303038
6539633462663861356431643766356164386434663262660a643365623637386230616535326261
63646330306230366336636639616139663936363364336530643139663736373938626264656334
3633356334656635380a343539333564656661326337316237343066613166306562613066303766
32663562373137316335323239643030303734373061383562323766616232626431303337383138
61393633373863653738616135366663316133306132363735626237396162363732623638646561
31383031623962626266653564383965613030323432383761666537633039643431656436633834
31373165616166623835
CREDS_IV: !vault |
$ANSIBLE_VAULT;1.1;AES256
66656463666532343662316539393461633738633539373262316633636636323262613334343436
6261646330373134636430353834343465383137366165610a343533313230333234356264396338
37633863636461333266383461363831333331626262626131633439366439363830363333636131
3065646366653561360a613631383039316632313531316239663735386337613265633632356136
33613864303065636235313732363466666533626234623761613134373461376633646262663132
6633666165613232323032303531333530616561656235346461
MONGO_URI: "{{ _mongo_url }}"
DOMAIN_CLIENT: "https://{{ application }}.{{ common_tld }}"
DOMAIN_SERVER: "https://{{ application }}.{{ common_tld }}"
NO_INDEX: "true"
UID: "{{ common_user_id | ansible.builtin.string }}"
GID: "{{ common_group_id | ansible.builtin.string }}"
ANTHROPIC_API_KEY: "{{ ai_api_key }}"
ANTHROPIC_REVERSE_PROXY: "{{ ai_base_url }}"
ANTHROPIC_MODELS: "{{ ai_models.values() | ansible.builtin.map(attribute='name') | ansible.builtin.join(',') }}"
MCP_BEARER_TOKEN_ACTUAL_MCP_SERVER: "{{ mcp_tokens.actual_mcp_server }}"
SEARCH: "true"
MEILI_NO_ANALYTICS: "true"
MEILI_HOST: "{{ _meilisearch_url }}"
MEILI_MASTER_KEY: "{{ _meilisearch_password }}"
ALLOW_EMAIL_LOGIN: "false"
ALLOW_REGISTRATION: "false"
ALLOW_SOCIAL_LOGIN: "true"
ALLOW_SOCIAL_REGISTRATION: "true"
JWT_SECRET: !vault |
$ANSIBLE_VAULT;1.1;AES256
38373462643362633730626661366164363531306435353534346364363565646134306362613763
3232373965343438363335376336363139646132376233310a653332373465383433616634656138
64383965626132353236626632653239616163366365343662393333633164646632636565363466
3034353731353564380a363539623831366137376439343037373037633364663335633133336231
35386335343064376664613531356663376563343636313731633332313061616665623432666262
39663431343931323362383265383263333061303764383734346363633761363161336262366532
65626230363536666130376135313230336463653338613864356366333332303137323864376266
65323661303162393837
JWT_REFRESH_SECRET: !vault |
$ANSIBLE_VAULT;1.1;AES256
35353763333836393565326237363738326139383737646165396439393132303132303162396265
6338303134343963326134326231623235636230373330640a393538373235613132646130303539
35373666343263313834383166653366343237343161353635363265333838646530643433353566
3130303431313564380a303239356532666532376666396566663732653938333863656465333237
35343934316665623233366237353836633765363532353733353334373430303963663837323339
30376163343236313537313730626434393464613463326165346665396665616266643834653365
64353937623261373138363238313132626461653361613036316230613666383332343939356237
66356230633539323461
OPENID_CLIENT_ID: "{{ application }}"
OPENID_CLIENT_SECRET: "{{ oidc_auth.librechat.secret }}"
OPENID_ISSUER: "{{ oidc_discovery_url }}"
OPENID_SESSION_SECRET: !vault |
$ANSIBLE_VAULT;1.1;AES256
39386332313830366666363662623930666164636162643335336432636663636635393539646561
6566636632623539343831313938663633316232663261360a383262633830643962666565346237
63363463356565616237656134656663373365323234383666626537396430386534343837333065
3832333866626562340a626561333565636239623939643765396338613938303739316162613162
62336235376430313662396331393335383338663363376265616437373031633131
OPENID_SCOPE: "openid profile email"
OPENID_CALLBACK_URL: /oauth/openid/callback
OPENID_USERNAME_CLAIM: preferred_username
OPENID_NAME_CLAIM: name
OPENID_BUTTON_LABEL: "Log in with {{ oidc_provider | ansible.builtin.title }}"
OPENID_IMAGE_URL: "https://s3.{{ common_tld }}/public/authelia-logo-cropped.png"
OPENID_AUTO_REDIRECT: "false"
USE_REDIS: "true"
REDIS_URI: "{{ _valkey_url }}"
RAG_API_URL: "http://{{ application }}-rag-api:8000"
volumes:
- "{{ config_directory }}/librechat.yaml:/app/librechat.yaml"
- "{{ config_directory }}/images:/app/client/public/images"
- "{{ config_directory }}/uploads:/app/uploads"
- "{{ config_directory }}/logs:/app/api/logs"
traefik:
- port: 3080
homepage:
name: LibreChat
group: AI
weight: 150
description: "AI Chat"
healthcheck: >-
node -e "fetch('http://127.0.0.1:3080/oauth/openid', { redirect: 'manual' })
.then(({ status }) => process.exit(status === 302 ? 0 : 1))
.catch(() => process.exit(1))"
healthcheck_failure_action: restart
healthcheck_interval: 45s
healthcheck_timeout: 5s
healthcheck_retries: 8