README.md 1022 Bytes
Newer Older
Woosuk Kwon's avatar
Woosuk Kwon committed
1
# CacheFlow
Woosuk Kwon's avatar
Woosuk Kwon committed
2
3
4
5

## Installation

```bash
Woosuk Kwon's avatar
Woosuk Kwon committed
6
7
8
9
pip install psutil numpy ray torch
pip install git+https://github.com/huggingface/transformers  # Required for LLaMA.
pip install sentencepiece  # Required for LlamaTokenizer.
pip install flash-attn  # This may take up to 20 mins.
Woosuk Kwon's avatar
Woosuk Kwon committed
10
11
12
pip install -e .
```

13
## Test simple server
Woosuk Kwon's avatar
Woosuk Kwon committed
14
15

```bash
Zhuohan Li's avatar
Zhuohan Li committed
16
ray start --head
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
python simple_server.py
```

The detailed arguments for `simple_server.py` can be found by:
```bash
python simple_server.py --help
```

## FastAPI server

Install the following additional dependencies:
```bash
pip install fastapi uvicorn
```

To start the server:
```bash
ray start --head
python -m cacheflow.http_frontend.fastapi_frontend
```

To test the server:
```bash
python -m cacheflow.http_frontend.test_cli_client
```

## Gradio web server

Install the following additional dependencies:
```bash
pip install gradio
```

Start the server:
```bash
python -m cacheflow.http_frontend.fastapi_frontend
# At another terminal
python -m cacheflow.http_frontend.gradio_webserver
Woosuk Kwon's avatar
Woosuk Kwon committed
55
```