Skip to content

Commit e58a0d6

Browse files
authored
Merge pull request #12 from codefuse-ai/modelcache_localDB_dev
Adding Startup Modes
2 parents ac2dc28 + 1882de3 commit e58a0d6

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@ Codefuse-ModelCache
2929
### Introduction
3030
Codefuse-ModelCache is a semantic cache for large language models (LLMs). By caching pre-generated model results, it reduces response time for similar requests and improves user experience. <br />This project aims to optimize services by introducing a caching mechanism. It helps businesses and research institutions reduce the cost of inference deployment, improve model performance and efficiency, and provide scalable services for large models. Through open-source, we aim to share and exchange technologies related to large model semantic cache.
3131
## Quick Deployment
32+
The project's startup scripts are divided into flask4modelcache.py and flask4modelcache_demo.py.
33+
- flask4modelcache_demo.py is a quick test service that embeds sqlite and faiss, and users do not need to be concerned about database-related matters.
34+
- flask4modelcache.py is the normal service that requires configuration of mysql and milvus database services.
3235
### Dependencies
3336

3437
- Python version: 3.8 and above
3538
- Package Installation
3639
```shell
3740
pip install requirements.txt
3841
```
39-
### Environment Configuration
40-
Before starting the service, the following environment configurations should be performed:
42+
### Service Startup
43+
#### Demo Service Startup
44+
1. Download the embedding model bin file from the following address: [https://huggingface.co/shibing624/text2vec-base-chinese/tree/main](https://huggingface.co/shibing624/text2vec-base-chinese/tree/main). Place the downloaded bin file in the model/text2vec-base-chinese folder.
45+
2. Start the backend service using the flask4modelcache_dome.py script.
4146

47+
#### Normal Service Startup
48+
Before starting the service, the following environment configurations should be performed:
4249
1. Install the relational database MySQL and import the SQL file to create the data tables. The SQL file can be found at: reference_doc/create_table.sql
4350
2. Install the vector database Milvus.
4451
3. Add the database access information to the configuration files:

README_CN.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,24 @@ Codefuse-ModelCache
2828
## 项目简介
2929
Codefuse-ModelCache 是一个开源的大模型语义缓存系统,通过缓存已生成的模型结果,降低类似请求的响应时间,提升用户体验。该项目从服务优化角度出发,引入缓存机制,在资源有限和对实时性要求较高的场景下,帮助企业和研究机构降低推理部署成本、提升模型性能和效率、提供规模化大模型服务。我们希望通过开源,分享交流大模型语义Cache的相关技术。
3030
## 快速部署
31+
项目中启动服务脚本分为flask4modelcache.py 和 flask4modelcache_demo.py,其中:
32+
33+
- flask4modelcache_demo.py 为快速测试服务,内嵌了sqlite和faiss,用户无需关心数据库相关事宜。
34+
- flask4modelcache.py 为正常服务,需用户具备mysql和milvus等数据库服务。
3135
### 环境依赖
3236

3337
- python版本: 3.8及以上
3438
- 依赖包安装:
3539
```shell
3640
pip install requirements.txt
3741
```
42+
### 服务启动
43+
#### Demo服务启动
44+
- 离线模型bin文件下载, 参考地址:[https://huggingface.co/shibing624/text2vec-base-chinese/tree/main](https://huggingface.co/shibing624/text2vec-base-chinese/tree/main),并将下载的bin文件,放到 model/text2vec-base-chinese 文件夹中。
45+
- 执行flask4modelcache_demo.py脚本即可启动。
3846

39-
### 环境配置
47+
#### 正常服务启动
4048
在启动服务前,应该进行如下环境配置:
41-
4249
1. 安装关系数据库 mysql, 导入sql创建数据表,sql文件: reference_doc/create_table.sql
4350
2. 安装向量数据库milvus
4451
3. 在配置文件中添加数据库访问信息,配置文件为:

0 commit comments

Comments
 (0)