1.下載項目的源代碼,我們要先啟動后端,用docker啟動
cd src/server
cp .env.example .env
cp ./api/config.yaml.example ./api/config.yaml
這里我的配置內容如下config.yaml(因為我是調用的符合openai格式的大模型,所以我沒改,如果要是別的大模型的話,需要自己再做兼容)
llm_api_key: sk-
llm_base_url: https://openrouter.ai/api/v1
llm_style: openai
best_llm_model: google/gemini-2.5-pro-exp-03-25:free
在圖中框出來的地方做兼容,openrouter.py是我新加的
然后配置好后
docker-compose build && docker-compose up
后端啟動成功,然后我們測試一下,訪問,http://101.43.194.123:8019/docs(云服務器運行的換成你的公網ip就好)
2.然后是前端,前端就很簡單了
!pip install memobase openai
from rich import print
from memobase import MemoBaseClient, ChatBlobPROJECT_URL = "http://xxxxx:8019"
PROJECT_TOKEN = "secret"client = MemoBaseClient(project_url=PROJECT_URL,api_key=PROJECT_TOKEN,
)assert client.ping(), "Your Memobase server is not running"messages = [{"role": "user","content": "Hello, I'm Gus","created_at&