Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ pip install lightmem # Coming soon
```

## ⚡ Quick Start

1. Modify the `JUDGE_MODEL`, `LLM_MODEL`, and their respective `API_KEY` and `BASE_URL` in `API Configuration`.

2. Download `LLMLINGUA_MODEL` from [microsoft/llmlingua-2-bert-base-multilingual-cased-meetingbank](https://huggingface.co/microsoft/llmlingua-2-bert-base-multilingual-cased-meetingbank) and `EMBEDDING_MODEL` from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) and modify their paths in `Model Paths`.

3. Download the dataset from [longmemeval-cleaned](https://huggingface.co/datasets/xiaowu0162/longmemeval-cleaned), and modidy the path in `Data Configuration`.

```python
cd experiments
python run_lightmem_qwen.py
Expand Down
12 changes: 7 additions & 5 deletions experiments/run_lightmem_qwen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
from lightmem.memory.lightmem import LightMemory

# ============ API Configuration ============
API_KEY='your_api_key_here'
API_BASE_URL=''
LLM_MODEL='qwen3-30b-a3b-instruct-2507'
JUDGE_MODEL='gpt-4o-mini'
JUDGE_MODEL_API_KEY='sk-xxxxxxxxxxxxxxxxxxxxxxxxxx'
JUDGE_MODEL_BASE_URL='https://api.deepseek.com/v1'
JUDGE_MODEL='deepseek-chat'
API_KEY='sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
API_BASE_URL='https://dashscope.aliyuncs.com/compatible-mode/v1'
LLM_MODEL='qwen-plus'

# ============ Model Paths ============
LLMLINGUA_MODEL_PATH='/your/path/to/models/llmlingua-2-bert-base-multilingual-cased-meetingbank'
Expand Down Expand Up @@ -149,7 +151,7 @@ def load_lightmem(collection_name):
lightmem = LightMemory.from_config(config)
return lightmem

llm_judge = LLMModel(JUDGE_MODEL, API_KEY, API_BASE_URL)
llm_judge = LLMModel(JUDGE_MODEL, JUDGE_MODEL_API_KEY, JUDGE_MODEL_BASE_URL)
llm = LLMModel(LLM_MODEL, API_KEY, API_BASE_URL)

data = json.load(open(DATA_PATH, "r"))
Expand Down