totem-llm 0.12.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/.env +16 -487
- package/server/endpoints/telegram.js +14 -11
- package/server/jobs/handle-telegram-chat.js +2 -0
- package/server/public/assets/{index-411d64a7.js → index-cc73e159.js} +1 -1
- package/server/public/assets/{index-61f5a969.js → index-f2c6653e.js} +1 -1
- package/server/public/assets/{index-a675b600.js → index-fd99e568.js} +2 -2
- package/server/public/index.js +2 -2
- package/server/utils/AiProviders/openRouter/index.js +23 -0
- package/server/utils/helpers/updateENV.js +14 -2
- package/server/utils/telegramBot/chat/agent.js +3 -4
- package/server/utils/telegramBot/chat/stream.js +196 -76
- package/server/utils/telegramBot/constants.js +21 -2
- package/server/utils/telegramBot/index.js +197 -33
- package/server/utils/telegramBot/utils/commands/handlers/groupManagement.js +257 -0
- package/server/utils/telegramBot/utils/commands/index.js +20 -0
- package/server/utils/telegramBot/utils/index.js +112 -0
- package/server/utils/telegramBot/utils/navigation/index.js +6 -2
- package/server/utils/telegramBot/utils/verification.js +57 -0
package/package.json
CHANGED
package/server/.env
CHANGED
|
@@ -1,490 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
JWT_SECRET="my-random-string-for-seeding" # Please generate random string at least 12 chars long.
|
|
4
|
-
# JWT_EXPIRY="30d" # (optional) https://docs.anythingllm.com/configuration#custom-ttl-for-sessions
|
|
5
|
-
SIG_KEY='passphrase' # Please generate random string at least 32 chars long.
|
|
6
|
-
SIG_SALT='salt' # Please generate random string at least 32 chars long.
|
|
7
|
-
STORAGE_DIR=./storage # absolute filesystem path with no trailing slash. This is where all data including vector db and file uploads will be stored. Must be writable by the server process.
|
|
8
|
-
|
|
9
|
-
###########################################
|
|
10
|
-
######## LLM API SElECTION ################
|
|
11
|
-
###########################################
|
|
12
|
-
# LLM_PROVIDER='openai'
|
|
13
|
-
# OPEN_AI_KEY=
|
|
14
|
-
# OPEN_MODEL_PREF='gpt-4o'
|
|
15
|
-
|
|
16
|
-
# LLM_PROVIDER='gemini'
|
|
17
|
-
# GEMINI_API_KEY=
|
|
18
|
-
# GEMINI_LLM_MODEL_PREF='gemini-2.0-flash-lite'
|
|
19
|
-
|
|
20
|
-
# LLM_PROVIDER='azure'
|
|
21
|
-
# AZURE_OPENAI_ENDPOINT=
|
|
22
|
-
# AZURE_OPENAI_KEY=
|
|
23
|
-
# AZURE_OPENAI_MODEL_PREF='my-gpt35-deployment' # This is the "deployment" on Azure you want to use. Not the base model.
|
|
24
|
-
# EMBEDDING_MODEL_PREF='embedder-model' # This is the "deployment" on Azure you want to use for embeddings. Not the base model. Valid base model is text-embedding-ada-002
|
|
25
|
-
|
|
26
|
-
# LLM_PROVIDER='anthropic'
|
|
27
|
-
# ANTHROPIC_API_KEY=sk-ant-xxxx
|
|
28
|
-
# ANTHROPIC_MODEL_PREF='claude-sonnet-4-6'
|
|
29
|
-
# ANTHROPIC_CACHE_CONTROL="5m" # Enable prompt caching (5m=5min cache, 1h=1hour cache). Reduces costs and improves speed by caching system prompts.
|
|
30
|
-
|
|
31
|
-
# LLM_PROVIDER='lmstudio'
|
|
32
|
-
# LMSTUDIO_BASE_PATH='http://your-server:1234/v1'
|
|
33
|
-
# LMSTUDIO_MODEL_PREF='Loaded from Chat UI' # this is a bug in LMStudio 0.2.17
|
|
34
|
-
# LMSTUDIO_MODEL_TOKEN_LIMIT=4096
|
|
35
|
-
# LMSTUDIO_AUTH_TOKEN='your-lmstudio-auth-token-here'
|
|
36
|
-
|
|
37
|
-
# LLM_PROVIDER='localai'
|
|
38
|
-
# LOCAL_AI_BASE_PATH='http://localhost:8080/v1'
|
|
39
|
-
# LOCAL_AI_MODEL_PREF='luna-ai-llama2'
|
|
40
|
-
# LOCAL_AI_MODEL_TOKEN_LIMIT=4096
|
|
41
|
-
# LOCAL_AI_API_KEY="sk-123abc"
|
|
42
|
-
|
|
43
|
-
LLM_PROVIDER='ollama'
|
|
1
|
+
# Auto-dump ENV from system call on 22:15:04 GMT-0400 (Eastern Daylight Time)
|
|
2
|
+
LLM_PROVIDER='openrouter'
|
|
44
3
|
OLLAMA_BASE_PATH='http://127.0.0.1:11434'
|
|
45
4
|
OLLAMA_MODEL_PREF='qwen3.5:2b'
|
|
46
|
-
OLLAMA_MODEL_TOKEN_LIMIT=4096
|
|
5
|
+
OLLAMA_MODEL_TOKEN_LIMIT='4096'
|
|
47
6
|
OLLAMA_AUTH_TOKEN='your-ollama-auth-token-here (optional, only for ollama running behind auth - Bearer token)'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# LLM_PROVIDER='deepseek'
|
|
63
|
-
# DEEPSEEK_API_KEY=YOUR_API_KEY
|
|
64
|
-
# DEEPSEEK_MODEL_PREF='deepseek-chat'
|
|
65
|
-
|
|
66
|
-
LLM_PROVIDER='openrouter'
|
|
67
|
-
OPENROUTER_API_KEY='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'
|
|
68
|
-
OPENROUTER_MODEL_PREF='openrouter/auto'
|
|
69
|
-
|
|
70
|
-
# LLM_PROVIDER='mistral'
|
|
71
|
-
# MISTRAL_API_KEY='example-mistral-ai-api-key'
|
|
72
|
-
# MISTRAL_MODEL_PREF='mistral-tiny'
|
|
73
|
-
|
|
74
|
-
# LLM_PROVIDER='huggingface'
|
|
75
|
-
# HUGGING_FACE_LLM_ENDPOINT=https://uuid-here.us-east-1.aws.endpoints.huggingface.cloud
|
|
76
|
-
# HUGGING_FACE_LLM_API_KEY=hf_xxxxxx
|
|
77
|
-
# HUGGING_FACE_LLM_TOKEN_LIMIT=8000
|
|
78
|
-
|
|
79
|
-
# LLM_PROVIDER='groq'
|
|
80
|
-
# GROQ_API_KEY=gsk_abcxyz
|
|
81
|
-
# GROQ_MODEL_PREF=llama3-8b-8192
|
|
82
|
-
|
|
83
|
-
# LLM_PROVIDER='koboldcpp'
|
|
84
|
-
# KOBOLD_CPP_BASE_PATH='http://127.0.0.1:5000/v1'
|
|
85
|
-
# KOBOLD_CPP_MODEL_PREF='koboldcpp/codellama-7b-instruct.Q4_K_S'
|
|
86
|
-
# KOBOLD_CPP_MODEL_TOKEN_LIMIT=4096
|
|
87
|
-
# KOBOLD_CPP_MAX_TOKENS=2048
|
|
88
|
-
|
|
89
|
-
# LLM_PROVIDER='textgenwebui'
|
|
90
|
-
# TEXT_GEN_WEB_UI_BASE_PATH='http://127.0.0.1:5000/v1'
|
|
91
|
-
# TEXT_GEN_WEB_UI_TOKEN_LIMIT=4096
|
|
92
|
-
# TEXT_GEN_WEB_UI_API_KEY='sk-123abc'
|
|
93
|
-
|
|
94
|
-
# LLM_PROVIDER='generic-openai'
|
|
95
|
-
# GENERIC_OPEN_AI_BASE_PATH='http://proxy.url.openai.com/v1'
|
|
96
|
-
# GENERIC_OPEN_AI_MODEL_PREF='gpt-3.5-turbo'
|
|
97
|
-
# GENERIC_OPEN_AI_MODEL_TOKEN_LIMIT=4096
|
|
98
|
-
# GENERIC_OPEN_AI_API_KEY=sk-123abc
|
|
99
|
-
# GENERIC_OPEN_AI_CUSTOM_HEADERS="X-Custom-Auth:my-secret-key,X-Custom-Header:my-value" (useful if using a proxy that requires authentication or other headers)
|
|
100
|
-
|
|
101
|
-
# LLM_PROVIDER='litellm'
|
|
102
|
-
# LITE_LLM_MODEL_PREF='gpt-3.5-turbo'
|
|
103
|
-
# LITE_LLM_MODEL_TOKEN_LIMIT=4096
|
|
104
|
-
# LITE_LLM_BASE_PATH='http://127.0.0.1:4000'
|
|
105
|
-
# LITE_LLM_API_KEY='sk-123abc'
|
|
106
|
-
|
|
107
|
-
# LLM_PROVIDER='novita'
|
|
108
|
-
# NOVITA_LLM_API_KEY='your-novita-api-key-here' check on https://novita.ai/settings#key-management
|
|
109
|
-
# NOVITA_LLM_MODEL_PREF='deepseek/deepseek-r1'
|
|
110
|
-
|
|
111
|
-
# LLM_PROVIDER='cohere'
|
|
112
|
-
# COHERE_API_KEY=
|
|
113
|
-
# COHERE_MODEL_PREF='command-r'
|
|
114
|
-
|
|
115
|
-
# LLM_PROVIDER='cometapi'
|
|
116
|
-
# COMETAPI_LLM_API_KEY='your-cometapi-key-here' # Get one at https://api.cometapi.com/console/token
|
|
117
|
-
# COMETAPI_LLM_MODEL_PREF='gpt-5-mini'
|
|
118
|
-
# COMETAPI_LLM_TIMEOUT_MS=500 # Optional; stream idle timeout in ms (min 500ms)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
# LLM_PROVIDER='bedrock'
|
|
122
|
-
# AWS_BEDROCK_LLM_ACCESS_KEY_ID=
|
|
123
|
-
# AWS_BEDROCK_LLM_ACCESS_KEY=
|
|
124
|
-
# AWS_BEDROCK_LLM_REGION=us-west-2
|
|
125
|
-
# AWS_BEDROCK_LLM_MODEL_PREFERENCE=meta.llama3-1-8b-instruct-v1:0
|
|
126
|
-
# AWS_BEDROCK_LLM_MODEL_TOKEN_LIMIT=8191
|
|
127
|
-
# AWS_BEDROCK_LLM_CONNECTION_METHOD=iam
|
|
128
|
-
# AWS_BEDROCK_LLM_MAX_OUTPUT_TOKENS=4096
|
|
129
|
-
# AWS_BEDROCK_LLM_SESSION_TOKEN= # Only required if CONNECTION_METHOD is 'sessionToken'
|
|
130
|
-
# or even use Short and Long Term API keys
|
|
131
|
-
# AWS_BEDROCK_LLM_CONNECTION_METHOD="apiKey"
|
|
132
|
-
# AWS_BEDROCK_LLM_API_KEY=
|
|
133
|
-
|
|
134
|
-
# LLM_PROVIDER='apipie'
|
|
135
|
-
# APIPIE_LLM_API_KEY='sk-123abc'
|
|
136
|
-
# APIPIE_LLM_MODEL_PREF='openrouter/llama-3.1-8b-instruct'
|
|
137
|
-
|
|
138
|
-
# LLM_PROVIDER='xai'
|
|
139
|
-
# XAI_LLM_API_KEY='xai-your-api-key-here'
|
|
140
|
-
# XAI_LLM_MODEL_PREF='grok-beta'
|
|
141
|
-
|
|
142
|
-
# LLM_PROVIDER='zai'
|
|
143
|
-
# ZAI_API_KEY="your-zai-api-key-here"
|
|
144
|
-
# ZAI_MODEL_PREF="glm-4.5"
|
|
145
|
-
|
|
146
|
-
# LLM_PROVIDER='nvidia-nim'
|
|
147
|
-
# NVIDIA_NIM_LLM_BASE_PATH='http://127.0.0.1:8000'
|
|
148
|
-
# NVIDIA_NIM_LLM_MODEL_PREF='meta/llama-3.2-3b-instruct'
|
|
149
|
-
|
|
150
|
-
# LLM_PROVIDER='ppio'
|
|
151
|
-
# PPIO_API_KEY='your-ppio-api-key-here'
|
|
152
|
-
# PPIO_MODEL_PREF='deepseek/deepseek-v3/community'
|
|
153
|
-
|
|
154
|
-
# LLM_PROVIDER='moonshotai'
|
|
155
|
-
# MOONSHOT_AI_API_KEY='your-moonshot-api-key-here'
|
|
156
|
-
# MOONSHOT_AI_MODEL_PREF='moonshot-v1-32k'
|
|
157
|
-
|
|
158
|
-
# LLM_PROVIDER='foundry'
|
|
159
|
-
# FOUNDRY_BASE_PATH='http://127.0.0.1:55776'
|
|
160
|
-
# FOUNDRY_MODEL_PREF='phi-3.5-mini'
|
|
161
|
-
# FOUNDRY_MODEL_TOKEN_LIMIT=4096
|
|
162
|
-
|
|
163
|
-
# LLM_PROVIDER='giteeai'
|
|
164
|
-
# GITEE_AI_API_KEY=
|
|
165
|
-
# GITEE_AI_MODEL_PREF=
|
|
166
|
-
# GITEE_AI_MODEL_TOKEN_LIMIT=
|
|
167
|
-
|
|
168
|
-
# LLM_PROVIDER='docker-model-runner'
|
|
169
|
-
# DOCKER_MODEL_RUNNER_BASE_PATH='http://127.0.0.1:12434'
|
|
170
|
-
# DOCKER_MODEL_RUNNER_LLM_MODEL_PREF='phi-3.5-mini'
|
|
171
|
-
# DOCKER_MODEL_RUNNER_LLM_MODEL_TOKEN_LIMIT=4096
|
|
172
|
-
|
|
173
|
-
# LLM_PROVIDER='privatemode'
|
|
174
|
-
# PRIVATEMODE_LLM_BASE_PATH='http://127.0.0.1:8080'
|
|
175
|
-
# PRIVATEMODE_LLM_MODEL_PREF='gemma-3-27b'
|
|
176
|
-
|
|
177
|
-
# LLM_PROVIDER='sambanova'
|
|
178
|
-
# SAMBANOVA_LLM_API_KEY='xxx-xxx-xxx'
|
|
179
|
-
# SAMBANOVA_LLM_MODEL_PREF='gpt-oss-120b'
|
|
180
|
-
|
|
181
|
-
# LLM_PROVIDER='lemonade'
|
|
182
|
-
# LEMONADE_LLM_BASE_PATH='http://127.0.0.1:8000'
|
|
183
|
-
# LEMONADE_LLM_MODEL_PREF='Llama-3.2-1B-Instruct-GGUF'
|
|
184
|
-
# LEMONADE_LLM_MODEL_TOKEN_LIMIT=8192
|
|
185
|
-
# LEMONADE_LLM_API_KEY=
|
|
186
|
-
|
|
187
|
-
# LLM_PROVIDER='minimax'
|
|
188
|
-
# MINIMAX_API_KEY='sk-cp-...'
|
|
189
|
-
# MINIMAX_MODEL_PREF='MiniMax-M2.7'
|
|
190
|
-
|
|
191
|
-
# LLM_PROVIDER='anythingllm-router'
|
|
192
|
-
# MODEL_ROUTER_ID=1
|
|
193
|
-
|
|
194
|
-
###########################################
|
|
195
|
-
######## Embedding API SElECTION ##########
|
|
196
|
-
###########################################
|
|
197
|
-
# This will be the assumed default embedding seleciton and model
|
|
198
|
-
# EMBEDDING_ENGINE='native'
|
|
199
|
-
# EMBEDDING_MODEL_PREF='Xenova/all-MiniLM-L6-v2'
|
|
200
|
-
|
|
201
|
-
# Only used if you are using an LLM that does not natively support embedding (openai or Azure)
|
|
202
|
-
# EMBEDDING_ENGINE='openai'
|
|
203
|
-
# OPEN_AI_KEY=sk-xxxx
|
|
204
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
205
|
-
|
|
206
|
-
# EMBEDDING_ENGINE='azure'
|
|
207
|
-
# AZURE_OPENAI_ENDPOINT=
|
|
208
|
-
# AZURE_OPENAI_KEY=
|
|
209
|
-
# EMBEDDING_MODEL_PREF='my-embedder-model' # This is the "deployment" on Azure you want to use for embeddings. Not the base model. Valid base model is text-embedding-ada-002
|
|
210
|
-
|
|
211
|
-
# EMBEDDING_ENGINE='localai'
|
|
212
|
-
# EMBEDDING_BASE_PATH='http://localhost:8080/v1'
|
|
213
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
214
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=1000 # The max chunk size in chars a string to embed can be
|
|
215
|
-
|
|
216
|
-
# EMBEDDING_ENGINE='ollama'
|
|
217
|
-
# EMBEDDING_BASE_PATH='http://127.0.0.1:11434'
|
|
218
|
-
# EMBEDDING_MODEL_PREF='nomic-embed-text:latest'
|
|
219
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
220
|
-
|
|
221
|
-
# EMBEDDING_ENGINE='lmstudio'
|
|
222
|
-
# EMBEDDING_BASE_PATH='https://localhost:1234/v1'
|
|
223
|
-
# EMBEDDING_MODEL_PREF='nomic-ai/nomic-embed-text-v1.5-GGUF/nomic-embed-text-v1.5.Q4_0.gguf'
|
|
224
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
225
|
-
|
|
226
|
-
# EMBEDDING_ENGINE='cohere'
|
|
227
|
-
# COHERE_API_KEY=
|
|
228
|
-
# EMBEDDING_MODEL_PREF='embed-english-v3.0'
|
|
229
|
-
|
|
230
|
-
# EMBEDDING_ENGINE='voyageai'
|
|
231
|
-
# VOYAGEAI_API_KEY=
|
|
232
|
-
# EMBEDDING_MODEL_PREF='voyage-large-2-instruct'
|
|
233
|
-
|
|
234
|
-
# EMBEDDING_ENGINE='litellm'
|
|
235
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
236
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
237
|
-
# LITE_LLM_BASE_PATH='http://127.0.0.1:4000'
|
|
238
|
-
# LITE_LLM_API_KEY='sk-123abc'
|
|
239
|
-
|
|
240
|
-
# EMBEDDING_ENGINE='generic-openai'
|
|
241
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
242
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
243
|
-
# EMBEDDING_BASE_PATH='http://127.0.0.1:4000'
|
|
244
|
-
# GENERIC_OPEN_AI_EMBEDDING_API_KEY='sk-123abc'
|
|
245
|
-
# GENERIC_OPEN_AI_EMBEDDING_MAX_CONCURRENT_CHUNKS=500
|
|
246
|
-
# GENERIC_OPEN_AI_EMBEDDING_API_DELAY_MS=1000
|
|
247
|
-
|
|
248
|
-
# EMBEDDING_ENGINE='gemini'
|
|
249
|
-
# GEMINI_EMBEDDING_API_KEY=
|
|
250
|
-
# EMBEDDING_MODEL_PREF='text-embedding-004'
|
|
251
|
-
|
|
252
|
-
# EMBEDDING_ENGINE='openrouter'
|
|
253
|
-
# EMBEDDING_MODEL_PREF='baai/bge-m3'
|
|
254
|
-
# OPENROUTER_API_KEY=''
|
|
255
|
-
|
|
256
|
-
# EMBEDDING_ENGINE='lemonade'
|
|
257
|
-
# EMBEDDING_BASE_PATH='http://127.0.0.1:8000'
|
|
258
|
-
# EMBEDDING_MODEL_PREF='Qwen3-embedder'
|
|
259
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
260
|
-
|
|
261
|
-
###########################################
|
|
262
|
-
######## Vector Database Selection ########
|
|
263
|
-
###########################################
|
|
264
|
-
# Enable all below if you are using vector database: Chroma.
|
|
265
|
-
# VECTOR_DB="chroma"
|
|
266
|
-
# CHROMA_ENDPOINT='http://localhost:8000'
|
|
267
|
-
# CHROMA_API_HEADER="X-Api-Key"
|
|
268
|
-
# CHROMA_API_KEY="sk-123abc"
|
|
269
|
-
|
|
270
|
-
# Enable all below if you are using vector database: Chroma Cloud.
|
|
271
|
-
# VECTOR_DB="chromacloud"
|
|
272
|
-
# CHROMACLOUD_API_KEY="ck-your-api-key"
|
|
273
|
-
# CHROMACLOUD_TENANT=
|
|
274
|
-
# CHROMACLOUD_DATABASE=
|
|
275
|
-
|
|
276
|
-
# Enable all below if you are using vector database: Pinecone.
|
|
277
|
-
# VECTOR_DB="pinecone"
|
|
278
|
-
# PINECONE_API_KEY=
|
|
279
|
-
# PINECONE_INDEX=
|
|
280
|
-
|
|
281
|
-
# Enable all below if you are using vector database: Astra DB.
|
|
282
|
-
# VECTOR_DB="astra"
|
|
283
|
-
# ASTRA_DB_APPLICATION_TOKEN=
|
|
284
|
-
# ASTRA_DB_ENDPOINT=
|
|
285
|
-
|
|
286
|
-
# Enable all below if you are using vector database: LanceDB.
|
|
287
|
-
VECTOR_DB="lancedb"
|
|
288
|
-
|
|
289
|
-
# Enable all below if you are using vector database: PG Vector.
|
|
290
|
-
# VECTOR_DB="pgvector"
|
|
291
|
-
# PGVECTOR_CONNECTION_STRING="postgresql://dbuser:dbuserpass@localhost:5432/yourdb"
|
|
292
|
-
# PGVECTOR_TABLE_NAME="anythingllm_vectors" # optional, but can be defined
|
|
293
|
-
|
|
294
|
-
# Enable all below if you are using vector database: Weaviate.
|
|
295
|
-
# VECTOR_DB="weaviate"
|
|
296
|
-
# WEAVIATE_ENDPOINT="http://localhost:8080"
|
|
297
|
-
# WEAVIATE_API_KEY=
|
|
298
|
-
|
|
299
|
-
# Enable all below if you are using vector database: Qdrant.
|
|
300
|
-
# VECTOR_DB="qdrant"
|
|
301
|
-
# QDRANT_ENDPOINT="http://localhost:6333"
|
|
302
|
-
# QDRANT_API_KEY=
|
|
303
|
-
|
|
304
|
-
# Enable all below if you are using vector database: Milvus.
|
|
305
|
-
# VECTOR_DB="milvus"
|
|
306
|
-
# MILVUS_ADDRESS="http://localhost:19530"
|
|
307
|
-
# MILVUS_USERNAME=
|
|
308
|
-
# MILVUS_PASSWORD=
|
|
309
|
-
|
|
310
|
-
# Enable all below if you are using vector database: Zilliz Cloud.
|
|
311
|
-
# VECTOR_DB="zilliz"
|
|
312
|
-
# ZILLIZ_ENDPOINT="https://sample.api.gcp-us-west1.zillizcloud.com"
|
|
313
|
-
# ZILLIZ_API_TOKEN=api-token-here
|
|
314
|
-
|
|
315
|
-
###########################################
|
|
316
|
-
######## Audio Model Selection ############
|
|
317
|
-
###########################################
|
|
318
|
-
# (default) use built-in whisper-small model.
|
|
319
|
-
WHISPER_PROVIDER="local"
|
|
320
|
-
|
|
321
|
-
# use openai hosted whisper model.
|
|
322
|
-
# WHISPER_PROVIDER="openai"
|
|
323
|
-
# OPEN_AI_KEY=sk-xxxxxxxx
|
|
324
|
-
|
|
325
|
-
###########################################
|
|
326
|
-
######## TTS/STT Model Selection ##########
|
|
327
|
-
###########################################
|
|
328
|
-
TTS_PROVIDER="native"
|
|
329
|
-
|
|
330
|
-
# TTS_PROVIDER="openai"
|
|
331
|
-
# TTS_OPEN_AI_KEY=sk-example
|
|
332
|
-
# TTS_OPEN_AI_VOICE_MODEL=nova
|
|
333
|
-
|
|
334
|
-
# TTS_PROVIDER="elevenlabs"
|
|
335
|
-
# TTS_ELEVEN_LABS_KEY=
|
|
336
|
-
# TTS_ELEVEN_LABS_VOICE_MODEL=21m00Tcm4TlvDq8ikWAM # Rachel
|
|
337
|
-
|
|
338
|
-
# TTS_PROVIDER="generic-openai"
|
|
339
|
-
# TTS_OPEN_AI_COMPATIBLE_KEY=sk-example
|
|
340
|
-
# TTS_OPEN_AI_COMPATIBLE_MODEL=tts-1
|
|
341
|
-
# TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL=nova
|
|
342
|
-
# TTS_OPEN_AI_COMPATIBLE_ENDPOINT="https://api.openai.com/v1"
|
|
343
|
-
|
|
344
|
-
# CLOUD DEPLOYMENT VARIRABLES ONLY
|
|
345
|
-
# AUTH_TOKEN="hunter2" # This is the password to your application if remote hosting.
|
|
346
|
-
# STORAGE_DIR= # absolute filesystem path with no trailing slash
|
|
347
|
-
|
|
348
|
-
###########################################
|
|
349
|
-
######## PASSWORD COMPLEXITY ##############
|
|
350
|
-
###########################################
|
|
351
|
-
# Enforce a password schema for your organization users.
|
|
352
|
-
# Documentation on how to use https://github.com/kamronbatman/joi-password-complexity
|
|
353
|
-
#PASSWORDMINCHAR=8
|
|
354
|
-
#PASSWORDMAXCHAR=250
|
|
355
|
-
#PASSWORDLOWERCASE=1
|
|
356
|
-
#PASSWORDUPPERCASE=1
|
|
357
|
-
#PASSWORDNUMERIC=1
|
|
358
|
-
#PASSWORDSYMBOL=1
|
|
359
|
-
#PASSWORDREQUIREMENTS=4
|
|
360
|
-
|
|
361
|
-
###########################################
|
|
362
|
-
######## ENABLE HTTPS SERVER ##############
|
|
363
|
-
###########################################
|
|
364
|
-
# By enabling this and providing the path/filename for the key and cert,
|
|
365
|
-
# the server will use HTTPS instead of HTTP.
|
|
366
|
-
#ENABLE_HTTPS="true"
|
|
367
|
-
#HTTPS_CERT_PATH="sslcert/cert.pem"
|
|
368
|
-
#HTTPS_KEY_PATH="sslcert/key.pem"
|
|
369
|
-
|
|
370
|
-
###########################################
|
|
371
|
-
######## AGENT SERVICE KEYS ###############
|
|
372
|
-
###########################################
|
|
373
|
-
|
|
374
|
-
#------ SEARCH ENGINES -------
|
|
375
|
-
#=============================
|
|
376
|
-
#------ Google Search -------- https://programmablesearchengine.google.com/controlpanel/create
|
|
377
|
-
# AGENT_GSE_KEY=
|
|
378
|
-
# AGENT_GSE_CTX=
|
|
379
|
-
|
|
380
|
-
#------ SerpApi ----------- https://serpapi.com/
|
|
381
|
-
# AGENT_SERPAPI_API_KEY=
|
|
382
|
-
# AGENT_SERPAPI_ENGINE=google
|
|
383
|
-
|
|
384
|
-
#------ SearchApi.io ----------- https://www.searchapi.io/
|
|
385
|
-
# AGENT_SEARCHAPI_API_KEY=
|
|
386
|
-
# AGENT_SEARCHAPI_ENGINE=google
|
|
387
|
-
|
|
388
|
-
#------ Serper.dev ----------- https://serper.dev/
|
|
389
|
-
# AGENT_SERPER_DEV_KEY=
|
|
390
|
-
|
|
391
|
-
#------ Bing Search ----------- https://portal.azure.com/
|
|
392
|
-
# AGENT_BING_SEARCH_API_KEY=
|
|
393
|
-
|
|
394
|
-
#------ Baidu Search ----------- https://cloud.baidu.com/doc/qianfan-api/s/Wmbq4z7e5
|
|
395
|
-
# AGENT_BAIDU_SEARCH_API_KEY=
|
|
396
|
-
|
|
397
|
-
#------ Serply.io ----------- https://serply.io/
|
|
398
|
-
# AGENT_SERPLY_API_KEY=
|
|
399
|
-
|
|
400
|
-
#------ SearXNG ----------- https://github.com/searxng/searxng
|
|
401
|
-
# AGENT_SEARXNG_API_URL=
|
|
402
|
-
|
|
403
|
-
#------ Tavily ----------- https://www.tavily.com/
|
|
404
|
-
# AGENT_TAVILY_API_KEY=
|
|
405
|
-
|
|
406
|
-
#------ Exa Search ----------- https://www.exa.ai/
|
|
407
|
-
# AGENT_EXA_API_KEY=
|
|
408
|
-
|
|
409
|
-
#------ Perplexity Search ----------- [https://console.perplexity.ai](https://console.perplexity.ai)
|
|
410
|
-
# AGENT_PERPLEXITY_API_KEY=
|
|
411
|
-
|
|
412
|
-
###########################################
|
|
413
|
-
######## Other Configurations ############
|
|
414
|
-
###########################################
|
|
415
|
-
|
|
416
|
-
# Disable viewing chat history from the UI and frontend APIs.
|
|
417
|
-
# See https://docs.anythingllm.com/configuration#disable-view-chat-history for more information.
|
|
418
|
-
# DISABLE_VIEW_CHAT_HISTORY=1
|
|
419
|
-
|
|
420
|
-
# Disable workspace deletion from the UI and APIs when this ENV is present with any value.
|
|
421
|
-
# WORKSPACE_DELETION_PROTECTION=1
|
|
422
|
-
|
|
423
|
-
# Enable simple SSO passthrough to pre-authenticate users from a third party service.
|
|
424
|
-
# See https://docs.anythingllm.com/configuration#simple-sso-passthrough for more information.
|
|
425
|
-
# SIMPLE_SSO_ENABLED=1
|
|
426
|
-
# SIMPLE_SSO_NO_LOGIN=1
|
|
427
|
-
# SIMPLE_SSO_NO_LOGIN_REDIRECT=https://your-custom-login-url.com (optional)
|
|
428
|
-
|
|
429
|
-
# Allow scraping of any IP address in collector - must be string "true" to be enabled
|
|
430
|
-
# See https://docs.anythingllm.com/configuration#local-ip-address-scraping for more information.
|
|
431
|
-
# COLLECTOR_ALLOW_ANY_IP="true"
|
|
432
|
-
|
|
433
|
-
# Port the collector listens on. Must match the collector process when running services separately.
|
|
434
|
-
# COLLECTOR_PORT=8888
|
|
435
|
-
|
|
436
|
-
# Specify the target languages for when using OCR to parse images and PDFs.
|
|
437
|
-
# This is a comma separated list of language codes as a string. Unsupported languages will be ignored.
|
|
438
|
-
# Default is English. See https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html for a list of valid language codes.
|
|
439
|
-
# TARGET_OCR_LANG=eng,deu,ita,spa,fra,por,rus,nld,tur,hun,pol,ita,spa,fra,por,rus,nld,tur,hun,pol
|
|
440
|
-
|
|
441
|
-
# Runtime flags for built-in pupeeteer Chromium instance
|
|
442
|
-
# This is only required on Linux machines running AnythingLLM via Docker
|
|
443
|
-
# and do not want to use the --cap-add=SYS_ADMIN docker argument
|
|
444
|
-
# ANYTHINGLLM_CHROMIUM_ARGS="--no-sandbox,--disable-setuid-sandbox"
|
|
445
|
-
|
|
446
|
-
# This enables HTTP request/response logging in development. Set value to a truthy string to enable, leave empty value or comment out to disable.
|
|
447
|
-
# ENABLE_HTTP_LOGGER=""
|
|
448
|
-
# This enables timestamps for the HTTP Logger. Set value to a truthy string to enable, leave empty value or comment out to disable.
|
|
449
|
-
# ENABLE_HTTP_LOGGER_TIMESTAMPS=""
|
|
450
|
-
|
|
451
|
-
# Disable Swagger API documentation endpoint.
|
|
452
|
-
# Set to "true" to disable the /api/docs endpoint (recommended for production deployments).
|
|
453
|
-
# DISABLE_SWAGGER_DOCS="true"
|
|
454
|
-
|
|
455
|
-
# Disable MCP cooldown timer for agent calls
|
|
456
|
-
# this can lead to infinite recursive calls of the same function
|
|
457
|
-
# for some model/provider combinations
|
|
458
|
-
# MCP_NO_COOLDOWN="true
|
|
459
|
-
|
|
460
|
-
# Allow native tool calling for specific providers.
|
|
461
|
-
# This can VASTLY improve performance and speed of agent calls.
|
|
462
|
-
# Check code for supported providers who can be enabled here via this flag
|
|
463
|
-
# PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING="generic-openai,bedrock,localai,groq,litellm,openrouter"
|
|
464
|
-
|
|
465
|
-
# (optional) Maximum number of tools an agent can chain for a single response.
|
|
466
|
-
# This prevents some lower-end models from infinite recursive tool calls.
|
|
467
|
-
# AGENT_MAX_TOOL_CALLS=10
|
|
468
|
-
|
|
469
|
-
# Enable agent tool reranking to reduce token usage by selecting only the most relevant tools
|
|
470
|
-
# for each query. Uses the native embedding reranker to score tools against the user's prompt.
|
|
471
|
-
# Set to "true" to enable. This can reduce token costs by 80% when you have
|
|
472
|
-
# many tools/MCP servers enabled.
|
|
473
|
-
# AGENT_SKILL_RERANKER_ENABLED="true"
|
|
474
|
-
# AGENT_SKILL_RERANKER_TOP_N=15 # (optional) Number of top tools to keep after reranking (default: 15)
|
|
475
|
-
|
|
476
|
-
# (optional) Memory extraction background job settings.
|
|
477
|
-
# MEMORY_EXTRACTION_INTERVAL="15m" # How often the extraction job runs (default: 15m)
|
|
478
|
-
# MEMORY_IDLE_THRESHOLD_MS=1200000 # Min ms since last chat before extraction runs (default: 1200000 / 20min). Set to 0 to disable the idle check.
|
|
479
|
-
|
|
480
|
-
# (optional) Maximum number of scheduled jobs that can run concurrently.
|
|
481
|
-
# Default is 1. Increase if using a cloud LLM provider with high rate limits.
|
|
482
|
-
# SCHEDULED_JOB_MAX_CONCURRENT=1
|
|
483
|
-
|
|
484
|
-
# (optional) Maximum time in milliseconds a scheduled job can run before being terminated.
|
|
485
|
-
# Default is 5 minutes (300000ms).
|
|
486
|
-
# SCHEDULED_JOB_TIMEOUT_MS=300000
|
|
487
|
-
|
|
488
|
-
# (optional) Comma-separated list of skills that are auto-approved.
|
|
489
|
-
# This will allow the skill to be invoked without user interaction.
|
|
490
|
-
# AGENT_AUTO_APPROVED_SKILLS=create-pdf-file,create-word-file
|
|
7
|
+
VECTOR_DB='lancedb'
|
|
8
|
+
OPENROUTER_API_KEY='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'
|
|
9
|
+
OPENROUTER_MODEL_PREF='nvidia/nemotron-3-nano-30b-a3b:free'
|
|
10
|
+
OPENROUTER_TIMEOUT_MS='3000'
|
|
11
|
+
WHISPER_PROVIDER='local'
|
|
12
|
+
JWT_SECRET='my-random-string-for-seeding'
|
|
13
|
+
TTS_PROVIDER='native'
|
|
14
|
+
STORAGE_DIR='/home/mike-diker/totem-llm'
|
|
15
|
+
SERVER_PORT='8686'
|
|
16
|
+
SIG_KEY='passphrase'
|
|
17
|
+
SIG_SALT='salt'
|
|
18
|
+
DATABASE_URL='file:../storage/anythingllm.db'
|
|
19
|
+
OLLAMA_RESPONSE_TIMEOUT='7200000 (optional, max timeout in milliseconds for ollama response to conclude. Default is 5min before aborting)'
|
|
@@ -3,7 +3,10 @@ const {
|
|
|
3
3
|
} = require("../models/externalCommunicationConnector");
|
|
4
4
|
const { TelegramBotService } = require("../utils/telegramBot");
|
|
5
5
|
const { validatedRequest } = require("../utils/middleware/validatedRequest");
|
|
6
|
-
const {
|
|
6
|
+
const {
|
|
7
|
+
flexUserRoleValid,
|
|
8
|
+
ROLES,
|
|
9
|
+
} = require("../utils/middleware/multiUserProtected");
|
|
7
10
|
const { reqBody } = require("../utils/http");
|
|
8
11
|
const { EventLogs } = require("../models/eventLogs");
|
|
9
12
|
const { Workspace } = require("../models/workspace");
|
|
@@ -15,7 +18,7 @@ function telegramEndpoints(app) {
|
|
|
15
18
|
|
|
16
19
|
app.get(
|
|
17
20
|
"/telegram/config",
|
|
18
|
-
[validatedRequest,
|
|
21
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
19
22
|
async (_request, response) => {
|
|
20
23
|
try {
|
|
21
24
|
const connector = await ExternalCommunicationConnector.get("telegram");
|
|
@@ -73,7 +76,7 @@ function telegramEndpoints(app) {
|
|
|
73
76
|
*/
|
|
74
77
|
app.post(
|
|
75
78
|
"/telegram/connect",
|
|
76
|
-
[validatedRequest,
|
|
79
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
77
80
|
async (request, response) => {
|
|
78
81
|
try {
|
|
79
82
|
const { bot_token, default_workspace = null } = reqBody(request);
|
|
@@ -158,7 +161,7 @@ function telegramEndpoints(app) {
|
|
|
158
161
|
|
|
159
162
|
app.post(
|
|
160
163
|
"/telegram/disconnect",
|
|
161
|
-
[validatedRequest,
|
|
164
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
162
165
|
async (_request, response) => {
|
|
163
166
|
try {
|
|
164
167
|
const service = new TelegramBotService();
|
|
@@ -175,7 +178,7 @@ function telegramEndpoints(app) {
|
|
|
175
178
|
|
|
176
179
|
app.get(
|
|
177
180
|
"/telegram/status",
|
|
178
|
-
[validatedRequest,
|
|
181
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
179
182
|
async (_request, response) => {
|
|
180
183
|
try {
|
|
181
184
|
const connector = await ExternalCommunicationConnector.get("telegram");
|
|
@@ -193,7 +196,7 @@ function telegramEndpoints(app) {
|
|
|
193
196
|
|
|
194
197
|
app.get(
|
|
195
198
|
"/telegram/pending-users",
|
|
196
|
-
[validatedRequest,
|
|
199
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
197
200
|
async (_request, response) => {
|
|
198
201
|
try {
|
|
199
202
|
const service = new TelegramBotService();
|
|
@@ -209,7 +212,7 @@ function telegramEndpoints(app) {
|
|
|
209
212
|
|
|
210
213
|
app.get(
|
|
211
214
|
"/telegram/approved-users",
|
|
212
|
-
[validatedRequest,
|
|
215
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
213
216
|
async (_request, response) => {
|
|
214
217
|
try {
|
|
215
218
|
const connector = await ExternalCommunicationConnector.get("telegram");
|
|
@@ -224,7 +227,7 @@ function telegramEndpoints(app) {
|
|
|
224
227
|
|
|
225
228
|
app.post(
|
|
226
229
|
"/telegram/approve-user",
|
|
227
|
-
[validatedRequest,
|
|
230
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
228
231
|
async (request, response) => {
|
|
229
232
|
try {
|
|
230
233
|
const { chatId } = reqBody(request);
|
|
@@ -246,7 +249,7 @@ function telegramEndpoints(app) {
|
|
|
246
249
|
|
|
247
250
|
app.post(
|
|
248
251
|
"/telegram/deny-user",
|
|
249
|
-
[validatedRequest,
|
|
252
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
250
253
|
async (request, response) => {
|
|
251
254
|
try {
|
|
252
255
|
const { chatId } = reqBody(request);
|
|
@@ -268,7 +271,7 @@ function telegramEndpoints(app) {
|
|
|
268
271
|
|
|
269
272
|
app.post(
|
|
270
273
|
"/telegram/revoke-user",
|
|
271
|
-
[validatedRequest,
|
|
274
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
272
275
|
async (request, response) => {
|
|
273
276
|
try {
|
|
274
277
|
const { chatId } = reqBody(request);
|
|
@@ -290,7 +293,7 @@ function telegramEndpoints(app) {
|
|
|
290
293
|
|
|
291
294
|
app.post(
|
|
292
295
|
"/telegram/update-config",
|
|
293
|
-
[validatedRequest,
|
|
296
|
+
[validatedRequest, flexUserRoleValid([ROLES.admin])],
|
|
294
297
|
async (request, response) => {
|
|
295
298
|
try {
|
|
296
299
|
const { voice_response_mode } = reqBody(request);
|
|
@@ -14,6 +14,7 @@ process.on("message", async (payload) => {
|
|
|
14
14
|
const {
|
|
15
15
|
botToken,
|
|
16
16
|
chatId,
|
|
17
|
+
messageThreadId,
|
|
17
18
|
workspaceSlug,
|
|
18
19
|
threadSlug,
|
|
19
20
|
message,
|
|
@@ -46,6 +47,7 @@ process.on("message", async (payload) => {
|
|
|
46
47
|
await streamResponse({
|
|
47
48
|
ctx,
|
|
48
49
|
chatId,
|
|
50
|
+
messageThreadId,
|
|
49
51
|
workspace,
|
|
50
52
|
thread,
|
|
51
53
|
message,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,j as t,e as f,f as S,i as h,l as x,r as a,W as i,L as b,Y as j}from"../index.js";import{W as w}from"./index-
|
|
1
|
+
import{d as g,j as t,e as f,f as S,i as h,l as x,r as a,W as i,L as b,Y as j}from"../index.js";import{W as w}from"./index-fd99e568.js";import{a as k}from"./index-0b8978d7.js";import"./files-202b5d45.js";import"./purify-5067c4b9.js";/* empty css */import"./Check-7e83fb0d.js";import"./Copy-d323e545.js";import"./truncate-e484143c.js";import"./mcpServers-d6808fa0.js";import"./admin-04b020fe.js";import"./Database-f1a76329.js";import"./File-b92df2f3.js";import"./XCircle-edfe554c.js";import"./Trans-11790b69.js";import"./Brain-24e386d5.js";import"./Browser-1820fad0.js";import"./index-6f49fa27.js";import"./agentFlows-e4124dd3.js";import"./index-e7e7c547.js";import"./communityHub-aba61686.js";import"./WarningCircle-27467274.js";import"./index-8ba96f42.js";import"./Hammer-05b5ccc7.js";import"./react-beautiful-dnd.esm-51607d6e.js";import"./moment-49fc1b76.js";import"./Eye-9f033dc0.js";import"./index-4fb4d421.js";function X(){const{loading:s,requiresAuth:o,mode:r}=g();return s?t.jsx(f,{}):o!==!1?t.jsx(t.Fragment,{children:o!==null&&t.jsx(S,{mode:r})}):t.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-zinc-950 light:bg-slate-50 flex",children:[!h&&t.jsx(k,{}),t.jsx(W,{})]})}function W(){const{slug:s}=x(),[o,r]=a.useState(null),[p,m]=a.useState(null);return a.useEffect(()=>{async function u(){var n;if(!s)return;const e=await i.bySlug(s);if(!e){r(null),m(s);return}const[c,{showAgentCommand:d}]=await Promise.all([i.getSuggestedMessages(s),i.agentCommandAvailable(s)]);r({...e,suggestedMessages:c,showAgentCommand:d}),m(s),localStorage.setItem(b,JSON.stringify({slug:e.slug,name:e.name}));const l=(n=e.slug)==null?void 0:n.match(/^scheduled-job-(\d+)$/);l&&j.markAllReadForJob(Number(l[1]))}u()},[s]),t.jsx(w,{loading:p!==s,workspace:o})}export{X as default};
|