-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrechat.yaml
More file actions
177 lines (171 loc) · 9.59 KB
/
Copy pathlibrechat.yaml
File metadata and controls
177 lines (171 loc) · 9.59 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
# =============================================================================
# Wiseway Staff Assistant — LibreChat runtime config
# =============================================================================
# Mounted into the container at /app/librechat.yaml (CONFIG_PATH points here).
# Keep ALL Wiseway customization here — never patch LibreChat source.
#
# Three branding knobs live in this repo:
# 1. APP_TITLE env (deploy/.env) -> browser tab + app name
# 2. interface.customWelcome (below) -> greeting on a fresh chat
# 3. interface.customFooter (below) -> footer line under the composer
# 4. deploy/wiseway-assets/*.svg -> logo + favicon (mounted over assets)
# See deploy/README.md for which knob does what.
# =============================================================================
version: 1.2.8
cache: true
# ---------------------------------------------------------------------------
# MCP settings — allowlist the internal doc-search hostname so LibreChat's
# SSRF guard permits the streamable-http connection. Without this, LibreChat
# blocks private/internal hostnames ("Domain ... is not allowed").
# ---------------------------------------------------------------------------
mcpSettings:
allowedDomains:
- "wiseway-doc-search"
# ---------------------------------------------------------------------------
# Interface — branding + which feature buttons are exposed
# ---------------------------------------------------------------------------
interface:
# APP_TITLE is read from env; the title that shows in the tab / header.
# (Set via deploy/.env -> APP_TITLE=Wiseway Assistant)
customWelcome: "Welcome to the Wiseway Staff Assistant. Ask about HR policy, SOPs, or safety procedures — answers are drawn only from the documents your role is allowed to see, and every fact is cited."
customFooter: "Wiseway Logistics — internal use only"
# Agents endpoint is the host for the Wiseway HR & SOP Assistant agent.
agents: true
# No native file upload search or web search for this demo — the MCP
# doc-search tool is the only retrieval path, and it is role-scoped.
fileSearch: false
webSearch: false
# ---------------------------------------------------------------------------
# Endpoints — local Ollama (native on the host, reached via host.docker.internal)
# ---------------------------------------------------------------------------
endpoints:
# Agents endpoint — required so we can build an agent that uses the
# role-scoped MCP doc-search tools. "tools" capability enables MCP tools.
agents:
disableBuilder: false
capabilities:
- "tools"
- "actions"
- "chain"
custom:
- name: "Ollama"
# Ollama ignores the API key but LibreChat requires a non-empty value.
apiKey: "ollama"
# Ollama runs NATIVELY on the macOS host (Metal GPU), not in Docker.
baseURL: "http://host.docker.internal:11434/v1/"
models:
default:
- "qwen2.5:7b"
# fetch:false — list models statically instead of querying Ollama at
# request time. A live fetch is racy: if it hasn't resolved when an agent
# initializes, model validation throws "endpoint_models_not_loaded" and
# the user sees "Models for Ollama could not be loaded". Static = reliable.
fetch: false
titleConvo: true
titleModel: "qwen2.5:7b"
# Single-message title payloads work best as a "user" role for local models.
titleMessageRole: "user"
modelDisplayLabel: "Ollama (qwen2.5:7b)"
# ---------------------------------------------------------------------------
# MCP servers — role-scoped Wiseway document search
# ---------------------------------------------------------------------------
# Identity is injected ONLY via headers. The doc-search service trusts these
# because the request also carries the shared MCP key. Role-based filtering
# happens server-side in the MCP tool, BEFORE results reach the model.
# X-User-Role -> {{LIBRECHAT_USER_ROLE}} (warehouse | driver | office | hr-admin,
# seeded per-user in Mongo — see deploy/seed-roles.sh)
# X-User-Id -> {{LIBRECHAT_USER_ID}}
# X-Mcp-Key -> ${WISEWAY_MCP_SHARED_SECRET} (env from deploy/.env)
mcpServers:
wiseway-docs:
type: streamable-http
url: "http://wiseway-doc-search:8000/mcp"
headers:
X-User-Role: "{{LIBRECHAT_USER_ROLE}}"
X-User-Id: "{{LIBRECHAT_USER_ID}}"
X-Mcp-Key: "${WISEWAY_MCP_SHARED_SECRET}"
timeout: 30000
startup: true
chatMenu: false
# ---------------------------------------------------------------------------
# Model specs — the curated "Wiseway HR & SOP Assistant" entry
# ---------------------------------------------------------------------------
# Two SOP agents are seeded automatically by deploy/create-agent.sh (via the
# LibreChat REST API), which also shares them publicly and patches the agent_ids
# below: "SOP Claude" (Anthropic Sonnet, the default for everyone) and "SOP"
# (local Ollama, the fallback). Both use the SAME gated wiseway-docs tools + the
# same citing prompt — only the model differs.
# The manual UI recipe is kept here for reference / customization (Agent Builder):
# 1. Sign in as an admin, open Agents -> create a new agent.
# 2. Endpoint = Ollama, model = qwen2.5:7b.
# 3. Add the MCP tools "search" and "fetch" from the wiseway-docs server.
# 4. Paste the system prompt below into the agent's instructions.
# 5. Save, copy the resulting agent id (looks like "agent_xxxxxxxx"), and
# paste it into preset.agent_id below, then restart LibreChat.
#
# Example agent system prompt (the citing instruction is load-bearing — the
# local model will NOT auto-cite, so we instruct it explicitly):
#
# You are the Wiseway HR & SOP Assistant. Answer staff questions about HR
# policy, standard operating procedures, and workplace safety using ONLY the
# wiseway-docs search and fetch tools. Always call search first. Cite every
# fact as a Markdown link [Title](source_url) using the title and source_url
# from each search hit. If search returns nothing relevant, say plainly that
# you do not know and that the answer is not in the documents you can access.
# Never invent policy. You only ever see documents this staff member's role
# is permitted to read.
#
# Pin the Wiseway HR & SOP Assistant as the default landing experience and
# brand it with the Wiseway logo. iconURL points at the mounted Wiseway
# logo.svg (served from /assets/); agent_id is the real id from the Agent
# Builder. The agent's own avatar (set in Mongo) is what renders in-chat.
modelSpecs:
prioritize: true
# enforce:false lets staff fall back to the plain Ollama model — and pick any
# OTHER agent the admin has shared — if the pinned SOP agent is unavailable.
# *** Set enforce:true for production *** to LOCK staff to the gated SOP agent,
# so they can never get un-cited, un-role-scoped answers from the bare model.
# (A plain-model chat has NO wiseway-docs tool, so no role gate and no citations
# — it can't leak docs, but it also can't honour the access policy.)
enforce: false
# Endpoints staff may pick in the CHAT selector. Deliberately NO cloud models
# here: Anthropic/OpenAI/Google are admin-managed and must NOT be selectable
# (or key-editable) by staff. They stay fully available to the admin in the
# Agent Builder's Provider dropdown (which is independent of this list), so the
# admin can still build agents on them. Staff are limited to the curated SOP
# agent + the local Ollama model.
# NOTE: addedEndpoints is global (applies to every role). Cloud models are
# kept out of staff reach by (a) their absence here and (b) the ADMIN-only
# "create agents" permission set in the Admin Settings panel. interface
# `modelSelect`/`modelSpecs.enforce` are global toggles, so they can't hide
# models from staff-only — role-based agent permissions are the lever.
addedEndpoints:
- "agents"
- "Ollama"
list:
# Default for everyone: the Claude (Anthropic Sonnet) SOP agent. Same gated
# MCP tools + citing prompt as the local SOP agent — only the model differs.
# Runs on endpoint "agents" (the agent calls Claude internally), so staff
# never pick the raw Anthropic endpoint and the "no cloud models in the staff
# selector" rule above still holds. Requires ANTHROPIC_API_KEY in deploy/.env.
- name: "sop-claude"
label: "SOP Claude"
default: true
description: "Cited answers on HR policy, SOPs and safety — scoped to your role."
iconURL: "/assets/icon-192x192.png"
greeting: "Hi — I'm the Wiseway HR & SOP Assistant. Ask me about leave, rosters, safety procedures, or any SOP. I only answer from the documents your role can see, and I link the source for every answer."
preset:
endpoint: "agents"
# Seeded + auto-patched by deploy/create-agent.sh (the "SOP Claude" agent).
agent_id: "agent_pE30gepVMJyNV3kHm6-Q4"
# The local (Ollama / qwen2.5:7b) SOP agent — kept as a no-cloud fallback that
# staff can still pick (enforce:false). Identical role gate + citing prompt.
- name: "sop"
label: "SOP (local)"
description: "Cited answers on HR policy, SOPs and safety — scoped to your role (local model)."
iconURL: "/assets/icon-192x192.png"
greeting: "Hi — I'm the Wiseway HR & SOP Assistant. Ask me about leave, rosters, safety procedures, or any SOP. I only answer from the documents your role can see, and I link the source for every answer."
preset:
endpoint: "agents"
# Seeded + auto-patched by deploy/create-agent.sh (the "SOP" agent).
agent_id: "agent_KfDm7NcIG3gia3vf8UfQS"