本地运行大模型
环境搭建
1.下载羊驼,并安装
https://github.com/ollama/ollama/releases/latest/download/OllamaSetup.exe
2.下载模型并运行
ollama run deepseek-r1:7b
这里参数选的是7b,文件大概5G
3 api调用模型
返回多个词(token),如下图。
3.安装docker并安装open-webui
windows安装docker,要使用wsl.exe --update
再执行:
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
打开
http://localhost:3000/
可以进入问答页面。
聊天窗口工具二
4.聊天窗口与知识库
下载 anythingllm https://anythingllm.com/
文档:https://github.com/Mintplex-Labs/anything-llm/blob/master/locales/README.zh-CN.md
6.使用AnythingLLM调用api
先进入设置,再选择工具->API密钥,点击"生成新的API密钥" 。
再点击"阅读API文档",录入api-token,
知识库测试
1.上传文件,添加进入知识库
2.使用api构建索引
2.1 上传文档api
2.2 获取上传的文件名(json)
2.3 填参数,向量化
坑
1.docx文件无法解析,查看documents接口可以看到一个较大文件的wordCount只有3
而且docx转为txt后(wps另存为),导入anythingllm为乱码。
dify:
官网
https://github.com/langgenius/dify
1.2.0的.env文件需改下:
PLUGIN_S3_USE_AWS_MANAGED_IAM=false PLUGIN_S3_ENDPOINT= PLUGIN_S3_USE_PATH_STYLE=false