MCPcopy Index your code
hub / github.com/wenda-LLM/wenda

github.com/wenda-LLM/wenda @main sqlite

repository ↗ · DeepWiki ↗
10,659 symbols 37,472 edges 272 files 38 documented · 0%
README

Wendada: A Large-scale Language Model Invocation Platform

This project aims to achieve efficient content generation for specific contexts while considering the limited computing resources of individuals and small to medium-sized enterprises, as well as concerns about knowledge security and privacy. To achieve this goal, the platform integrates the following capabilities:

  1. Knowledge Base: Supports integration with various sources such as [Local Offline Vector Libraries]rtst mode, [Local Search Engines]Fess Mode and online search engines.
  2. Multiple Large Language Models: Currently supports offline deployment models like chatGLM-6B\chatGLM2-6BchatRWKVllama系列(not recommended for Chinese users)moss(not recommended)baichuan(requires lora for optimal results)Aquila-7BInternLM, and online API access to openai api and chatGLM-130b api
  3. Auto Scripts: By developing JavaScript scripts as plugins, the platform is extended to include various automation features, such as customizing dialogue flow, accessing external APIs, and switching LoRA models online.
  4. Other Practical Capabilities: Dialogue history management, intranet deployment, multi-user simultaneous usage, etc.

Communication QQ Groups: LLM Usage and General Discussion Group162451840;Knowledge Base Usage Discussion Group 241773574(full, please go to QQ Channel for discussion)full, please go to QQ Channel for discussion744842245QQ Channel

Installation and Deployment

Description of Various Models

Feature Multi-User Support Stream Output CPU GPU Quantization Support LoRa Integration
chatGLM-6B/chatGLM2-6B Requires Compiler Pre-quantization and Online Quantization
RWKV torch Pre-quantization and Online Quantization
RWKV.cpp Instruction Set Acceleration Available Pre-quantization
Baichuan-7B
Baichuan-7B (GPTQ) Pre-quantization
Aquila-7B Not Implemented
replit
chatglm130b api
openai api
llama.cpp Instruction Set Acceleration Available Pre-quantization
llama torch Pre-quantization and Online Quantization
InternLM Online Quantization
### Lazy Package
#### Baidu Cloud
https://pan.baidu.com/s/1idvot-XhEvLLKCbjDQuhyg?pwd=wdai

Quark

Link:https://pan.quark.cn/s/c4cb08de666e Extract Code:4b4R

Introduction

Default parameters work well on devices with 6GB VRAM. The latest version of the lazy package has integrated a one-click update feature, which is recommended to be updated before use.

Usage steps (using the glm6b model as an example): 1. Download the lazy package and model. The model can be downloaded using the built-in script from HuggingFace (HF) or from a cloud drive. 2. If CUDA 11.8 is not installed, download and install it from the cloud drive. 3. Double-click on 运行GLM6B.bat (Run GLM6B.bat). 4. If you need to generate an offline knowledge base, refer to知识库

Manual Installation

PS:Be sure to check example.config.yml,which provides more detailed explanations of each feature!

Step 1: Install Dependencies

Common dependencies:pip install -r requirements/requirements.txt Configure according to the知识库being used.

Step 2: Download Models

Download the corresponding model based on your needs.

Recommended to use the RWKV-4-Raven-7B-v11 model for chatRWKV or chatGLM-6B.

Step 3: Parameter Configuration

Renameexample.config.yml to config.yml and fill in the model download location and other necessary information according to the parameter instructions inside the file.

Auto

Auto functionality is achieved through JavaScript scripts, which are injected into the program as plugins using Greasemonkey scripts or placed directly in the autos directory. This extends Wendada with various automation features.

List of Auto Development Functions

Function (All are asynchronous calls) Functionality Explanation
send(s,keyword = "",show=true) Send information to LLM and return the model's response as a string s: Input model text; keyword: Text displayed in the chat interface; show: Whether to display in the chat interface
add_conversation(role, content) Add conversation information role: 'AI' or 'user'; content: string
save_history() Save conversation history Automatically saves after each conversation, but manually added conversations need to be saved manually
find(s, step = 1) Search in the knowledge base Returns a JSON array
find_dynamic(s,step=1,paraJson) Search in the dynamic knowledge base; see Wendada Notes Auto for reference paraJson:{libraryStategy:"sogowx:3",maxItmes:2}
zsk(b=true) Toggle knowledge base
lsdh(b=true) Toggle history dialogue Knowledge base should be closed when opening
speak(s) Use TTS engine to read text Calls the system's TTS engine
copy(s) Copy text using clipboard-write in the browser Requires relevant permissions
### Code Segments Related to Auto Development
Add content in the left-side feature bar:
func.push({
    name: "Name",
    question: async () => {
        let answer=await send(app.question)
        alert(answer)
    },
})

Add content in the lower tab:

app.plugins.push({ icon: 'note-edit-outline', url: "/static/wdnote/index.html" })

Search in a specific RTST knowledge base:

find_in_memory = async (s, step, memory_name) => {
   response = await fetch("/api/find_rtst_in_memory", {
      method: 'post',
      body: JSON.stringify({
         prompt: s,
         step: step,
         memory_name: memory_name
      }),
      headers: {
         'Content-Type': 'application/json'
      }
   })
   let json = await response.json()
   console.table(json)
   app.zhishiku = json
   return json
}

Upload to a specific RTST knowledge base:

upload_rtst_zhishiku = async (title, txt,memory_name) => {
   response = await fetch("/api/upload_rtst_zhishiku", {
      method: 'post',
      body: JSON.stringify({
         title: title,
         txt: txt,
         memory_name: memory_name
      }),
      headers: { 'Content-Type': 'application/json' }
   })
   alert(await response.text())
}

Save a specific RTST knowledge base:

save_rtst = async (memory_name) => {
   response = await fetch("/api/save_rtst_zhishiku", {
      method: 'post',
      body: JSON.stringify({
         memory_name: memory_name
      }),
      headers: { 'Content-Type': 'application/json' }
   })
   alert(await response.text())
}

Access SD_agent:

response = await fetch("/api/sd_agent", {
   method: 'post',
   body: JSON.stringify({
         prompt: `((masterpiece, best quality)), photorealistic,` + Q,
         steps: 20,
         // sampler_name: "DPM++ SDE Karras",
         negative_prompt: `paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans`
   }),
   headers: {
         'Content-Type': 'application/json'
   }
})
try {
   let json = await response.json()
   add_conversation("AI", '![](data:image/png;base64,' + json.images[0] + ")")
} catch (error) {
   alert("Failed to connect to the SD API. Please make sure the agents library is enabled and set the SD API address to 127.0.0.1:786.")
}

Partial Built-in Auto Usage Instructions

File Name Functionality
0-write_article.js Write an article based on a title or outline
0-zsk.js Enhance and manage the knowledge base
face-recognition.js Pure browser-based face detection: Control voice input by recognizing mouth movements. Only available locally or under TLS due to browser limitations.
QQ.js Pure browser-based face detection: Control voice input by recognizing mouth movements. Only available locally or under TLS due to browser limitations.
block_programming.js easy block programming: Implement simple Auto features by dragging blocks
1-draw_use_SD_api.js Call the Stable Diffusion interface for drawing using the agents module (see example.config.yml <Library>)

Call the Stable Diffusion interface for drawing using the agents module (see example.config.yml <Library>)

Auto examples

Knowledge Base

The knowledge base principle is to generate some prompt information and insert it into the dialogue after searching, so that the model becomes aware of the knowledge base data. rtst modeThe knowledge base principle is to generate some prompt information and insert it into the dialogue after searching, so that the model becomes aware of the knowledge base data. Fess Mode (similar to a local search engine) and bing mode use search engines to obtain answers.

To prevent excessive GPU memory consumption and limitations on model comprehension, the inserted data cannot be too long. Therefore, there are limits on the number of characters and the number of entries. This issue can be resolved by enhancing the knowledge base with Auto.

In normal usage, enabling the knowledge bas

Core symbols most depended-on inside this repo

push
called by 2908
views/assets/index-45c0c8d1.js
c
called by 970
views/assets/index-45c0c8d1.js
get
called by 876
views/assets/index-45c0c8d1.js
unref
called by 565
views/assets/index-45c0c8d1.js
a
called by 546
views/assets/index-45c0c8d1.js
join
called by 470
llms/llm_qwen.py
create
called by 430
views/assets/index-45c0c8d1.js
abort
called by 407
views/static/mp/0.4.1633559619/face_mesh_solution_simd_wasm_bin.js

Shape

Method 5,503
Function 4,708
Class 421
Route 27

Languages

TypeScript96%
Python4%

Modules by API surface

views/assets/index-45c0c8d1.js4,600 symbols
views/static/blockly/blockly.min.js1,628 symbols
views/static/blockly/blockly_compressed.js1,613 symbols
views/static/xlsx.core.min.js902 symbols
views/static/mp/0.4.1633559619/face_mesh_solution_simd_wasm_bin.js413 symbols
views/static/vuetify.min.js394 symbols
views/static/vue.js247 symbols
views/static/mp/face_mesh.js107 symbols
views/static/wdnote/js/jquery.min.js75 symbols
views/static/mp/control_utils.js70 symbols
views/static/markdown-it.min.js55 symbols
views/static/vue-i18n.js51 symbols

Dependencies from manifests, versioned

@blockly/block-test3.0.0 · 1×
@blockly/dev-tools5.0.0 · 1×
@blockly/theme-modern3.0.0 · 1×
@hyperjump/json-schema0.18.5 · 1×
@microsoft/api-documenter7.19.16 · 1×
@microsoft/api-extractor7.29.5 · 1×
@typescript-eslint/eslint-plugin5.33.1 · 1×
@wdio/selenium-standalone-service7.10.1 · 1×
chai4.2.0 · 1×
clang-format1.6.0 · 1×
closure-calculate-chunks3.0.2 · 1×
concurrently7.4.0 · 1×

Datastores touched

(mysql)Database · 1 repos
dbDatabase · 1 repos

For agents

$ claude mcp add wenda \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact