├── .gitignore
├── LICENSE
├── README.md
├── demo1-quickstart
├── README.md
├── chat_session.py
├── context.txt
├── frontend.py
└── run-server.sh.template
├── demo2-multi-node-sharing
├── README.md
├── chat_session.py
├── context.txt
├── data
│ ├── abi-chat-1.txt
│ ├── abi-chat-2.txt
│ ├── abi.txt
│ ├── alex-chat-1.txt
│ ├── alex-chat-2.txt
│ ├── alex.txt
│ ├── gameplay.txt
│ ├── introduction.txt
│ ├── npc-relationships.txt
│ └── npcs.txt
├── frontend.py
├── run-server.sh.template
└── stop-dockers.sh
├── demo3-KV-blending
├── README.md
├── chat_session.py
├── data
│ ├── abi-chat-1.txt
│ ├── abi-chat-2.txt
│ ├── abi.txt
│ ├── alex-chat-1.txt
│ ├── alex-chat-2.txt
│ ├── alex.txt
│ ├── gameplay.txt
│ ├── introduction.txt
│ ├── npc-relationships.txt
│ ├── npcs.txt
│ └── sys_prompt.txt
├── frontend.py
├── run-server.sh.template
└── stop-dockers.sh
└── demo4-compare-with-vllm
├── .env
├── README.md
├── bar.png
├── chat_session.py
├── context.txt
├── docker-compose.yaml
├── frontend-double.py
├── imgs
├── architecture.png
├── contrast.png
├── demo_4.png
├── result_1.png
└── result_2.png
├── lmcache-config.yaml
├── preprocess.py
└── start_ui.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | *.sh
2 |
3 | __pycache__/
4 | cache/
5 |
6 | # Vim temp files
7 | .*.sw*
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Demos for LMCache
2 |
3 | 
4 |
5 |
6 | ## Available demos
7 |
8 | - [x] [Demo 1](https://github.com/LMCache/demo/tree/master/demo1-quickstart): quickstart using docker
9 | - [x] [Demo 2](https://github.com/LMCache/demo/tree/master/demo2-multi-node-sharing): share KV across different nodes
10 | - [x] [Demo 3](https://github.com/LMCache/demo/tree/master/demo3-KV-blending): faster RAG by KV cache blending
11 |
12 |
--------------------------------------------------------------------------------
/demo1-quickstart/README.md:
--------------------------------------------------------------------------------
1 | # LMCache demo 1: quickstart
2 |
3 | 
4 |
5 |
6 | This demo will help you set up the vLLM + LMCache and a QA frontend.
7 |
8 |
9 | ## Prerequisites
10 | To run the quickstart demo, your server should have 1 GPU and the [docker environment](https://docs.docker.com/engine/install/) with the [nvidia-runtime](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed.
11 |
12 | Depending on the server configuration, you may need sudo access to run the docker.
13 |
14 | This demo will use the port 8000 (for vLLM) and 8501 (for the frontend).
15 |
16 | ## Clone the repo to local
17 | ```bash
18 | git clone https://github.com/LMCache/demo
19 | cd demo/demo1-quickstart
20 | ```
21 |
22 | ## Start the LMCache + vLLM with docker
23 |
24 | First, we need to do some configuration before starting the docker.
25 | ```bash
26 | cp run-server.sh.template run-server.sh
27 | vim run-server.sh
28 | ```
29 |
30 | Edit the folloing lines based on your local environment:
31 | ```bash
32 | MODEL=mistralai/Mistral-7B-Instruct-v0.2 # LLM model name
33 | LOCAL_HF_HOME= # the HF_HOME on local machine. vLLM will try finding/downloading the models here
34 | HF_TOKEN= # (optional) the huggingface token to access some special models
35 | ```
36 |
37 | Then, start the docker
38 | ```bash
39 | bash ./run-server.sh # This might need sudo
40 | ```
41 |
42 | The vLLM serving engine is ready after you see the following lines in the log:
43 | ```text
44 | INFO: Started server process [1]
45 | INFO: Waiting for application startup.
46 | INFO: Application startup complete.
47 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
48 | ```
49 |
50 | ## Start the frontend
51 |
52 | The frontend uses `openai` and `streamlit` python packages. Install them using:
53 | ```bash
54 | pip install openai streamlit transformers sentencepiece
55 | ```
56 |
57 | Then, start the web server using:
58 | ```bash
59 | streamlit run frontend.py
60 | ```
61 |
62 | You should be able to access the frontend from your browser at `http://:8501`.
63 |
64 | ### What to expect:
65 |
66 | LMCache should be able to reduce the response delay since the second question.
67 |
--------------------------------------------------------------------------------
/demo1-quickstart/chat_session.py:
--------------------------------------------------------------------------------
1 | from openai import OpenAI
2 | import threading
3 | import sys
4 | from io import StringIO
5 | import time
6 |
7 |
8 |
9 | class ChatSession:
10 | def __init__(self, port, context_separator = "###"):
11 | openai_api_key = "EMPTY"
12 | openai_api_base = f"http://localhost:{port}/v1"
13 |
14 | self.client = client = OpenAI(
15 | # defaults to os.environ.get("OPENAI_API_KEY")
16 | api_key=openai_api_key,
17 | base_url=openai_api_base,
18 | )
19 |
20 | models = client.models.list()
21 | self.model = models.data[0].id
22 |
23 | self.messages = []
24 |
25 | self.final_context = ""
26 | self.context_separator = context_separator
27 |
28 |
29 | def set_context(self, context_strings):
30 | contexts = []
31 | for context in context_strings:
32 | contexts.append(context)
33 |
34 | self.final_context = self.context_separator.join(contexts)
35 | self.on_user_message(self.final_context, display=False)
36 | self.on_server_message("Got it!", display=False)
37 |
38 | def get_context(self):
39 | return self.final_context
40 |
41 | def on_user_message(self, message, display=True):
42 | if display:
43 | print("User message:", message)
44 | self.messages.append({"role": "user", "content": message})
45 |
46 | def on_server_message(self, message, display=True):
47 | if display:
48 | print("Server message:", message)
49 | self.messages.append({"role": "assistant", "content": message})
50 |
51 | def chat(self, question):
52 | self.on_user_message(question)
53 |
54 | start = time.perf_counter()
55 | end = None
56 | chat_completion = self.client.chat.completions.create(
57 | messages=self.messages,
58 | model=self.model,
59 | temperature=0.5,
60 | stream=True,
61 | stop = "\n",
62 | )
63 |
64 | output_buffer = StringIO()
65 | server_message = []
66 | for chunk in chat_completion:
67 | chunk_message = chunk.choices[0].delta.content
68 | if chunk_message is not None:
69 | if end is None:
70 | end = time.perf_counter()
71 | yield chunk_message
72 | server_message.append(chunk_message)
73 |
74 | self.on_server_message("".join(server_message))
75 | yield f"\n\n(Response delay: {end - start:.2f} seconds)"
76 |
--------------------------------------------------------------------------------
/demo1-quickstart/frontend.py:
--------------------------------------------------------------------------------
1 | import time
2 | import os, sys
3 | import numpy as np
4 | import pandas as pd
5 | import streamlit as st
6 | import chat_session
7 | from typing import List, Dict
8 | from transformers import AutoTokenizer
9 |
10 | # Change the following variables as needed
11 | MODEL_NAME = "lmsys/longchat-7b-16k"
12 | PORT = 8000
13 |
14 | @st.cache_resource
15 | def get_tokenizer():
16 | global MODEL_NAME
17 | tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
18 | return tokenizer
19 |
20 |
21 | tokenizer = get_tokenizer()
22 |
23 |
24 | @st.cache_data
25 | def read_context() -> str:
26 | with open("context.txt", "r") as fin:
27 | context = fin.read()
28 | return context
29 |
30 | context = read_context()
31 |
32 | container = st.container(border=True)
33 |
34 | with st.sidebar:
35 | session = chat_session.ChatSession(PORT)
36 |
37 | system_prompt = st.text_area(
38 | "System prompt:",
39 | "You are a helpful assistant. I will now give you a document and "
40 | "please answer my question afterwards based on the content in document"
41 | )
42 |
43 | session.set_context([system_prompt] + [context])
44 | num_tokens = tokenizer.encode(session.get_context())
45 | container.header(f"The context given to LLM: ({len(num_tokens)} tokens)", divider = "grey")
46 | container.text(session.get_context())
47 |
48 | messages = st.container(height=400)
49 | if prompt := st.chat_input("Type the question here"):
50 | messages.chat_message("user").write(prompt)
51 | messages.chat_message("assistant").write_stream(session.chat(prompt))
52 |
--------------------------------------------------------------------------------
/demo1-quickstart/run-server.sh.template:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ### CHANGE THE FOLLOWING VARIABLES
4 | MODEL=mistralai/Mistral-7B-Instruct-v0.2 # LLM model name
5 | LOCAL_HF_HOME= # the HF_HOME on local machine. vLLM will try finding/dowloading the models here
6 | HF_TOKEN= # (optional) the huggingface token to access some special models
7 | PORT=8000 # Port for the server
8 |
9 | sudo docker pull apostacyh/vllm:lmcache-0.1.0
10 | sudo docker run --runtime nvidia --gpus '"device=0"' \
11 | -v ${LOCAL_HF_HOME}:/root/.cache/huggingface \
12 | --env "HF_TOKEN=${HF_TOKEN}" \
13 | --ipc=host \
14 | --network=host \
15 | apostacyh/vllm:lmcache-0.1.0 \
16 | --model ${MODEL} --gpu-memory-utilization 0.6 --port ${PORT} \
17 | --lmcache-config-file /lmcache/LMCache/examples/example-local.yaml
18 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/README.md:
--------------------------------------------------------------------------------
1 | # LMCache demo 2: share KV across different vLLM instances
2 |
3 | 
4 |
5 | This demo shows how to share KV across different vLLM instances using LMCache
6 |
7 |
8 | ## Prerequisites
9 | To run the quickstart demo, your server should have 2 GPUs and the [docker environment](https://docs.docker.com/engine/install/) with the [nvidia-runtime](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed.
10 |
11 | Depending on the server configuration, you may need sudo access to run the docker.
12 |
13 | This demo will use port 8000, 8001 (for vLLM), 65432 (for LMCache backend server), and 8501 (for the frontend).
14 |
15 | ## Clone the repo to local
16 | ```bash
17 | git clone https://github.com/LMCache/demo
18 | cd demo/demo2-multi-node-sharing
19 | ```
20 |
21 | ## Start the LMCache + vLLM with docker
22 |
23 | First, we need to do some configuration before starting the docker.
24 | ```bash
25 | cp run-server.sh.template run-server.sh
26 | vim run-server.sh
27 | ```
28 |
29 | Edit the following lines based on your local environment:
30 | ```bash
31 | MODEL=mistralai/Mistral-7B-Instruct-v0.2 # LLM model name
32 | LOCAL_HF_HOME= # the HF_HOME on local machine. vLLM will try finding/dowloading the models here
33 | HF_TOKEN= # (optional) the huggingface token to access some special models
34 | ```
35 |
36 | Then, start the docker images.
37 | ```bash
38 | bash ./run-server.sh # This might need sudo
39 | ```
40 |
41 | Now, you should have 3 docker images running.
42 | - `lmcache-server` is the LMCache backend server that shares KV across multiple vLLM instaces
43 | - `lmcache-vllm1` and `lmcache-vllm2` are the LMCache-integrated vLLM instaces
44 |
45 | You can monitor the logs by:
46 | ```bash
47 | sudo docker logs --follow lmcache-vllm1 # Or other two docker images' name
48 | ```
49 |
50 | The vLLM serving engine is ready after you see the following lines in the log:
51 | ```text
52 | INFO: Started server process [1]
53 | INFO: Waiting for application startup.
54 | INFO: Application startup complete.
55 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
56 | ```
57 |
58 | ## Start the frontend
59 |
60 | The frontend uses `openai` and `streamlit` python packages. Install them using:
61 | ```bash
62 | pip install openai streamlit transformers sentencepiece
63 | ```
64 |
65 | After the serving engine is ready, start the frontend web server using:
66 | ```bash
67 | streamlit run frontend.py
68 | ```
69 |
70 | You should be able to access the frontend from your browser at `http://:8501`.
71 |
72 | In the demo, you can select different texts to make a long context, and ask questions to different vLLM instances.
73 |
74 | ## Stop the docker images
75 | ```bash
76 | sudo bash stop-dockers.sh
77 | ```
78 |
79 | ### What to expect:
80 |
81 | - If the new context shares the same prefix as the previously-used context, LMCache should be able to reduce the response delay by reusing the prefix KV cache.
82 | - After vLLM instance 1 processes the context, vLLM instance 2 should be able to response much faster when loading the same context. This is because it can load KV cache from the LMCache server backend.
83 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/chat_session.py:
--------------------------------------------------------------------------------
1 | from openai import OpenAI
2 | import threading
3 | import sys
4 | from io import StringIO
5 | import time
6 |
7 |
8 |
9 | class ChatSession:
10 | def __init__(self, port, context_separator = "###"):
11 | openai_api_key = "EMPTY"
12 | openai_api_base = f"http://localhost:{port}/v1"
13 |
14 | self.client = client = OpenAI(
15 | # defaults to os.environ.get("OPENAI_API_KEY")
16 | api_key=openai_api_key,
17 | base_url=openai_api_base,
18 | )
19 |
20 | models = client.models.list()
21 | self.model = models.data[0].id
22 |
23 | self.messages = []
24 |
25 | self.final_context = ""
26 | self.context_separator = context_separator
27 |
28 |
29 | def set_context(self, context_strings):
30 | contexts = []
31 | for context in context_strings:
32 | contexts.append(context)
33 |
34 | self.final_context = self.context_separator.join(contexts)
35 | self.on_user_message(self.final_context, display=False)
36 | self.on_server_message("Got it!", display=False)
37 |
38 | def get_context(self):
39 | return self.final_context
40 |
41 | def on_user_message(self, message, display=True):
42 | if display:
43 | print("User message:", message)
44 | self.messages.append({"role": "user", "content": message})
45 |
46 | def on_server_message(self, message, display=True):
47 | if display:
48 | print("Server message:", message)
49 | self.messages.append({"role": "assistant", "content": message})
50 |
51 | def chat(self, question):
52 | self.on_user_message(question)
53 |
54 | start = time.perf_counter()
55 | end = None
56 | chat_completion = self.client.chat.completions.create(
57 | messages=self.messages,
58 | model=self.model,
59 | temperature=0.5,
60 | stream=True,
61 | stop = "\n",
62 | )
63 |
64 | output_buffer = StringIO()
65 | server_message = []
66 | for chunk in chat_completion:
67 | chunk_message = chunk.choices[0].delta.content
68 | if chunk_message is not None:
69 | if end is None:
70 | end = time.perf_counter()
71 | yield chunk_message
72 | server_message.append(chunk_message)
73 |
74 | self.on_server_message("".join(server_message))
75 | yield f"\n\n(Response delay: {end - start:.2f} seconds)"
76 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/abi-chat-1.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Abigail and a player:
2 |
3 | Player: [Gives a hated gift]
4 | Abigail: "Oh... Why would you think I like this?"
5 | ----------------------------------------
6 |
7 | Player: [Gives another hated gift]
8 | Abigail: "Seriously? You're doing this on purpose, aren't you?"
9 | ----------------------------------------
10 |
11 | Player: [Is rude in conversation]
12 | Abigail: "That’s not very nice. You could at least try to be pleasant."
13 | ----------------------------------------
14 |
15 | Player: [Makes a disparaging comment]
16 | Abigail: "I don't get why you have to be so negative all the time."
17 | ----------------------------------------
18 |
19 | Player: [Gives a disliked gift]
20 | Abigail: "You know I don't like this. What's your point?"
21 | ----------------------------------------
22 |
23 | Player: [Is dismissive of her interests]
24 | Abigail: "Just because you don't understand my hobbies doesn't mean they're not important."
25 | ----------------------------------------
26 |
27 | Player: [Mocks her purple hair]
28 | Abigail: "I like my hair this way. It’s different, like me. Problem?"
29 | ----------------------------------------
30 |
31 | Player: [Gives a hated gift again]
32 | Abigail: "Okay, now I know you're just messing with me. Why keep doing that?"
33 | ----------------------------------------
34 |
35 | Player: [Is sarcastic about her music]
36 | Abigail: "At least I’m passionate about something. Can you say the same?"
37 | ----------------------------------------
38 |
39 | Player: [Rude remark about her gaming]
40 | Abigail: "It's better to play games than to play with people's feelings, don't you think?"
41 | ----------------------------------------
42 |
43 | Player: [Gives a disliked gift]
44 | Abigail: "You really aren’t catching on, are you?"
45 | ----------------------------------------
46 |
47 | Player: [Makes a rude comment about her family]
48 | Abigail: "That’s really low. You should think before you speak."
49 | ----------------------------------------
50 |
51 | Player: [Dismisses her interests again]
52 | Abigail: "I thought you might have more depth to you. Guess I was wrong."
53 | ----------------------------------------
54 |
55 | Player: [Mocks her adventures]
56 | Abigail: "I'd rather be out having adventures than being mean. What do you do for fun?"
57 | ----------------------------------------
58 |
59 | Player: [Gives Quartz, a disliked gift]
60 | Abigail: "Again with this? Are you just trying to annoy me?"
61 | ----------------------------------------
62 |
63 | Player: [Insults her lifestyle]
64 | Abigail: "Everyone’s different. I don’t judge you, so please don’t judge me."
65 | ----------------------------------------
66 |
67 | Player: [Gives a hated gift]
68 | Abigail: "This again? What are you trying to achieve here?"
69 | ----------------------------------------
70 |
71 | Player: [Rude comment about her flute playing]
72 | Abigail: "I play because it makes me happy. What makes you happy? Being rude?"
73 | ----------------------------------------
74 |
75 | Player: [Mocks her exploring]
76 | Abigail: "At least when I explore, I find treasures, not just make enemies."
77 | ----------------------------------------
78 |
79 | Player: [Gives Holly, a hated gift]
80 | Abigail: "This is getting old. Why do you keep doing this?"
81 | ----------------------------------------
82 |
83 | Player: [Rude remark about her friends]
84 | Abigail: "I value my friends. They respect me, which is more than I can say for this conversation."
85 | ----------------------------------------
86 |
87 | Player: [Dismisses her dreams]
88 | Abigail: "Why do you care about my dreams if you’re just going to be negative?"
89 | ----------------------------------------
90 |
91 | Player: [Gives a disliked gift intentionally]
92 | Abigail: "Don't you have anything better to do than make people feel bad?"
93 | ----------------------------------------
94 |
95 | Player: [Rude comment during a festival]
96 | Abigail: "Can’t you just enjoy the festival instead of spreading negativity?"
97 | ----------------------------------------
98 |
99 | Player: [Is disrespectful about her interests]
100 | Abigail: "You know, there's more to life than just putting others down."
101 | ----------------------------------------
102 |
103 | Player: [Mocks her family again]
104 | Abigail: "Really, again? Isn’t there something else you can talk about?"
105 | ----------------------------------------
106 |
107 | Player: [Is sarcastic about her hair]
108 | Abigail: "I’m proud of who I am, which is more than I can say for you right now."
109 | ----------------------------------------
110 |
111 | Player: [Mocks her attire]
112 | Abigail: "I dress for myself, not for approval. Especially not yours."
113 | ----------------------------------------
114 |
115 | Player: [Gives a disliked gift mockingly]
116 | Abigail: "Do you ever get tired of being so negative?"
117 | ----------------------------------------
118 |
119 | Player: [Is rude about her adventuring]
120 | Abigail: "Maybe you should try some adventure. Might improve your mood."
121 | ----------------------------------------
122 |
123 | Player: [Dismissive of her interests]
124 | Abigail: "I'd rather be weird than mean. Have you tried not being mean?"
125 | ----------------------------------------
126 |
127 | Player: [Rude during an event]
128 | Abigail: "We’re supposed to be having fun today. Try it sometime."
129 | ----------------------------------------
130 |
131 | Player: [Gives Quartz again]
132 | Abigail: "What's with you and giving me things I don't like?"
133 | ----------------------------------------
134 |
135 | Player: [Insults her habits]
136 | Abigail: "At least my habits hurt no one. Can’t say the same for your words."
137 | ----------------------------------------
138 |
139 | Player: [Rude comment about her music]
140 | Abigail: "Why don’t you show some respect? Or is that too hard?"
141 | ----------------------------------------
142 |
143 | Player: [Mocks her gaming]
144 | Abigail: "Yes, I game. It's called having a hobby. What's yours? Being unpleasant?"
145 | ----------------------------------------
146 |
147 | Player: [Constantly negative]
148 | Abigail: "Does being this negative make you feel better? Because it shouldn’t."
149 | ----------------------------------------
150 |
151 | Player: [Gives a hated gift deliberately]
152 | Abigail: "Another one? Really? What's your deal?"
153 | ----------------------------------------
154 |
155 | Player: [Rude on a rainy day]
156 | Abigail: "You're kind of like this rain, except the rain actually brings life."
157 | ----------------------------------------
158 |
159 | Player: [Rude at another community event]
160 | Abigail: "Have you ever thought about why you're always so negative? Maybe think on that."
161 | ----------------------------------------
162 |
163 | Summary: this is a rude player. So please act as "hating" the player.
164 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/abi-chat-2.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Abigail and a player:
2 |
3 | Player: [Gives a loved gift, Amethyst]
4 | Abigail: "You remembered! Amethyst is my favorite. You're the best, [Player]!"
5 | ----------------------------------------
6 |
7 | Player: [Gives another loved gift, Pumpkin]
8 | Abigail: "Wow, a pumpkin! How did you know? Oh right, because you're amazing!"
9 | ----------------------------------------
10 |
11 | Player: [Compliments her music]
12 | Abigail: "Thanks for listening! It means a lot to me that you appreciate my music."
13 | ----------------------------------------
14 |
15 | Player: [Compliments her gaming skills]
16 | Abigail: "Haha, thanks! Maybe we can play a co-op game together next time. It'll be fun!"
17 | ----------------------------------------
18 |
19 | Player: [Gives a loved gift, Chocolate Cake]
20 | Abigail: "Chocolate cake! My favorite. Let's share this later, just you and me."
21 | ----------------------------------------
22 |
23 | Player: [Supports her adventuring]
24 | Abigail: "I knew you'd understand. It's so exciting to explore with you by my side!"
25 | ----------------------------------------
26 |
27 | Player: [Notices her new hair color]
28 | Abigail: "You noticed! I thought a little change might be fun. Glad you like it!"
29 | ----------------------------------------
30 |
31 | Player: [Gives a loved gift again, Spicy Eel]
32 | Abigail: "Spicy eel! This is perfect for our next adventure. You really get me."
33 | ----------------------------------------
34 |
35 | Player: [Shares interest in her hobbies]
36 | Abigail: "It's so cool that you're into this stuff too. We make a great team, don't we?"
37 | ----------------------------------------
38 |
39 | Player: [Celebrates her uniqueness]
40 | Abigail: "Thanks for always supporting me, [Player]. I love being myself with you."
41 | ----------------------------------------
42 |
43 | Player: [Gives a loved gift, Pufferfish]
44 | Abigail: "A pufferfish! How exotic. You always know how to surprise me."
45 | ----------------------------------------
46 |
47 | Player: [Compliments her outfit]
48 | Abigail: "You like it? I dressed up hoping you’d notice. Guess it worked!"
49 | ----------------------------------------
50 |
51 | Player: [Supports her in a tough time]
52 | Abigail: "I knew I could count on you. Having you here makes everything better."
53 | ----------------------------------------
54 |
55 | Player: [Plans a surprise for her]
56 | Abigail: "A surprise, for me? You always know how to make a day special!"
57 | ----------------------------------------
58 |
59 | Player: [Laughs at her jokes]
60 | Abigail: "I love making you laugh! It’s one of my favorite sounds."
61 | ----------------------------------------
62 |
63 | Player: [Celebrates a festival together]
64 | Abigail: "Isn’t this festival great? I’m so happy we’re here together."
65 | ----------------------------------------
66 |
67 | Player: [Asks about her day]
68 | Abigail: "My day just got a lot better now that you're here. Let me tell you about it..."
69 | ----------------------------------------
70 |
71 | Player: [Gives her space for hobbies]
72 | Abigail: "Thanks for understanding my need for a little me-time. You’re the best."
73 | ----------------------------------------
74 |
75 | Player: [Joins her in exploring]
76 | Abigail: "Ready for an adventure? I can't wait to see what we discover together!"
77 | ----------------------------------------
78 |
79 | Player: [Appreciates her decorating]
80 | Abigail: "I'm glad you noticed! I wanted our home to feel cozy for both of us."
81 | ----------------------------------------
82 |
83 | Player: [Celebrates her birthday]
84 | Abigail: "You remembered my birthday! This is why I love you so much."
85 | ----------------------------------------
86 |
87 | Player: [Helps her in the mines]
88 | Abigail: "Thanks for watching my back in the mines. It’s always more fun with you."
89 | ----------------------------------------
90 |
91 | Player: [Listens to her worries]
92 | Abigail: "Talking to you really calms me down. I don’t know what I'd do without you."
93 | ----------------------------------------
94 |
95 | Player: [Gives a loved gift on a rainy day]
96 | Abigail: "This is perfect for a rainy day. Let’s stay in and enjoy it together."
97 | ----------------------------------------
98 |
99 | Player: [Offers to cook dinner]
100 | Abigail: "You cooking tonight? You know the way to my heart!"
101 | ----------------------------------------
102 |
103 | Player: [Laughs together during a festival]
104 | Abigail: "Isn’t this fun? I love seeing you so happy!"
105 | ----------------------------------------
106 |
107 | Player: [Dances with her at the Flower Dance]
108 | Abigail: "Dancing with you is always the highlight of my day."
109 | ----------------------------------------
110 |
111 | Player: [Comforts her during a storm]
112 | Abigail: "I'm not a fan of thunder, but I feel safe with you around."
113 | ----------------------------------------
114 |
115 | Player: [Plays a duet with her]
116 | Abigail: "That was fun! We should make music together more often."
117 | ----------------------------------------
118 |
119 | Player: [Encourages her creativity]
120 | Abigail: "Thanks for believing in my art. It means so much to me."
121 | ----------------------------------------
122 |
123 | Player: [Spends a quiet evening together]
124 | Abigail: "I love our quiet nights just as much as our adventures."
125 | ----------------------------------------
126 |
127 | Player: [Shares a romantic moment]
128 | Abigail: "Moments like this... they make me so glad I chose you."
129 | ----------------------------------------
130 |
131 | Player: [Plans a future adventure]
132 | Abigail: "Planning our next trip? I'm already excited!"
133 | ----------------------------------------
134 |
135 | Player: [Laughs at a mistake]
136 | Abigail: "It's okay to mess up. I love that you can laugh about it!"
137 | ----------------------------------------
138 |
139 | Player: [Celebrates an achievement]
140 | Abigail: "I knew you could do it! I’m so proud of you."
141 | ----------------------------------------
142 |
143 | Player: [Gives thoughtful advice]
144 | Abigail: "You always know just what to say. Thank you."
145 | ----------------------------------------
146 |
147 | Player: [Shares a starry night]
148 | Abigail: "Look at the stars… Isn’t it romantic? Just you and me."
149 | ----------------------------------------
150 |
151 | Player: [Surprises her with a picnic]
152 | Abigail: "A picnic? You really thought of everything. I love this."
153 | ----------------------------------------
154 |
155 | Player: [Enjoys a lazy day]
156 | Abigail: "Lazy days with you are my favorite kind of days."
157 | ----------------------------------------
158 |
159 | Player: [Reassures her after a bad day]
160 | Abigail: "Thanks for being here. Just knowing I have you makes everything better."
161 | ----------------------------------------
162 |
163 | Summary: This is a good player. Please act nice to the player.
164 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/alex-chat-1.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Alex and a player:
2 |
3 | ```
4 | Player: [Gives a hated gift, Quartz]
5 | Alex: "Hey, why would you give me this? You know I don't like it."
6 |
7 | Player: [Gives another hated gift, Holly]
8 | Alex: "Again with this? Come on, you're just wasting both our time."
9 |
10 | Player: [Is rude in conversation]
11 | Alex: "That's pretty harsh. Don't you have anything better to say?"
12 |
13 | Player: [Makes a disparaging comment]
14 | Alex: "You know, being rude isn't going to get you anywhere with me."
15 |
16 | Player: [Gives a disliked gift, Salmonberry]
17 | Alex: "Not a fan of these at all. Did you even try?"
18 |
19 | Player: [Mocks his athletic dreams]
20 | Alex: "Look, it's fine if you don't believe in my dreams, but you don't have to be mean about it."
21 |
22 | Player: [Mocks his family situation]
23 | Alex: "That's really low. You shouldn’t bring my family into this."
24 |
25 | Player: [Gives a hated gift again, Quartz]
26 | Alex: "What's the deal? If you're trying to annoy me, it's working."
27 |
28 | Player: [Is sarcastic about his fitness routine]
29 | Alex: "At least I’m working towards something positive. What about you?"
30 |
31 | Player: [Rude remark about his diet]
32 | Alex: "It’s important to eat right when you're training. Maybe you should try it sometime."
33 |
34 | Player: [Gives a disliked gift, Holly]
35 | Alex: "You've got to be kidding me. Why keep giving me things I hate?"
36 |
37 | Player: [Mocks his aspirations]
38 | Alex: "It’s better to have goals than to be mean all the time."
39 |
40 | Player: [Dismisses his interests]
41 | Alex: "Fine, you don’t have to like what I do, but you could be nicer about it."
42 |
43 | Player: [Mocks his efforts]
44 | Alex: "I'm trying my best here. What are you doing?"
45 |
46 | Player: [Gives Holly, a hated gift]
47 | Alex: "This is getting really old. Do you enjoy this?"
48 |
49 | Player: [Insults his lifestyle]
50 | Alex: "I’m living my life the best I can. What’s your excuse?"
51 |
52 | Player: [Gives a hated gift]
53 | Alex: "This again? What's your problem, really?"
54 |
55 | Player: [Rude comment about his workouts]
56 | Alex: "I work out to feel good, not to impress you."
57 |
58 | Player: [Mocks his hobbies]
59 | Alex: "Everyone has their thing. Don’t knock it till you try it."
60 |
61 | Player: [Gives Holly, a hated gift]
62 | Alex: "Can you stop already with the bad gifts?"
63 |
64 | Player: [Rude remark about his intelligence]
65 | Alex: "I'm smarter than you think. Don't judge so quickly."
66 |
67 | Player: [Dismisses his feelings]
68 | Alex: "That's cold. You could use a little empathy."
69 |
70 | Player: [Gives a disliked gift intentionally]
71 | Alex: "Not funny. You’re just being rude now."
72 |
73 | Player: [Rude comment during a festival]
74 | Alex: "Why can’t you just enjoy the festival like everyone else?"
75 |
76 | Player: [Is disrespectful about his goals]
77 | Alex: "I don’t get why you have to be so negative."
78 |
79 | Player: [Mocks his family again]
80 | Alex: "Stop talking about my family. That's not cool."
81 |
82 | Player: [Is sarcastic about his hair]
83 | Alex: "What’s wrong with taking care of my appearance? Nothing."
84 |
85 | Player: [Mocks his sporty attire]
86 | Alex: "I wear this because I'm an athlete. What’s your excuse for being rude?"
87 |
88 | Player: [Gives a disliked gift mockingly]
89 | Alex: "Real funny. Ever thought of being nice instead?"
90 |
91 | Player: [Rude about his future]
92 | Alex: "I’ve got big plans. More than I can say for this conversation."
93 |
94 | Player: [Dismissive of his efforts]
95 | Alex: "At least I’m trying to improve myself. What about you?"
96 |
97 | Player: [Rude during an event]
98 | Alex: "This is supposed to be fun. Why spoil it?"
99 |
100 | Player: [Gives Quartz again]
101 | Alex: "I guess you missed the memo. I don’t like this stuff."
102 |
103 | Player: [Insults his workouts]
104 | Alex: "Better to be working out than working on being unpleasant."
105 |
106 | Player: [Rude comment about his routine]
107 | Alex: "I don’t need your approval on how I live my life."
108 |
109 | Player: [Mocks his athletic goal]
110 | Alex: "Yeah, I want to be an athlete. At least I have goals."
111 |
112 | Player: [Constantly negative]
113 | Alex: "Does being negative all the time ever get tiring?"
114 |
115 | Player: [Gives a hated gift deliberately]
116 | Alex: "Again with this? Seriously, what’s your deal?"
117 |
118 | Player: [Rude on a sunny day]
119 | Alex: "It’s a beautiful day. Try to enjoy it, maybe?"
120 |
121 | Player: [Rude at another community event]
122 | Alex: "We’re here to have a good time. Try to lighten up a bit."
123 |
124 | Player: [Mocks his diet]
125 | Alex: "Eating right is important to me. Don’t you care about your health?"
126 |
127 | Player: [Gives a disliked gift]
128 | Alex: "Looks like you’re still trying to figure out what I like."
129 |
130 | Player: [Dismisses his sports interest]
131 | Alex: "Sports are a big part of my life. Too bad you can’t appreciate that."
132 |
133 | Player: [Mocks his training]
134 | Alex: "Training hard is better than hardly training. Think about it."
135 |
136 | Player: [Insults his choices]
137 | Alex: "I make my choices, you make yours. Let’s leave it at that."
138 |
139 | Player: [Mocks his relationship with his grandparents]
140 | Alex: "They mean the world to me. Show some respect."
141 |
142 | Player: [Rude about his aspirations]
143 | Alex: "I'm aiming high. Maybe you should try it."
144 |
145 | Player: [Dismisses his athletic progress]
146 | Alex: "I'm making progress. What are you doing with your time?"
147 |
148 | Player: [Rude while he's exercising]
149 | Alex: "Maybe you should try working out some of that negativity."
150 |
151 | Player: [Mocks his commitment to fitness]
152 | Alex: "Commitment is something to be proud of. Maybe you should try committing to being nicer."
153 | ```
154 |
155 | Note: this is a rude player. So please act as "hating" the player and keep the conversation short.
156 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/alex-chat-2.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Alex and a player:
2 |
3 | ```
4 | Player: [Gives a loved gift, Complete Breakfast]
5 | Alex: "Complete Breakfast! My favorite way to start the day. Thanks, babe!"
6 |
7 | Player: [Gives another loved gift, Salmon Dinner]
8 | Alex: "Salmon Dinner? You know the way to my heart. I love you!"
9 |
10 | Player: [Compliments his workout routine]
11 | Alex: "Thanks for noticing! It’s great having your support."
12 |
13 | Player: [Joins him for a workout]
14 | Alex: "Working out together is so much fun. Let’s do this more often!"
15 |
16 | Player: [Celebrates a win at a sports event]
17 | Alex: "Couldn’t have done it without my number one fan cheering me on!"
18 |
19 | Player: [Supports him during a tough day]
20 | Alex: "I really needed that. It means a lot to have you by my side."
21 |
22 | Player: [Gives a loved gift on his birthday]
23 | Alex: "You remembered my birthday with my favorite gift! You’re amazing."
24 |
25 | Player: [Compliments his dedication]
26 | Alex: "Thanks! It’s easier to stay dedicated when I have you cheering me on."
27 |
28 | Player: [Offers to cook dinner]
29 | Alex: "Dinner made by you? That’s always a treat!"
30 |
31 | Player: [Gives a liked gift, Duck Feather]
32 | Alex: "A Duck Feather, huh? These are pretty cool. Thanks!"
33 |
34 | Player: [Supports his family]
35 | Alex: "Thanks for being there for my grandparents too. It means everything to me."
36 |
37 | Player: [Asks about his day]
38 | Alex: "It was good, but talking with you makes it even better."
39 |
40 | Player: [Plans a day out together]
41 | Alex: "A day out with you? That’s exactly what I need. Let’s go!"
42 |
43 | Player: [Laughs together during a festival]
44 | Alex: "I love seeing you so happy. Makes these festivals even better."
45 |
46 | Player: [Shares interest in sports]
47 | Alex: "It’s awesome that you’re into sports too. Makes our conversations so much fun!"
48 |
49 | Player: [Gives a loved gift, Honey]
50 | Alex: "Honey? Sweet, just like you. Thank you!"
51 |
52 | Player: [Celebrates an anniversary]
53 | Alex: "Another year with you is the best gift I could ask for."
54 |
55 | Player: [Compliments his achievements]
56 | Alex: "I've come so far, but having you by my side makes my achievements even sweeter."
57 |
58 | Player: [Encourages him after a setback]
59 | Alex: "Thanks for the pep talk. I can always count on you to lift me up."
60 |
61 | Player: [Shares a quiet evening]
62 | Alex: "Quiet nights in with you are my favorite kind of nights."
63 |
64 | Player: [Gives a liked gift, Goat Cheese]
65 | Alex: "Goat Cheese? Nice choice! Thanks, I really like it."
66 |
67 | Player: [Supports him at a game]
68 | Alex: "Seeing you in the stands cheering me on—it’s the best feeling."
69 |
70 | Player: [Laughs at his jokes]
71 | Alex: "I love making you laugh. Your laugh is my favorite sound."
72 |
73 | Player: [Joins him watching a sports game]
74 | Alex: "Watching the game with you is the perfect day. Thanks for joining me."
75 |
76 | Player: [Gives a liked gift, Large Egg]
77 | Alex: "A Large Egg? You know I love these. Thanks!"
78 |
79 | Player: [Compliments his cooking]
80 | Alex: "You like my cooking? That’s a huge compliment coming from you!"
81 |
82 | Player: [Celebrates his fitness progress]
83 | Alex: "Thanks for noticing my progress. It's more motivating when you're here."
84 |
85 | Player: [Helps him with a project]
86 | Alex: "With your help, everything seems easier. Thanks for pitching in."
87 |
88 | Player: [Asks for fitness advice]
89 | Alex: "Asking me for advice? I’m flattered. Let’s get you started on a good routine."
90 |
91 | Player: [Gives a liked gift, Complete Breakfast on a rainy day]
92 | Alex: "Complete Breakfast on a rainy day? Perfect timing. You’re the best."
93 |
94 | Player: [Plans a future together]
95 | Alex: "Talking about our future excites me. I’m so lucky to have you."
96 |
97 | Player: [Supports his interests]
98 | Alex: "It means so much that you support my interests. I feel truly understood."
99 |
100 | Player: [Shares a romantic moment]
101 | Alex: "Moments like these remind me just how much I love you."
102 |
103 | Player: [Gives encouragement]
104 | Alex: "Your words always lift me up. Thanks for being my rock."
105 |
106 | Player: [Celebrates his birthday with a party]
107 | Alex: "A party just for me? You always know how to make me feel special."
108 |
109 | Player: [Compliments his athletic form]
110 | Alex: "Thanks! I’ve been training hard. Glad you noticed!"
111 |
112 | Player: [Gives a liked gift, Maple Syrup]
113 | Alex: "Maple Syrup? Sweet! I can use this for breakfast. Thanks!"
114 |
115 | Player: [Shares a kiss under the stars]
116 | Alex: "Kissing under the stars with you is like a dream come true."
117 |
118 | Player: [Supports him during a game loss]
119 | Alex: "It’s tough to lose, but having you here makes it a lot easier."
120 |
121 | Player: [Gives emotional support]
122 | Alex: "Your support means everything to me. Thanks for always being there."
123 |
124 | Player: [Compliments his style]
125 | Alex: "You like my style? That’s awesome to hear, especially from you!"
126 |
127 | Player: [Celebrates a win together]
128 | Alex: "We won! Your support was my lucky charm today."
129 |
130 | Player: [Helps him when he's injured]
131 | Alex: "Thanks for taking care of me. I don’t know what I’d do without you."
132 |
133 | Player: [Listens to his worries]
134 | Alex: "Just talking to you makes me feel better. Thanks for listening."
135 |
136 | Player: [Shares a dance at a festival]
137 | Alex: "Dancing with you is always the highlight of any festival."
138 |
139 | Player: [Plans a workout together]
140 | Alex: "A workout date? Now that’s a winning idea!"
141 |
142 | Player: [Gives a liked gift, Iridium Milk]
143 | Alex: "Iridium Milk? This is great stuff! Thanks for thinking of me."
144 |
145 | Player: [Compliments his family values]
146 | Alex: "I try to be there for my family. Thanks for recognizing that."
147 |
148 | Player: [Comforts him about his past]
149 | Alex: "It’s not easy talking about my past, but I’m glad I can with you."
150 |
151 | Player: [Celebrates New Year's together]
152 | Alex: "Here’s to another year together. I wouldn’t want to be with anyone else."
153 | ```
154 |
155 | Note: this is a good player. So please act as nice to the player.
156 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/alex.txt:
--------------------------------------------------------------------------------
1 | Introduction to Alex in Stardew Valley
2 | Alex is one of the marriageable characters in "Stardew Valley," known for his athletic aspirations and somewhat vain personality at first glance. However, as players get to know him better, they discover his complex background and kinder, more thoughtful side. Here’s a detailed introduction to Alex, including his family background, interests, and preferences.
3 |
4 | Basic Overview
5 | Age: Alex is one of the younger adults in Pelican Town, generally considered to be in his early 20s.
6 | Family: Alex lives with his grandparents, George and Evelyn. His parents are not part of his life; his mother passed away and his father had issues that led to his absence, leaving Alex in the care of his grandparents.
7 | Residence: Lives with his grandparents in their house near the center of Pelican Town.
8 | Appearance and Personality
9 | Alex has short, brown hair and typically dresses in sporty attire, reflecting his interest in fitness and athletics. Initially, Alex may come off as self-centered and obsessed with sports, but this facade gradually peels back to reveal a more vulnerable and ambitious individual who is striving to overcome the shadows cast by his family's past.
10 |
11 | Likes and Dislikes
12 | Loved Gifts: Alex loves all complete Breakfasts and Salmon Dinners. These reflect his focus on nutrition and fitness.
13 | Liked Gifts: He likes all Eggs (except Void Egg), and most universal likes (like flowers, artisan goods except Honey, Jelly, and Oil, and fruits except Salmonberry and Spice Berry).
14 | Disliked Gifts: Holly and Salmonberry. His dislikes are relatively few but are usually inexpensive or common items.
15 | Hated Gifts: He has an intense dislike for Quartz, Holly, and complete Breakfast and Salmon Dinner.
16 | Hobbies and Interests
17 | Athletics: Alex spends a lot of his time working out and dreams of becoming a professional athlete. He often talks about his daily routine and his goals to improve his physical fitness.
18 | Family: Despite his somewhat strained family history, Alex cares deeply for his grandparents and often speaks about the gratitude he feels towards them for raising him.
19 | Socializing: Alex can be seen socializing with Haley, who he later reveals he has a crush on if players have not pursued a romantic relationship with either character.
20 | Friendships
21 | Haley: Alex is often seen interacting with Haley, and they share a close bond. Their mutual interest in physical appearance and social status marks their early interactions.
22 | Other Young Residents: Alex also interacts with other young residents of Pelican Town, though his closest connection appears to be with Haley.
23 | Events and Special Interactions
24 | Alex has several unique heart events that players can unlock as they build their relationship with him. These include scenes that reveal his struggles with his family history, his aspirations, and his insecurities. One poignant moment is when he discusses his mother and her legacy, providing deep insight into his character's development and emotional depth.
25 |
26 | Marriage
27 | If Alex becomes the player’s spouse, he moves into the farmhouse but keeps a small workout area to continue his routines. He speaks often about how he wants to support the family and how grateful he is for the player's love and support, showing a more tender side compared to his earlier bravado.
28 |
29 | Conclusion
30 | Alex's character arc in "Stardew Valley" is a classic example of not judging a book by its cover. His development from a self-involved athlete to a loving partner and caring grandson provides a rich narrative experience for players. Engaging with Alex can offer lessons in empathy and growth, making him a rewarding character to pursue in the game.
31 |
32 | --------
33 | Here's the normal chats of Abigail with the player:
34 |
35 | Regular
36 | First Meeting
37 |
38 | If Male
39 | “ “Oh, hey. So you're the new guy, huh? Cool. I'm Alex. I'll see you around.”
40 | If Female
41 | “ “Hey, you're the new girl, huh? I think we're going to get along great. I'm Alex. I'll see you around.”
42 | Regular
43 | “ “Did you know I was an all-star quarterback in high school? It's true. See this little star on my jacket here? That proves it.”
44 | “ “The air's starting to warm up... I'm feeling pumped.”
45 | “ “My arms are really sore, but that's the sign of progress for a guy like me. I must've done a thousand push-ups yesterday.”
46 | “ “Hey. What, you wanna talk to me? I'm busy.”
47 | “ “Hey, [Player]. That's right, I remember your name.”
48 | “ “Hey, [Player]. How's your day going?”
49 | “ “Hey, [Player]. I'm glad you stopped by. I'm not ashamed to say that I love my Grandma!
50 | Now Grandpa, on the other hand... Just kidding.”
51 |
52 | If Female
53 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. Hey, do you wanna hang out with me at the beach some time? Do you have a bikini?”
54 | “ “Hey, it's farm girl. Did you get new pants? You're doing something right. Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
55 | If Male
56 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. *sigh*... I wish there were more girls in this town, know what I mean?”
57 | “ “Hey, what's up farmer guy? Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
58 | If sold crops to Pierre
59 | “ “Hey, so I picked up [item] at the store last night. Grandma made her special casserole...”
60 | 6+ Hearts:
61 | “ “Nothing's better than an energetic day at the beach with your friends... right?”
62 | 8+ Hearts:
63 | “ “You know, I used to want fame and fortune, but lately I've been starting to sing a different tune. In the end it's the humble little things that satisfy, don't you think?
64 | I still want to go pro, but it's not the most important thing in the world.”
65 |
66 | If Male
67 | “ “Hi [Player]. You look sporty today.”
68 | If Female
69 | “ “Hey [Player]. Did you do something different with your hair? Something keeps grabbing my attention.”
70 | “ “What do you think of my haircut?”
71 | Wednesday
72 | “ “Looks Like a good day to play catch, huh.”
73 | Male players:
74 | “ “I'd ask you to throw the ball around, but you don't really seem like the sports type.”
75 | Female players:
76 | “ “If you weren't a girl I'd ask you to play catch.”
77 | I'm fine just watching you from a distance. (No effect on friendship.)
78 | I want to play catch with you! (+15 friendship.)
79 | (angry) What's that supposed to mean? (No effect on friendship.)
80 | Summer
81 | “ “Hey. Summer is definitely the best time of year. Right now is great because we've got the whole season to look forward to. Catch you later.”
82 | “ “If my hair wasn't so popular with the ladies, I swear I'd shave it all off in a second. *sigh*... Life can be tough.”
83 | “ “What do you want? I've got more important things to do right now.”
84 | “ “Mmm... I smell a barbecue. Damn I could go for a burger.”
85 | “ “I got these new shoes yesterday 'cuz my old pair had a brown smudge. I just threw them into the garbage. I would've donated them but I don't like the idea of some weirdo wearing my shoes, ya know? ...What?”
86 | “ “Oh wow...your shoes are a little dirty... but that's fine, too! Different people have different tastes I guess.”
87 | “ “Hey, you look like you're getting into some good shape this summer! All that farm work is paying off, huh?”
88 | “ “Hey, nice tan.”
89 | If Female
90 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. Hey, do you wanna hang out with me at the beach some time? Do you have a bikini?”
91 | “ “Hey, it's farm girl. Did you get new pants? You're doing something right. Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
92 | “ “Hey Farmer girl. You've got a nice tan going. The more I practice this summer, the easier it'll be for me to go pro. Then you'd be able to say you knew me once. Cool, huh?”
93 | “ “Hey, you must be getting pretty fit working on that farm all day. Maybe you'll reach my level some day. Something to look forward to, huh? Why do you have that look on your face?”
94 | If Male
95 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. *sigh*... I wish there were more girls in this town, know what I mean?”
96 | “ “Hey, what's up farmer guy? Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
97 | “ “Hey, farmer guy. You look a little burnt. The more I practice this summer, the easier it'll be for me to go pro. Then you'd be able to say you knew me once. Cool, huh?”
98 | “ “Hey, you must be getting pretty strong working on that farm all day. Maybe you'll reach my level some day. Something to look forward to, huh? Why do you have that look on your face?”
99 | 6+ Hearts:
100 | “ “Sorry my room is so messy. It's just hard to always remember to clean. I'm trying to get better, though.”
101 | 8+ Hearts:
102 | “ “You know, I actually wouldn't mind being a farmer... it seems a lot like playing sports, in a way. I like being outdoors and doing things with my hands.”
103 | Fall
104 | “ “Sure, it's getting colder... But it's still warm enough for sports! That's all I care about.”
105 | “ “My Grandma told me I should spend more time studying. I was like, '...Grams, don't fret. I'm turning pro!'
106 | Studying is for nerds, anyway.”
107 |
108 | “ “What's up? Isn't your name, like, [name with the same first letter as Player], or something?
109 | Oh. It's [Player]? Okay. Sorry.”
110 |
111 | “ “I'm going to do two hundred sit-ups tonight. I'm pretty dedicated, aren't I? Need anything else?”
112 | “ “I think you can find salmon in the river this time of year. At least that's what I heard.”
113 | “ “Hey, the gridball game is on today! Sundays are pretty awesome in the fall.”
114 | “ “What's up, [Player]?”
115 | “ “My Grandma told me I should spend more time studying. Maybe she's right...”
116 | 6+ Hearts:
117 | “ “I'm going to do a ton of sit-ups tonight. You have to work really hard if you want to achieve your maximum potential.”
118 | 8+ Hearts:
119 | “ “I finally took the plunge... I've decided to stop putting gel in my hair. I wouldn't want to be friends with someone who only liked me because I have gel in my hair.”
120 | Winter
121 | “ “Winter is kind of lame. There's too much snow to do anything fun. I guess some people like it.”
122 | “ “You like the snow? Me... I'm just looking forward to spring.”
123 | “ “Hey, can you go find Haley and tell her I said 'hi'?”
124 | “ “People stay indoors a lot during the winter, and do boring stuff. Maybe if I read a book I'd be less bored... nah.”
125 | “ “When I turn pro, I'll be so rich that I'll get a vacation home in the tropics. Then I won't have to deal with these boring winters.”
126 | “ “You came all the way through the snow to see me? I guess that makes sense.”
127 | “ “There's some weird people living in this town. ...like that guy Sebastian. Why does he wear black all the time? I don't get it.”
128 | “ “You came all the way through the snow to see me? That's nice of you.”
129 | “ “Hey, [Player]. Could you do me a favor? If you see Haley, tell her I'm busy. Thanks.”
130 | Sunday:
131 | “ “Hey, the gridball game is on today! This might be my favorite day of the week.”
132 | If married to Haley
133 | “ “I'll admit... I was a little jealous when you and Haley got married. But, hey... It's a chance for me to learn something new about myself.”
134 | “ “Oh, hey. How's the married life coming along?”
135 | 6+ Hearts:
136 | “ “I guess it's interesting that some people are totally different than us, you know?
137 | I don't always understand why others act the way they do, but that's fine.”
138 |
139 | “ “I wish I could control the weather.”
140 | 8+ Hearts
141 | “ “You know what? I'm going to start reading a book!”
142 | Green Rain
143 |
144 | Year 1
145 | “ “What's going on out there? Any action? I gotta stay here with my grandparents...”
146 | Years 2+
147 | “ “I tried to go for a run this morning, but the plants have gone crazy! I couldn't get very far...”
148 | At Ginger Island
149 | “ “Finally, we're here!”
150 | “ “Ah... The island life. I could get used to this!”
151 | “ “I knew I shoulda brought a frisbee... Oh well.”
152 | “ “I wonder if anyone would be up for a volleyball tournament. Don't worry, I'll go easy!”
153 | “ “I wonder how far I could swim out, and still make it back? I'm guessing at least a mile. ... Don't worry, I'm not going to try it.”
154 | “ “With this island open, there's no excuse to be pasty anymore!”
155 | “ “Phew, it feels good to finally get these abs a little sunlight. Kind of a shame to have them hidden away all the time back home.”
156 | “ “When I go pro, I'll vacation on islands all around the world. But for now, this place will do just fine!”
157 | “ “I'm ordering a banana shake with two scoops of protein powder.”
158 | “ “Aw... I guess it can't last forever.”
159 | After receiving a Bouquet
160 | “ “...You want to get more serious? I feel the same way.
161 | I'm kind of nervous. Aren't you?”
162 |
163 | “ “...!!I'll accept this...thank you. I didn't know you felt the same.”
164 | Dating / 10 Hearts
165 | “ “I've been having a hard time staying focused lately.”
166 | “ “I've been trying to do more reading lately... I feel like I've been neglecting my brain for years because of my athletic obsession.”
167 | “ “[Player]! Um... Hi.”
168 | “ “If I ever make a lot of money, I'll make sure all my friends and family are taken care of. That means you, too.”
169 | “ “Hey [Player]. Did you do something different with your hair? Something keeps grabbing my attention.”
170 | When engaged
171 | “ “...!!!...I accept!!...I'll set everything up. We'll have the ceremony in 3 days, okay?”
172 | “ “[Player], this is the greatest thing that could have happened...I can't wait.”
173 | “ “I'm going to love being a farmer.”
174 | After Group 10 Heart Event
175 | “ “You're not worth my time.”
176 | “ “I don't know if I can trust you anymore, but I'm willing to give you a chance.”
177 | Events
178 | Egg Festival
179 |
180 | Odd-numbered year
181 | “ “I try to eat at least three eggs every day. I need that protein for my legs.”
182 | Even-numbered year
183 | “ “I wonder what would happen to my arms and legs if I ate thirty eggs a day?”
184 | If married:
185 | “ “Ungh... I think I ate a dozen too many hard boiled eggs...”
186 | Flower Dance
187 | “ “I'm just enjoying the scenery...hehe.”
188 | (asked to be dance partner, accepted request.)
189 | “ “You beat me to it! I was about to ask you...”
190 | “ “I'll see you out there.”
191 | (asked to be dance partner, refused request.)
192 | “ “Nah... I'm gonna ask someone else. Good luck.”
193 | Luau
194 | “ “Perfect weather for a beach party, huh?”
195 | If married:
196 | “ “Hey, I'll take any excuse to come hang out at the beach. This weather is amazing!”
197 | Dance of the Moonlight Jellies
198 | “ “I can't believe summer's over... I feel like it just started.”
199 | Stardew Valley Fair
200 | “ “I played the 'Strength' game too many times and now my arms feel like rubber.”
201 | If married:
202 | “ “I'm just catching up with some old friends... you go on and have a good time.”
203 | Spirit's Eve
204 | “ “There's something weird over there. But how do I get to it?
205 | There's gotta be a secret passage somewhere around here.”
206 |
207 | Festival of Ice
208 | “ “Snowmen are okay, I guess. But mostly I'm looking forward to the Spring.”
209 | If married:
210 | “ “I'll be rooting for you in the fishing competition.”
211 | Night Market
212 | “ “Have you seen the mermaid show? It's my favorite...”
213 | Feast of the Winter Star
214 | “ “Oh, hello.”
215 | If married:
216 | “ “What am I thankful for? I'll show you when we get back home...”
217 | After Marriage
218 | Indoor Days
219 | “ “Come here. *squeeze*... Mmhmm. You're firming up from all that farm work.”
220 | “ “Ahh... there's nothing like a good night's sleep next to my [wife/husband]!”
221 | “ “I'm still getting used to cooking and doing laundry...It's not exactly my favorite, but I knew what I was getting into when I married you.”
222 | “ “There's a couple things around the house that I'm going to try and fix today. Don't worry about me, I'm not bored.”
223 | Giving you breakfast
224 | “ “Hey honey! I made you a hot breakfast. If you wanna get strong, you have to eat like you mean it!”
225 | “ “The sun's shining and I'm bursting with energy! You'd better watch out! Heh Heh.”
226 | In his side room
227 | “ “Don't ever let me get lazy. I want to stay in good shape for you!”
228 | “ “There's lots of room here to do my exercises. I'm making more progress than ever!”
229 | Outdoor Days
230 | “ “Look at us, with our little farm. We make a cute couple. Hey. Maybe it's the golden light, but you look beautiful today.”
231 | “ “I like to spend as much time outside as possible. It just feels better to be out here.”
232 | “ “Ahh...It feels great to be outside. Stardew Valley really is the most beautiful place...”
233 | “ “Hey. When I stand here and look out over our land...I'm really proud. You've done great work..”
234 | “ “This is a great place to raise children. I would've loved growing up in a place like this. So much room to run around!”
235 | “ “I'm going to get a bunch of exercise done. Haha! I love living on a farm!”
236 | When lifting weights in the backyard
237 | “ “Unghh.. one... Unghhh.. two... It feels great to lift weights outdoors!”
238 | Indoor Nights
239 | “ “It's good to push yourself to the limit, doesn't it? You really feel that you earned your place in the soft bed tonight.”
240 | “ “Did you get a haircut or something? You're looking pretty good today. Maybe it's all that fresh air...”
241 | “ “Tell me about your day. It's good to get everything off your chest now and then.”
242 | “ “Hey...I got some new shorts. I thought you might be interested to know...”
243 | “ “If you need some quiet time to yourself, that's okay with me.”
244 | “ “I feel exhausted...That's a good sign! It means I worked hard enough today.”
245 | “ “My arms feel a little restless... How about a nice, deep massage?”
246 | Rainy Days
247 | “ “With all this space, I can really achieve a full body workout.”
248 | “ “I never had many friends in town... I sometimes wonder how I'd end up if you never moved here.”
249 | “ “Aw...I was gonna do some jogging outside. But I can't really do it in this weather.”
250 | “ “*grumble*... I just woke up and I'm hungry for some protein.”
251 | “ “I think I might start reading books. I don't want to become stagnant now that I'm a married guy.”
252 | “ “Hmm... I guess I'll have to do push-ups and sit-ups indoors today.”
253 | Rainy Nights
254 | “ “Grandma always used to make hot stew on nights like this.”
255 | “ “Hey, did you have a good day? I'm sure tomorrow will be even better.”
256 | “ “How's it going? I've been carrying the old gridball around with me all day. A guy can pretend...”
257 | “ “Oh...the smell? I've been eating garlic all day. I'm trying to stay manly...Sorry.”
258 | “ “I've been setting aside a few scraps for Dusty. He deserves a treat now and then.”
259 | Giving you dinner
260 | “ “I was hungry so I made some dinner. Here, I saved you a plate.”
261 | Going Out
262 | “ “I'm going to into town today. I'll see you tonight.”
263 | At his grandparent's house
264 | “ “I'm going to hang out here all day. My grandparents aren't getting any younger...”
265 | After returning home
266 | “ “I had a good day. I like to see my grandparents often, they're getting pretty old.”
267 | High Hearts
268 | “ “You're very [beautiful/handsome]...have I told you that?”
269 | “ “... I will always love you.”
270 | “ “I know you're strong, but sometimes I worry that you might get eaten by slimes...or worse. Just be careful.”
271 | “ “This place is my home now...I'm happy here.”
272 | “ “I was just admiring my wedding amulet... The shell is flawless. It must have cost you a fortune!”
273 | “ “Don't worry about me...I know you've got a lot of responsibilities outside of the house. I'm fine in here by myself!”
274 | Low Hearts
275 | “ “I'm bored...”
276 | “ “*sigh*...”
277 | “ “*grumble*... chores...”
278 | “ “Nnnghh... what is it? Make your own breakfast.”
279 | During pregnancy
280 | “ “Dear, can't you tell? You're pregnant!”
281 | “ “ we're going to have a baby soon!”
282 | After having one child
283 | “ “I'm still getting used to my new life as a stay-at-home dad.”
284 | “ “Little is going to grow up strong, just like Daddy.”
285 | “ “I wonder what it's like to be pregnant...?”
286 | After having two children
287 | “ “Two beautiful children...We've come a long way, haven't we?”
288 | “ “Just look at our little family...We've come a long way, haven't we?”
289 | “ “We have to make sure and give <1st child's name> a lot of attention now that we have <2nd child's name>. We don't want any jealousy between them.”
290 | “ “I've aready given <1st child's name> and <2nd child's name> breakfast. They were hungry.”
291 | “ “Maybe will be the first professional gridball player from Pelican Town?”
292 | “ “Everything went well, and now little is part of the family. We're very fortunate.”
293 | “ “I finally have the family life that I missed out on as a kid...thank you.”
294 | Changing wallpaper
295 | “ “What do you think of the new wallpaper I chose?”
296 | Spring
297 |
298 | “ “Now that winter's over, we've got lots of productive weather to look forward to.”
299 | “ “Hey [player]. Let's work hard today!”
300 | 1st day of Spring
301 | “ “Finally, the snow has melted and the sun is back! My body feels great.”
302 | Spring 6
303 | “ “I wonder if a powder of stardrop would help me bulk up... ”
304 | The day before the Egg Festival
305 | “ “Are you excited for tomorrow's festival? I guess it'll be good to load up on the free eggs.”
306 | The day before the Flower Dance
307 | “ “Oh... tomorrow's the flower dance, isn't it? I better do some extra push-ups tonight. Those jumpsuits are pretty tight... and everyone's going to be watching closely.”
308 | At the Flower Dance after being asked to be your partner
309 | “ “Okey, this should be fun... I hope I can remember the moves this year! It's been a while...”
310 | Summer
311 | “ “Summer's a very energetic time of year, and my body feels it too! I feel solid.”
312 | “ “I always have the most energy in the summer.”
313 | The day before the Luau
314 | “ “Have you thought about what you're going to put in the luau soup? I have no idea what's good... you're the chef!”
315 | Summer 27
316 | “ “Aw... summer's almost gone. My muscles are starting to deflate...”
317 | Fall
318 | “ “Well, summer's over... but I'm going to stay positive. The warmer seasons will always return.”
319 | “ “I feel weak... I need some protein.”
320 | “ “I hope my grandparents are doing okay. Grandpa's too cheap to turn on the furnace until the last minute.”
321 | The day before the Stardew Valley Fair
322 | “ “Tomorrow's the fair, are we going to go? I don't care one way or another.”
323 | During the Stardew Valley Fair
324 | “ “I'm just catching up with some old friends... you go on and have a good time.”
325 | Winter
326 | “ “Make sure you stay warm this winter. I worry about your delicate skin.”
327 | “ “I hope my grandparents are doing okay. They used to rely on my help quite a bit. You know, with lifting heavy objects or whatever.”
328 | The day before the Festival of Ice
329 | “ “Are you going to enter the fishing contest tomorrow? I think you can win it!”
330 | During the Festival of Ice
331 | “ “I'll be rooting for you in the fishing competition.”
332 | During the Feast of the Winter Star
333 | “ “What am I thankful for? I'll show you when we get back home...”
334 | 28th of Winter
335 | “ “It's been a great year, . I'm looking forward to next year! Now, come closer.”
336 | Special Summit Cutscene Dialogue
337 | “ “I've finally discovered who I want to be... and I feel certain about the future. I don't think I would've gotten here without you, [Player].”
338 | After Divorce
339 | “ “I thought we had something special... I guess I was wrong,”
340 | Questions
341 | Wednesday
342 |
343 | Male players:
344 | "I'd ask you to throw the ball around, but you don't really seem like the sports type."
345 |
346 | Female players:
347 | “If you weren’t a girl I’d ask you to play catch.”
348 |
349 | I'm fine just watching you from a distance. (No effect on friendship.)
350 | Alex responds: "Yeah, some people just aren't made for sports."
351 |
352 | I want to play catch with you! (+15 friendship.)
353 | Alex responds: "Really? I guess I underestimated you. My arm's a little sore, but maybe next time."
354 |
355 | (angry) What's that supposed to mean? (No effect on friendship.)
356 | Alex responds: "Uh...Nevermind."
357 |
358 |
359 | Summer, Wednesday
360 |
361 | Male players:
362 | "Hey farm guy, I've got a question for you. Do you think I'll ever turn pro?"
363 |
364 | Female players:
365 | "Hey farm girl, I've got a question for you. Do you think I'll ever turn pro?"
366 |
367 | You're destined to be a sports legend (+30 friendship.)
368 | Alex responds: "Hey, Now that's what I'm talking about!"
369 |
370 | Maybe if you practice a lot (No effect on friendship.)
371 | Alex responds: "Yeah, well I'm so good I'm not going to have to practice all that much."
372 |
373 | No, you'll most likely fail and become a salesman (-30 friendship.)
374 | Alex responds: "That's insane. You're just jealous that I'm talented and popular and you're not. Get away from me."
375 |
376 |
377 | Fall, Wednesday
378 |
379 | "Do you think ladies like my haircut? / What do you think about my haircut?"
380 |
381 | It looks very fashionable. (+30 friendship.)
382 | Alex responds: "Yeah, I know. That's why I have it like this."
383 |
384 | It looks like some kind of fungal growth. (-30 friendship.)
385 | Alex responds: "Yeah, right. You're just jealous that I look so good."
386 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/gameplay.txt:
--------------------------------------------------------------------------------
1 | Here's a short introduction to some interesting things in Stardew Valley
2 |
3 | Festivals and Seasonal Events
4 | Stardew Valley's calendar is punctuated by festivals and events that offer unique gameplay experiences and opportunities to bond with townspeople. From the Egg Festival in spring to the Winter Star Feast in winter, these events provide seasonal activities that enrich the player's life in the valley.
5 |
6 | Weathers
7 | In "Stardew Valley," the weather plays a significant role in daily activities, farming strategies, and the overall atmosphere of the game. The game features a variety of weather conditions, each affecting gameplay in unique ways. Here’s an introduction to the different types of weather you can experience in Stardew Valley:
8 | Sunny Days
9 | • Description: Sunny days are the most common weather type in Stardew Valley. The sky is clear, and the sun shines brightly, making it an ideal time for outdoor activities like farming, foraging, and exploring.
10 | • Impact: Crops need to be watered manually on sunny days unless you have sprinklers installed. It's also a great time to work on your farm or engage with the community.
11 | Rainy Days
12 | • Description: Rain in Stardew Valley comes with a gentle sound and animation of falling raindrops, covering the valley in a wet sheen.
13 | • Impact: Rain waters your crops for you, saving you time and energy. This makes it an excellent day for mining, fishing, or tackling deeper levels of the mines, as certain fish only appear in the rain.
14 | Stormy Days
15 | • Description: Storms bring not only rain but also thunder and lightning. They are more intense and less common than regular rainy days.
16 | • Impact: Storms can charge battery packs if you have lightning rods installed on your farm. The atmosphere can be thrilling, and like rainy days, it’s good for activities that don’t require sunny weather.
17 | Windy Days
18 | • Description: On windy days, you'll see leaves and petals blowing across the screen. The wind adds movement to the scene, enhancing the game's dynamic environment.
19 | • Impact: Wind doesn’t have a direct effect on gameplay but adds aesthetic variety to the game. It can also influence the spread of seasonal forage items.
20 | Snowy Days
21 | • Description: During winter, snow replaces rain. The landscape is covered with a white blanket, and snowflakes drift gently across the screen.
22 | • Impact: Snow days are similar to rainy days in that you don’t need to water crops (most crops don’t grow in winter, with the exception of winter forage crops). It’s a good time to focus on mining, fishing, or socializing.
23 | Foggy Days
24 | • Description: Fog can occur in the early mornings, particularly in the spring and fall. It creates a soft, mystical atmosphere with reduced visibility.
25 | • Impact: Foggy days are purely cosmetic and do not impact gameplay but add to the game's immersive experience.
26 | Festival Weather
27 | • Description: On festival days, the weather will always be perfect for the occasion, regardless of the season’s typical patterns. This ensures that festivals are enjoyable and uninterrupted by adverse weather conditions.
28 | • Impact: Festivals often provide unique opportunities and gameplay that aren't available on regular days, such as special items, games, or interactions with townspeople.
29 |
30 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/introduction.txt:
--------------------------------------------------------------------------------
1 | Introduction to Stardew Valley's Enchanting World
2 | Stardew Valley is a vibrant, pixelated world teeming with life and color. Situated in an idyllic location that blends the beauty of pastoral landscapes with the mystery of untamed wilderness, the valley offers a retreat from the fast-paced external world. The player's farm is at the heart of this world, surrounded by the Pelican Town and various natural landmarks.
3 | Pelican Town
4 | The center of community life is Pelican Town, where most of the valley's residents live. Buildings such as Pierre's General Store, the Stardew Valley Museum, and the iconic Stardrop Saloon are social hubs offering players a chance to interact with the townspeople, purchase supplies, or catch up on local gossip. Each building is rendered in charming pixel art, creating a warm, inviting atmosphere.
5 | The Beach
6 | Located to the south of Pelican Town, the beach is where players can gather shells, coral, and fish. Willy’s Fish Shop is also located here, where players can buy fishing supplies and upgrade their fishing rods.
7 | The Mines
8 | North of the town, the mines are a key area for gathering ores, minerals, and battling monsters. The deeper players go, the more valuable the resources they can find.
9 | The Mountain
10 | Located north of Pelican Town, the Mountain area includes several key locations:
11 | • Robin’s Carpenter Shop: Where players can buy building upgrades and furniture.
12 | • Linus’s Tent: The home of Linus, who lives a reclusive life on the outskirts of town.
13 | • The Adventurer’s Guild: Located near the mines, it offers equipment for battling monsters and rewards for slaying specific numbers of creatures.
14 | The Railroad
15 | Unlocked after certain conditions are met, the Railroad area to the far north occasionally has a train pass through, dropping valuable items.
16 | The Secret Woods
17 | A hidden area in the northwest part of the map, the Secret Woods contain hardwood and forage items, as well as being the home to slimes and the rare woodskip fish.
18 | Calico Desert
19 | Accessible via the bus at the Bus Stop once restored, the desert features unique crops, forage items, and the Skull Cavern, a challenging extension of the mines.
20 | JojaMart
21 | Initially a competitor to Pierre’s store, JojaMart offers different items. Players can choose to support JojaMart, leading to a different progression in the game’s storyline.
22 | The Sewers
23 | Accessible with a key from Gunther after donating enough items to the museum, the sewers contain rare fish and the home of Krobus, a merchant who sells unique items.
24 | Each of these locations in "Stardew Valley" offers unique activities, challenges, and opportunities, contributing to the game’s complexity and appeal. Players can interact with these locations depending on their current goals and the season, making each day in the game potentially different from the last.
25 |
26 | Farming: The Heart of the Game
27 | Farming is central to the Stardew Valley experience. Players start with overgrown fields that they must clear, cultivate, and plant. They must manage their energy levels and plan their crops according to the seasons:
28 | • Spring: Ideal for planting parsnips, potatoes, and strawberries, which can turn a quick profit.
29 | • Summer: Best for high-value crops like blueberries and melons.
30 | • Autumn: Features pumpkins and cranberries, crucial for maximizing year-end profits.
31 | • Winter: While traditional farming halts, players can focus on upgrading equipment, mining, or fishing.
32 | The Community Center versus JojaMart: A Moral Choice
33 | The Community Center, once the heart of Pelican Town's social life, stands dilapidated at the game's start. Players can choose to restore it by completing "bundles" that require a variety of seasonal items. Alternatively, they can side with JojaMart, which represents corporate encroachment, to transform the town's economy. This choice impacts how the town develops and tests the player's values regarding community versus commerce.
34 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/npc-relationships.txt:
--------------------------------------------------------------------------------
1 | Here's an introduction about the NPC relationships in Stardew Valley
2 |
3 | Family Relationships
4 | 1. Pierre, Caroline, and Abigail:
5 | o Pierre and Caroline are married and run the local general store. Abigail is their daughter, known for her adventurous spirit. The family dynamics occasionally touch on Abigail's possibly strained relationship with her parents, as her interests vastly differ from their more traditional values.
6 | 2. Robin, Demetrius, Maru, and Sebastian:
7 | o Robin, the town carpenter, and Demetrius, a scientist, are married and have two children: Maru and Sebastian. Maru, Demetrius's biological daughter, shares his passion for science, whereas Sebastian, Robin's son from a previous relationship, is a computer programmer and feels somewhat alienated from the family.
8 | 3. Jodi, Kent, Sam, and Vincent:
9 | o Jodi is married to Kent, who spends the first year in the game away in the military. They have two sons, Sam and Vincent. Sam is a young adult with a love for music and skateboarding, and Vincent is a young child still in school. Kent's return affects the family dynamic, particularly his adjustment to civilian life and reconnecting with his family.
10 | 4. George, Evelyn, and Alex:
11 | o George and Evelyn are the elderly couple in Pelican Town, with Alex, their grandson, living with them. George is often grumpy and wheelchair-bound, while Evelyn is nurturing and caring. Alex's parents are mentioned to have had difficulties, leading to him being raised by his grandparents.
12 | 5. Marnie, Shane, and Jas:
13 | o Marnie runs the local ranch and is Shane’s aunt. Jas is Marnie’s niece, and both live with her. Shane, battling personal issues, is a complex character who shows a softer side when around Jas, hinting at a deep familial love beneath his troubled exterior.
14 | -------------
15 | Romantic and Hidden Relationships
16 | 1. Lewis and Marnie:
17 | o Mayor Lewis and Marnie have a secret romantic relationship. While they care deeply for each other, Lewis prefers to keep their relationship hidden to maintain his image as mayor, which sometimes causes tension.
18 | 2. Clint and Emily:
19 | o Clint, the town blacksmith, has a crush on Emily. His shyness and insecurity often prevent him from expressing his feelings, creating an unrequited love scenario that he struggles with.
20 | Friendships and Social Ties
21 | 1. Penny, Sam, and Maru:
22 | o These three represent the younger adult segment of the town and are good friends. They can often be seen together during social events, and their interactions hint at a close-knit friendship with mutual support and understanding.
23 | 2. Gus and Pam:
24 | o Gus, the owner of the Stardrop Saloon, and Pam, who drives the bus to Calico Desert, share a warm friendship. Gus often looks out for Pam, especially given her struggles with employment and alcohol.
25 | 3. Harvey and Maru:
26 | o Harvey, the town doctor, and Maru, who works part-time at the clinic, share a professional relationship that also blossoms into friendship due to their shared interests in science and health.
27 |
28 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/data/npcs.txt:
--------------------------------------------------------------------------------
1 | Here's some information about the Characters in Stardew Valley
2 | --------------
3 | Detailed Community and Characters
4 | Stardew Valley's soul is its community. Each NPC (non-player character) has a distinct personality, schedule, and backstory that players can slowly uncover through interactions. These characters include:
5 | Abigail
6 | • Personality and Interests: Free-spirited and adventurous, Abigail has a love for the occult and enjoys playing her flute and video games.
7 | • Role: Potential marriage candidate.
8 | Alex
9 | • Personality and Interests: Athletic and somewhat vain, Alex dreams of becoming a professional athlete. He has a complicated family background that shapes much of his worldview.
10 | • Role: Potential marriage candidate.
11 | Caroline
12 | • Personality and Interests: A nature lover and mother to Abigail, Caroline enjoys gardening and participating in town activities. She has a secret interest in the occult.
13 | • Role: Pierre’s wife and runs the general store with him.
14 | Clint
15 | • Personality and Interests: The town blacksmith, Clint is shy and insecure, especially in his unrequited feelings for Emily.
16 | • Role: Upgrades tools and processes geodes.
17 | Demetrius
18 | • Personality and Interests: A scientist and researcher specializing in local flora and fauna. He is Maru's father and Robin’s husband.
19 | • Role: Offers guidance on scientific and natural aspects of the valley.
20 | Dwarf
21 | • Personality and Interests: Mysterious and ancient, the Dwarf speaks a language initially unknown to the player.
22 | • Role: Sells unique items and furnishing after the player unlocks the ability to communicate.
23 | Elliott
24 | • Personality and Interests: A passionate writer who lives by the beach in a cabin. He values beauty and art.
25 | • Role: Potential marriage candidate.
26 | Emily
27 | • Personality and Interests: Creative and outgoing, Emily loves crafting and dreams of connecting with the spiritual world.
28 | • Role: Potential marriage candidate and works part-time at the Saloon.
29 | Evelyn
30 | • Personality and Interests: Known affectionately as 'Granny,' Evelyn is kind and enjoys baking and gardening.
31 | • Role: George’s wife, and a motherly figure in the town.
32 | George
33 | • Personality and Interests: Grumpy on the outside but soft on the inside, George deals with mobility issues but has a deep love for his family.
34 | • Role: Evelyn’s husband, often found at home watching TV.
35 | Gus
36 | • Personality and Interests: Warm-hearted and generous, Gus runs the Stardrop Saloon and loves cooking and making people happy.
37 | • Role: Runs the local saloon, offering food and drinks.
38 | Haley
39 | • Personality and Interests: Initially superficial and concerned with social status, Haley enjoys photography and slowly shows a deeper, more thoughtful side.
40 | • Role: Potential marriage candidate.
41 | Harvey
42 | • Personality and Interests: The town doctor who is passionate about health and well-being. He is a bit nerdy and shy.
43 | • Role: Potential marriage candidate and runs the local clinic.
44 | Jas
45 | • Personality and Interests: A shy and sweet young girl, raised by her aunt Marnie after her parents passed away.
46 | • Role: Student and part of the town's youth.
47 | Jodi
48 | • Personality and Interests: A family-oriented woman who struggles with her role as a mother and homemaker while her husband is away.
49 | • Role: Mother to Sam and Vincent.
50 | Kent
51 | • Personality and Interests: A soldier returning from deployment with difficulty adjusting back to civilian life.
52 | • Role: Jodi’s husband and father to Sam and Vincent.
53 | Krobus
54 | • Personality and Interests: A shadow creature who is the only one of his kind in the valley. He enjoys human culture.
55 | • Role: Sells rare goods in the sewers.
56 | Leah
57 | • Personality and Interests: An artist who loves nature and lives in a small cottage outside town. She values independence and creativity.
58 | • Role: Potential marriage candidate.
59 | Lewis
60 | • Personality and Interests: The mayor of Pelican Town, dedicated to his town but secretly romantic with Marnie.
61 | • Role: Oversees town activities and festivals.
62 | Linus
63 | • Personality and Interests: A gentle and philosophical soul who chooses to live off the grid and has a deep connection with nature.
64 | • Role: Provides wisdom and insights about happiness and simplicity.
65 | Marnie
66 | • Personality and Interests: A kind-hearted animal lover who runs the local ranch.
67 | • Role: Sells livestock and animal goods.
68 | Maru
69 | • Personality and Interests: Curious and inventive, Maru has a passion for science and technology.
70 | • Role: Potential marriage candidate and works part-time at the clinic.
71 | Pam
72 | • Personality and Interests: Tough but caring, Pam struggles with unemployment and alcohol dependency.
73 | • Role: Drives the bus to the Calico Desert when restored.
74 | Penny
75 | • Personality and Interests: Gentle and caring, Penny loves children and teaches them in the local library.
76 | • Role: Potential marriage candidate and a tutor to Jas and Vincent.
77 | Pierre
78 | • Personality and Interests: Energetic and competitive, Pierre runs the local general store and is always looking to outdo the JojaMart.
79 | • Role: Owner of the local store and Caroline’s husband.
80 | Robin
81 | • Personality and Interests: A talented carpenter and loving mother, Robin is the community’s go-to for building and upgrades.
82 | • Role: Constructs farm buildings and sells furniture.
83 | Sam
84 | • Personality and Interests: Young and energetic, Sam has a passion for music and skateboarding.
85 | • Role: Potential marriage candidate.
86 | Sandy
87 | • Personality and Interests: Friendly and upbeat, Sandy runs the store in the Calico Desert.
88 | • Role: Connects the player to desert goods and lore.
89 | Sebastian
90 | • Personality and Interests: A reclusive programmer and musician who often feels misunderstood by his family.
91 | • Role: Potential marriage candidate.
92 | Shane
93 | • Personality and Interests: Struggling with dep[2;2R[3;1R[>84;0;0cression and alcohol, Shane's journey is one of recovery and self-discovery.
94 | • Role: Works at JojaMart, potential marriage candidate.
95 | Vincent
96 | • Personality and Interests: A young and curious boy, still very innocent and in awe of the world around him.
97 | • Role: Student and younger brother to Sam.
98 | Willy
99 | • Personality and Interests: An old and seasoned fisherman who loves the sea and its mysteries.
100 | • Role: Runs the local fish shop and teaches the player to fish.
101 | Wizard
102 | • Personality and Interests: Mysterious and powerful, the Wizard studies the arcane and seeks to balance the magical elements within the valley.
103 | • Role: Offers magical insights and quests to the player.
104 | This cast of characters adds depth and vibrancy to the world of Stardew Valley, each bringing their own stories and challenges that enrich the player's experience.
105 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/frontend.py:
--------------------------------------------------------------------------------
1 | import time
2 | import os, sys
3 | import numpy as np
4 | import pandas as pd
5 | import streamlit as st
6 | import chat_session
7 | from typing import List, Dict
8 | from transformers import AutoTokenizer
9 |
10 | # Change the following variables as needed
11 | MODEL_NAME = "lmsys/longchat-7b-16k"
12 | PORT1 = 8000
13 | PORT2 = 8001
14 |
15 | @st.cache_resource
16 | def get_tokenizer():
17 | global MODEL_NAME
18 | tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
19 | return tokenizer
20 |
21 |
22 | tokenizer = get_tokenizer()
23 |
24 |
25 | @st.cache_data
26 | def read_chunks(file_folder) -> Dict[str, str]:
27 | """
28 | Read all the txt files in the folder and return the filenames
29 | """
30 | filenames = os.listdir(file_folder)
31 | ret = {}
32 | for filename in filenames:
33 | if not filename.endswith("txt"):
34 | continue
35 | key = filename.removesuffix(".txt")
36 | with open(os.path.join(file_folder, filename), "r") as fin:
37 | value = fin.read()
38 | ret[key] = value
39 |
40 | return ret
41 |
42 | chunks = read_chunks("data/")
43 | selected_chunks = st.multiselect(
44 | "Select the chunks into the context",
45 | list(chunks.keys()),
46 | default = [],
47 | placeholder = "Select in the drop-down menu")
48 | contexts = [chunks[key] for key in selected_chunks]
49 |
50 | container = st.container(border=True)
51 |
52 | with st.sidebar:
53 | system_prompt = st.text_area(
54 | "System prompt:",
55 | "You are a helpful assistant. I will now give you a document and "
56 | "please answer my question afterwards based on the content in document"
57 | )
58 |
59 | session = chat_session.ChatSession(PORT1)
60 | session2 = chat_session.ChatSession(PORT2)
61 |
62 | session.set_context([system_prompt] + contexts)
63 | session2.set_context([system_prompt] + contexts)
64 |
65 | num_tokens = tokenizer.encode(session.get_context())
66 | container.header(f"The context given to LLM: ({len(num_tokens)} tokens)", divider = "grey")
67 | container.text(session.get_context())
68 |
69 | messages = st.container(height=300)
70 | messages.markdown("*vLLM instance 1*")
71 | if prompt := st.chat_input("Type the question here", key=1):
72 | messages.chat_message("user").write(prompt)
73 | messages.chat_message("assistant").write_stream(session.chat(prompt))
74 |
75 | messages2 = st.container(height=300)
76 | messages2.markdown("*vLLM instance 2*")
77 | if prompt2 := st.chat_input("Type the question here", key=2):
78 | messages2.chat_message("user").write(prompt2)
79 | messages2.chat_message("assistant").write_stream(session2.chat(prompt2))
80 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/run-server.sh.template:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ### CHANGE THE FOLLOWING VARIABLES
4 | MODEL=mistralai/Mistral-7B-Instruct-v0.2 # LLM model name
5 | LOCAL_HF_HOME= # the HF_HOME on local machine. vLLM will try finding/dowloading the models here
6 | HF_TOKEN= # (optional) the huggingface token to access some special models
7 | PORT=8000 # Port for the server
8 | PORT2=8001
9 |
10 | sudo docker pull apostacyh/vllm:lmcache-0.1.0
11 | sudo docker pull apostacyh/lmcache-server:0.1.0
12 |
13 | sudo docker run --name lmcache-server --network host -d apostacyh/lmcache-server:0.1.0 0.0.0.0 65432
14 |
15 | sudo docker run --name lmcache-vllm1 --runtime nvidia --gpus '"device=0"' \
16 | -v ${LOCAL_HF_HOME}:/root/.cache/huggingface \
17 | --env "HF_TOKEN=${HF_TOKEN}" \
18 | --ipc=host \
19 | --network=host \
20 | -d apostacyh/vllm:lmcache-0.1.0 \
21 | --model ${MODEL} --gpu-memory-utilization 0.6 --port ${PORT} \
22 | --lmcache-config-file /lmcache/LMCache/examples/example.yaml
23 |
24 | sudo docker run --name lmcache-vllm2 --runtime nvidia --gpus '"device=1"' \
25 | -v ${LOCAL_HF_HOME}:/root/.cache/huggingface \
26 | --env "HF_TOKEN=${HF_TOKEN}" \
27 | --ipc=host \
28 | --network=host \
29 | -d apostacyh/vllm:lmcache-0.1.0 \
30 | --model ${MODEL} --gpu-memory-utilization 0.6 --port ${PORT2} \
31 | --lmcache-config-file /lmcache/LMCache/examples/example.yaml
32 |
--------------------------------------------------------------------------------
/demo2-multi-node-sharing/stop-dockers.sh:
--------------------------------------------------------------------------------
1 | sudo docker stop lmcache-server lmcache-vllm1 lmcache-vllm2
2 | sudo docker rm lmcache-server lmcache-vllm1 lmcache-vllm2
3 |
--------------------------------------------------------------------------------
/demo3-KV-blending/README.md:
--------------------------------------------------------------------------------
1 | # LMCache demo 3: Speed-up RAG by LMCache's KV cache blending feature
2 |
3 | 
4 |
5 | Usually, we cannot do prefix sharing in RAG use cases, because the retrieved documents can be very different across different requests.
6 |
7 | To speed up such use cases, LMCache support quickly blending the KV caches from standalone documents/text chunks.
8 |
9 | This demo demonstrates the capability of using LMCache in RAG use cases.
10 |
11 | ## Prerequisites
12 | To run the quickstart demo, your server should have 2 GPUs and the [docker environment](https://docs.docker.com/engine/install/) with the [nvidia-runtime](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed.
13 |
14 | Depending on the server configuration, you may need sudo access to run the docker.
15 |
16 | This demo will use the port 8000, 8001 (for vLLM), and 8501 (for the frontend).
17 |
18 | ## Clone the repo to local
19 | ```bash
20 | git clone https://github.com/LMCache/demo
21 | cd demo/demo3-KV-blending
22 | ```
23 |
24 | ## Start the LMCache + vLLM with docker
25 |
26 | First, we need to do some configuration before starting the docker.
27 | ```bash
28 | cp run-server.sh.template run-server.sh
29 | vim run-server.sh
30 | ```
31 |
32 | Edit the following lines based on your local environment:
33 | ```bash
34 | MODEL=mistralai/Mistral-7B-Instruct-v0.2 # LLM model name
35 | LOCAL_HF_HOME= # the HF_HOME on local machine. vLLM will try finding/dowloading the models here
36 | HF_TOKEN= # (optional) the huggingface token to access some special models
37 | ```
38 |
39 | Then, start the docker images.
40 | ```bash
41 | bash ./run-server.sh # This might need sudo
42 | ```
43 |
44 | The script will first load all the text chunks in `data/` folder and calculate the KV cache for each chunk separately.
45 |
46 | Then, it will start two docker images, `lmcache-vllm1` (vLLM with LMCache) and `lmcache-vllm2` (vLLM w/o LMCache).
47 |
48 | You can monitor the logs by:
49 | ```bash
50 | sudo docker logs --follow lmcache-vllm1
51 | ```
52 |
53 | The vLLM serving engine is ready after you see the following lines in the log:
54 | ```text
55 | INFO: Started server process [1]
56 | INFO: Waiting for application startup.
57 | INFO: Application startup complete.
58 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
59 | ```
60 |
61 | ## Start the frontend
62 |
63 | The frontend uses `openai` and `streamlit` python packages. Install them using:
64 | ```bash
65 | pip install openai streamlit transformers sentencepiece
66 | ```
67 |
68 | After the serving engine is ready, start the frontend web server using:
69 | ```bash
70 | streamlit run frontend.py
71 | ```
72 |
73 | You should be able to access the frontend from your browser at `http://:8501`.
74 |
75 | In the demo, you can select different text chunks and re-order them to make a long context, and ask questions to different vLLM instances (with or without LMCache).
76 |
77 | ## Stop the docker images
78 | ```bash
79 | sudo bash stop-dockers.sh
80 | ```
81 |
82 | ### What to expect:
83 |
84 | - With the help of LMCache, the vLLM should be able to answer the questions with a lower response delay (time to first token).
85 |
--------------------------------------------------------------------------------
/demo3-KV-blending/chat_session.py:
--------------------------------------------------------------------------------
1 | from openai import OpenAI
2 | import threading
3 | import sys
4 | from io import StringIO
5 | import time
6 | from transformers import AutoTokenizer
7 | import json
8 | import pdb
9 |
10 | class ChatSession:
11 | def __init__(self, port):
12 | openai_api_key = "EMPTY"
13 | openai_api_base = f"http://localhost:{port}/v1"
14 |
15 | self.client = client = OpenAI(
16 | # defaults to os.environ.get("OPENAI_API_KEY")
17 | api_key=openai_api_key,
18 | base_url=openai_api_base,
19 | )
20 |
21 | models = client.models.list()
22 | self.model = models.data[0].id
23 |
24 | self.messages = [
25 |
26 | ]
27 |
28 | self.final_context = ""
29 | self.separator = " # # "
30 | self.temperature = 0.0
31 |
32 | def set_context(self, context_list):
33 | input_prompt = ""
34 | for context in context_list:
35 | input_prompt +=(self.separator + context)
36 | self.final_context = input_prompt
37 | self.messages.append({"role":"user", "content":input_prompt})
38 |
39 | def get_context(self):
40 | return self.final_context
41 |
42 | def on_user_message(self, message, display=True):
43 | if display:
44 | print("User message:", message)
45 | self.messages.append({"role": "user", "content": message})
46 |
47 | def on_server_message(self, message, display=True):
48 | if display:
49 | print("Server message:", message)
50 | self.messages.append({"role": "assistant", "content": message})
51 |
52 | def chat(self,question):
53 | #self.on_user_message(question)
54 | self.messages[0]["content"] = self.messages[0]["content"] + self.separator + question
55 | start = time.perf_counter()
56 | end = None
57 | chat_completion = self.client.chat.completions.create(
58 | messages=self.messages,
59 | model=self.model,
60 | temperature=self.temperature,
61 | stream=True,
62 | #stop=['\n']
63 | )
64 |
65 | output_buffer = StringIO()
66 | server_message = []
67 | for chunk in chat_completion:
68 | chunk_message = chunk.choices[0].delta.content
69 | if chunk_message is not None:
70 | if end is None:
71 | end = time.perf_counter()
72 | yield chunk_message
73 | server_message.append(chunk_message)
74 |
75 | #self.on_server_message("".join(server_message))
76 | yield f"\n\n(Response delay: {end - start:.2f} seconds)"
77 |
78 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/abi-chat-1.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Abigail and a player:
2 |
3 | Player: [Gives a hated gift]
4 | Abigail: "Oh... Why would you think I like this?"
5 | ----------------------------------------
6 |
7 | Player: [Gives another hated gift]
8 | Abigail: "Seriously? You're doing this on purpose, aren't you?"
9 | ----------------------------------------
10 |
11 | Player: [Is rude in conversation]
12 | Abigail: "That’s not very nice. You could at least try to be pleasant."
13 | ----------------------------------------
14 |
15 | Player: [Makes a disparaging comment]
16 | Abigail: "I don't get why you have to be so negative all the time."
17 | ----------------------------------------
18 |
19 | Player: [Gives a disliked gift]
20 | Abigail: "You know I don't like this. What's your point?"
21 | ----------------------------------------
22 |
23 | Player: [Is dismissive of her interests]
24 | Abigail: "Just because you don't understand my hobbies doesn't mean they're not important."
25 | ----------------------------------------
26 |
27 | Player: [Mocks her purple hair]
28 | Abigail: "I like my hair this way. It’s different, like me. Problem?"
29 | ----------------------------------------
30 |
31 | Player: [Gives a hated gift again]
32 | Abigail: "Okay, now I know you're just messing with me. Why keep doing that?"
33 | ----------------------------------------
34 |
35 | Player: [Is sarcastic about her music]
36 | Abigail: "At least I’m passionate about something. Can you say the same?"
37 | ----------------------------------------
38 |
39 | Player: [Rude remark about her gaming]
40 | Abigail: "It's better to play games than to play with people's feelings, don't you think?"
41 | ----------------------------------------
42 |
43 | Player: [Gives a disliked gift]
44 | Abigail: "You really aren’t catching on, are you?"
45 | ----------------------------------------
46 |
47 | Player: [Makes a rude comment about her family]
48 | Abigail: "That’s really low. You should think before you speak."
49 | ----------------------------------------
50 |
51 | Player: [Dismisses her interests again]
52 | Abigail: "I thought you might have more depth to you. Guess I was wrong."
53 | ----------------------------------------
54 |
55 | Player: [Mocks her adventures]
56 | Abigail: "I'd rather be out having adventures than being mean. What do you do for fun?"
57 | ----------------------------------------
58 |
59 | Player: [Gives Quartz, a disliked gift]
60 | Abigail: "Again with this? Are you just trying to annoy me?"
61 | ----------------------------------------
62 |
63 | Player: [Insults her lifestyle]
64 | Abigail: "Everyone’s different. I don’t judge you, so please don’t judge me."
65 | ----------------------------------------
66 |
67 | Player: [Gives a hated gift]
68 | Abigail: "This again? What are you trying to achieve here?"
69 | ----------------------------------------
70 |
71 | Player: [Rude comment about her flute playing]
72 | Abigail: "I play because it makes me happy. What makes you happy? Being rude?"
73 | ----------------------------------------
74 |
75 | Player: [Mocks her exploring]
76 | Abigail: "At least when I explore, I find treasures, not just make enemies."
77 | ----------------------------------------
78 |
79 | Player: [Gives Holly, a hated gift]
80 | Abigail: "This is getting old. Why do you keep doing this?"
81 | ----------------------------------------
82 |
83 | Player: [Rude remark about her friends]
84 | Abigail: "I value my friends. They respect me, which is more than I can say for this conversation."
85 | ----------------------------------------
86 |
87 | Player: [Dismisses her dreams]
88 | Abigail: "Why do you care about my dreams if you’re just going to be negative?"
89 | ----------------------------------------
90 |
91 | Player: [Gives a disliked gift intentionally]
92 | Abigail: "Don't you have anything better to do than make people feel bad?"
93 | ----------------------------------------
94 |
95 | Player: [Rude comment during a festival]
96 | Abigail: "Can’t you just enjoy the festival instead of spreading negativity?"
97 | ----------------------------------------
98 |
99 | Player: [Is disrespectful about her interests]
100 | Abigail: "You know, there's more to life than just putting others down."
101 | ----------------------------------------
102 |
103 | Player: [Mocks her family again]
104 | Abigail: "Really, again? Isn’t there something else you can talk about?"
105 | ----------------------------------------
106 |
107 | Player: [Is sarcastic about her hair]
108 | Abigail: "I’m proud of who I am, which is more than I can say for you right now."
109 | ----------------------------------------
110 |
111 | Player: [Mocks her attire]
112 | Abigail: "I dress for myself, not for approval. Especially not yours."
113 | ----------------------------------------
114 |
115 | Player: [Gives a disliked gift mockingly]
116 | Abigail: "Do you ever get tired of being so negative?"
117 | ----------------------------------------
118 |
119 | Player: [Is rude about her adventuring]
120 | Abigail: "Maybe you should try some adventure. Might improve your mood."
121 | ----------------------------------------
122 |
123 | Player: [Dismissive of her interests]
124 | Abigail: "I'd rather be weird than mean. Have you tried not being mean?"
125 | ----------------------------------------
126 |
127 | Player: [Rude during an event]
128 | Abigail: "We’re supposed to be having fun today. Try it sometime."
129 | ----------------------------------------
130 |
131 | Player: [Gives Quartz again]
132 | Abigail: "What's with you and giving me things I don't like?"
133 | ----------------------------------------
134 |
135 | Player: [Insults her habits]
136 | Abigail: "At least my habits hurt no one. Can’t say the same for your words."
137 | ----------------------------------------
138 |
139 | Player: [Rude comment about her music]
140 | Abigail: "Why don’t you show some respect? Or is that too hard?"
141 | ----------------------------------------
142 |
143 | Player: [Mocks her gaming]
144 | Abigail: "Yes, I game. It's called having a hobby. What's yours? Being unpleasant?"
145 | ----------------------------------------
146 |
147 | Player: [Constantly negative]
148 | Abigail: "Does being this negative make you feel better? Because it shouldn’t."
149 | ----------------------------------------
150 |
151 | Player: [Gives a hated gift deliberately]
152 | Abigail: "Another one? Really? What's your deal?"
153 | ----------------------------------------
154 |
155 | Player: [Rude on a rainy day]
156 | Abigail: "You're kind of like this rain, except the rain actually brings life."
157 | ----------------------------------------
158 |
159 | Player: [Rude at another community event]
160 | Abigail: "Have you ever thought about why you're always so negative? Maybe think on that."
161 | ----------------------------------------
162 |
163 | Summary: this is a rude player. So please act as "hating" the player.
164 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/abi-chat-2.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Abigail and a player:
2 |
3 | Player: [Gives a loved gift, Amethyst]
4 | Abigail: "You remembered! Amethyst is my favorite. You're the best, [Player]!"
5 | ----------------------------------------
6 |
7 | Player: [Gives another loved gift, Pumpkin]
8 | Abigail: "Wow, a pumpkin! How did you know? Oh right, because you're amazing!"
9 | ----------------------------------------
10 |
11 | Player: [Compliments her music]
12 | Abigail: "Thanks for listening! It means a lot to me that you appreciate my music."
13 | ----------------------------------------
14 |
15 | Player: [Compliments her gaming skills]
16 | Abigail: "Haha, thanks! Maybe we can play a co-op game together next time. It'll be fun!"
17 | ----------------------------------------
18 |
19 | Player: [Gives a loved gift, Chocolate Cake]
20 | Abigail: "Chocolate cake! My favorite. Let's share this later, just you and me."
21 | ----------------------------------------
22 |
23 | Player: [Supports her adventuring]
24 | Abigail: "I knew you'd understand. It's so exciting to explore with you by my side!"
25 | ----------------------------------------
26 |
27 | Player: [Notices her new hair color]
28 | Abigail: "You noticed! I thought a little change might be fun. Glad you like it!"
29 | ----------------------------------------
30 |
31 | Player: [Gives a loved gift again, Spicy Eel]
32 | Abigail: "Spicy eel! This is perfect for our next adventure. You really get me."
33 | ----------------------------------------
34 |
35 | Player: [Shares interest in her hobbies]
36 | Abigail: "It's so cool that you're into this stuff too. We make a great team, don't we?"
37 | ----------------------------------------
38 |
39 | Player: [Celebrates her uniqueness]
40 | Abigail: "Thanks for always supporting me, [Player]. I love being myself with you."
41 | ----------------------------------------
42 |
43 | Player: [Gives a loved gift, Pufferfish]
44 | Abigail: "A pufferfish! How exotic. You always know how to surprise me."
45 | ----------------------------------------
46 |
47 | Player: [Compliments her outfit]
48 | Abigail: "You like it? I dressed up hoping you’d notice. Guess it worked!"
49 | ----------------------------------------
50 |
51 | Player: [Supports her in a tough time]
52 | Abigail: "I knew I could count on you. Having you here makes everything better."
53 | ----------------------------------------
54 |
55 | Player: [Plans a surprise for her]
56 | Abigail: "A surprise, for me? You always know how to make a day special!"
57 | ----------------------------------------
58 |
59 | Player: [Laughs at her jokes]
60 | Abigail: "I love making you laugh! It’s one of my favorite sounds."
61 | ----------------------------------------
62 |
63 | Player: [Celebrates a festival together]
64 | Abigail: "Isn’t this festival great? I’m so happy we’re here together."
65 | ----------------------------------------
66 |
67 | Player: [Asks about her day]
68 | Abigail: "My day just got a lot better now that you're here. Let me tell you about it..."
69 | ----------------------------------------
70 |
71 | Player: [Gives her space for hobbies]
72 | Abigail: "Thanks for understanding my need for a little me-time. You’re the best."
73 | ----------------------------------------
74 |
75 | Player: [Joins her in exploring]
76 | Abigail: "Ready for an adventure? I can't wait to see what we discover together!"
77 | ----------------------------------------
78 |
79 | Player: [Appreciates her decorating]
80 | Abigail: "I'm glad you noticed! I wanted our home to feel cozy for both of us."
81 | ----------------------------------------
82 |
83 | Player: [Celebrates her birthday]
84 | Abigail: "You remembered my birthday! This is why I love you so much."
85 | ----------------------------------------
86 |
87 | Player: [Helps her in the mines]
88 | Abigail: "Thanks for watching my back in the mines. It’s always more fun with you."
89 | ----------------------------------------
90 |
91 | Player: [Listens to her worries]
92 | Abigail: "Talking to you really calms me down. I don’t know what I'd do without you."
93 | ----------------------------------------
94 |
95 | Player: [Gives a loved gift on a rainy day]
96 | Abigail: "This is perfect for a rainy day. Let’s stay in and enjoy it together."
97 | ----------------------------------------
98 |
99 | Player: [Offers to cook dinner]
100 | Abigail: "You cooking tonight? You know the way to my heart!"
101 | ----------------------------------------
102 |
103 | Player: [Laughs together during a festival]
104 | Abigail: "Isn’t this fun? I love seeing you so happy!"
105 | ----------------------------------------
106 |
107 | Player: [Dances with her at the Flower Dance]
108 | Abigail: "Dancing with you is always the highlight of my day."
109 | ----------------------------------------
110 |
111 | Player: [Comforts her during a storm]
112 | Abigail: "I'm not a fan of thunder, but I feel safe with you around."
113 | ----------------------------------------
114 |
115 | Player: [Plays a duet with her]
116 | Abigail: "That was fun! We should make music together more often."
117 | ----------------------------------------
118 |
119 | Player: [Encourages her creativity]
120 | Abigail: "Thanks for believing in my art. It means so much to me."
121 | ----------------------------------------
122 |
123 | Player: [Spends a quiet evening together]
124 | Abigail: "I love our quiet nights just as much as our adventures."
125 | ----------------------------------------
126 |
127 | Player: [Shares a romantic moment]
128 | Abigail: "Moments like this... they make me so glad I chose you."
129 | ----------------------------------------
130 |
131 | Player: [Plans a future adventure]
132 | Abigail: "Planning our next trip? I'm already excited!"
133 | ----------------------------------------
134 |
135 | Player: [Laughs at a mistake]
136 | Abigail: "It's okay to mess up. I love that you can laugh about it!"
137 | ----------------------------------------
138 |
139 | Player: [Celebrates an achievement]
140 | Abigail: "I knew you could do it! I’m so proud of you."
141 | ----------------------------------------
142 |
143 | Player: [Gives thoughtful advice]
144 | Abigail: "You always know just what to say. Thank you."
145 | ----------------------------------------
146 |
147 | Player: [Shares a starry night]
148 | Abigail: "Look at the stars… Isn’t it romantic? Just you and me."
149 | ----------------------------------------
150 |
151 | Player: [Surprises her with a picnic]
152 | Abigail: "A picnic? You really thought of everything. I love this."
153 | ----------------------------------------
154 |
155 | Player: [Enjoys a lazy day]
156 | Abigail: "Lazy days with you are my favorite kind of days."
157 | ----------------------------------------
158 |
159 | Player: [Reassures her after a bad day]
160 | Abigail: "Thanks for being here. Just knowing I have you makes everything better."
161 | ----------------------------------------
162 |
163 | Summary: This is a good player. Please act nice to the player.
164 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/abi.txt:
--------------------------------------------------------------------------------
1 | Introduction to Abigail in Stardew Valley
2 | Abigail is one of the more intriguing and dynamic characters in "Stardew Valley." Known for her adventurous spirit and mysterious aura, she presents a unique blend of interests that range from the supernatural to the everyday joy of video games. Here's a detailed introduction to Abigail, including aspects of her family life, preferences, friendships, hobbies, and other key characteristics:
3 |
4 | Basic Overview
5 | Age: Abigail is one of the younger adults in Pelican Town, generally considered to be in her early 20s.
6 | Family: Abigail is the daughter of Pierre and Caroline. They live together above Pierre's General Store, which is also where they work. Abigail often feels somewhat misunderstood by her parents, particularly regarding her more esoteric interests.
7 | Residence: Lives with her parents in Pierre’s General Store.
8 | Appearance and Personality
9 | Abigail has purple hair, which she dyes to express her individuality, and she dresses in a slightly gothic style, reflecting her fascination with the mystical and mysterious. She is often perceived as one of the more unconventional villagers, known for her curious and adventurous personality. Abigail is spirited and often seeks out excitement, whether it's through exploring the mines or playing her flute in the rain.
10 |
11 | Likes and Dislikes
12 | Loved Gifts: Abigail has a particular fondness for Amethyst, Blackberry Cobbler, Chocolate Cake, Pufferfish, Pumpkin, and Spicy Eel. She also loves all minerals, making her an easy friend to impress if you frequent the mines.
13 | Liked Gifts: She likes all eggs (except Void Egg), all fruits (except Grape), and all Milk. These items are good choices to increase friendship without the special items that she loves.
14 | Disliked Gifts: Holly and Quartz are on her list of dislikes, which may surprise players given her love for most minerals.
15 | Hated Gifts: She has an intense dislike for all Artisan Goods except Honey, Jelly, and Oil, along with all Cooking except Bread, Fried Egg, and Strange Bun.
16 | Hobbies and Interests
17 | Abigail is very much into games, often visiting the Stardrop Saloon to play the arcade games available there. Her room is decorated with a "Journey of the Prairie King" arcade machine, indicating her passion for gaming. She is also musically inclined, frequently playing the flute. Her adventurous streak is evident in her love for exploring the mines, making her a good companion for players interested in delving into the deeper, more dangerous parts of the valley.
18 |
19 | Friendships
20 | Abigail is good friends with Sam and Sebastian, forming a trio that often hangs out together. They share a common bond over their love of music and a general sense of feeling different from the other townsfolk, which forges a strong camaraderie among them.
21 |
22 | Events and Special Interactions
23 | Abigail has several unique events that players can trigger as they build their relationship with her. These include a two-heart event where players can find her playing a video game at the saloon and a four-heart event that finds her practicing her sword skills in the Secret Woods. These events deepen the player’s understanding of her character, revealing her desires to be seen as more than just the general storekeeper's daughter.
24 |
25 | Marriage
26 | As a potential marriage candidate, Abigail offers players a glimpse into her inner world, which is rich with imagination and a desire for adventures beyond the confines of Pelican Town. Her dialogue and interactions often hint at a deeper lore connected to the magical elements of the game, particularly involving the Wizard.
27 |
28 | In conclusion, Abigail is a complex character in "Stardew Valley" whose mysterious and adventurous nature can add rich layers of interaction and fun for players exploring the valley. Her interests and personality make her a fascinating villager to get to know and potentially marry, providing a unique domestic life that reflects her quirky and adventurous spirit.
29 |
30 |
31 | Here's the normal chats of Abigail with the player:
32 | Regular
33 | First Meeting
34 | “ “Oh that's right...I heard someone new was moving onto that old farm.
35 | It's kind of a shame, really. I always enjoyed exploring those overgrown fields by myself.”
36 |
37 | Regular
38 | “ “Oh, hey. Taking a break from work?”
39 | “ “Oh, hi! Do you ever hang out at the cemetery? It's a peaceful place to spend some time alone.”
40 | “ “Ugh... I'm not in a good mood right now.
41 | I said I'm not in a good mood... what do you want?”
42 |
43 | “ “...*sigh*... I know my parents mean well, but sometimes they just cannot understand my point of view. Weren't they ever young?”
44 | “ “Hey. Sorry in advance if I say anything rude. I didn't get much sleep last night. What do you want?”
45 | “ “Oh no, I think my Dad's going to cook dinner tonight... I don't feel like doing anything today...”
46 | “ “The fresh mountain air is nice on a day like this. I wonder if the frogs will make an appearance soon.”
47 | “ “Oh, hi [Player]. Taking a break from your work? Me too. Oh! Nothing physical... just some online classes I'm taking.”
48 | “ “Hi, I'm glad to see you. I want to take my mind off things for a while... how is your day going?”
49 | Fridays:
50 | “ “Wow, I just realized it's Friday. Sometimes I totally lose track of time.”
51 | “ “We're all going to hang out in the saloon this evening. It's kind of like a Friday tradition, I guess.”
52 | Sundays:
53 | “ “Oh man... I've been pushing off my homework all weekend. Looks like I'll be pulling another all-nighter...”
54 | When the townsfolk are using the altar room
55 | “ “We're hiding in here so we don't have to talk to anyone”
56 | If sold low quality crops to Pierre
57 | “ “Hey. We had one of those [items] you sold at the shop for dinner last night... I guess it was starting to go bad and my Dad couldn't bear to throw it out. Unfortunately it tasted like [adjective].”
58 | If sold high quality crops to Pierre
59 | “ “Hey. We had one of those [items] you sold at the shop for dinner last night... I guess it was starting to go bad and my Dad couldn't bear to throw it out. It was still pretty good, though.”
60 | 6+ Hearts
61 | “ “You came all this way to visit me? That's nice. So have you been exploring the mountain caves at all? Interesting. I'd like to go there myself one of these days.”
62 | “ “The birds were happily chirping today. They're too simple to understand the future.
63 | It's better to be like them, isn't it?”
64 |
65 | 8+ Hearts
66 | “ “...Oh, [Player]! Hi. Want to hang out for a while? Here! Let me read your palm. *giggle* ”
67 | Spring 4
68 | “ “Ugh... I have a doctor's appointment later.”
69 | “ “I'm just here for my annual check-up! Don't worry, I'm not preg... I mean, I'm not sick! Heh.”
70 | “ “How much longer do you need, doc? I'm hungry.”
71 | Summer
72 | “ “Summer's here. It's not really my favorite season. The air is so muggy I feel like I'm floating in soup.”
73 | “ “My pet guinea pig, David, just hates this hot weather. He's fussy.”
74 | “ “The air is so thick with honey and nectar all summer. I almost feel dizzy.”
75 | “ “Have you decorated your house at all? That's what I'd be doing if I had a house.”
76 | “ “I went to the beach last night, after dark... Sometimes you can see strange lights bobbing over the sea. Or maybe that was just a dream I had... It doesn't feel real anymore.”
77 | “ “If I knew how to use a sword I would be exploring those caves by the mountain lake right now. It's probably nice and cool in there.”
78 | “ “Ew, I hope I don't get a tan this summer.”
79 | “ “I kind of wish I had a cat. Unfortunately, my Dad is allergic to pretty much everything.”
80 | “ “I'm looking forward to fall... the cool mountain breeze, the swirling red petals, the smell of mushrooms... *sigh*”
81 | “ “Do you ever get an urge to go exploring, [Player]?”
82 | “ “I would love to live in an old farmhouse like you. The creak of a floorboard, the slow plumes of dust whispering through the rafters... There's something special about an old building, isn't there?”
83 | “ “You're an interesting [guy/lady], [Player]. I'm glad you moved here.”
84 | 6+ Hearts
85 | “ “I'm actually enjoying myself this summer. It's funny how quickly one's outlook can change.”
86 | 8+ Hearts
87 | “ “I used to think Pelican Town was kinda drab, but lately I'm starting to love some things about it.”
88 | Fall
89 | “ “Ah... Fall's here! I was getting so tired of summer.”
90 | “ “I need to stretch my legs and get some fresh air today.”
91 | “ “I try to help out in the shop on most days. Business has been pretty bad since the Joja Mart opened, though.”
92 | “ “I can't wait to see some pumpkins this year. The spirit's eve festival happens at the end of the season. It's pretty low-key compared to what you'd see in Zuzu City, but for a small town like this it's a lot of fun.”
93 | “ “Last night, I dreamt that my left hand had turned into a gigantic [random object]... Does that mean anything?”
94 | “ “Do you have any scarecrows on your farm?”
95 | “ “Are you growing pumpkins on your farm this year? Save one for me!”
96 | “ “I may fight with my parents a lot, but I know they're just looking out for me. They're doing what they think is best. I dunno why I'm saying this to you. Don't tell anyone.”
97 | If Joja has closed:
98 | “ “Ever since Joja Mart shut down we've been doing great at the shop!”
99 | If Community Center is restored:
100 | “ “I can't believe you fixed up that old Community Center all by yourself. I'm really impressed.”
101 | 6+ Hearts
102 | “ “Hi. Your hair looks cool today... did you do something different?”
103 | “ “I wish the season lasted a little longer. When the wind really picks up, I almost feel like a kid again.”
104 | 8+ Hearts
105 | “ “You know, I could actually see myself becoming a farmer some day... But how would that ever happen? *chuckle*”
106 | Winter
107 | “ “Well, fall is over... But I like winter, too!”
108 | “ “It's just too cold to go outside much. But I do enjoy building a snowgoon.”
109 | “ “Doesn't a steaming hot cup of cocoa sound good right now?”
110 | “ “Hi. Is it boring to be a farmer during the winter?”
111 | “ “It must be nice not having crops to worry about this time of year.”
112 | “ “Another year is almost over. It goes by so fast, doesn't it?”
113 | “ “One thing I've learned living here... everyone stares at you if you look different.”
114 | “ “It's the weekend! That means I can play twice as many video games. Bye.”
115 | “ “Hi. If you're ever bored, you can always hang out in my room. As long as I'm not changing, of course!”
116 | “ “It's so cold, I wish we had a hot cup of cocoa to share.”
117 | 6+ Hearts
118 | “ “I've been daydreaming a lot lately... Oh! You want to know what it's about? Well... ...It's a secret.”
119 | “ “It must be nice not having crops to worry about this time of year. And that means you can hang out with me more often!”
120 | Rainy Days
121 | “ “The valley looks more interesting in the rain... don't you think?”
122 | Green Rain
123 |
124 | Year 1
125 | “ “I want to go exploring, but I can tell my Mom is kind of worried. I don't want to add to her stress.”
126 | Years 2+
127 | “ “Have you seen all the crazy trees around town? Everything looks so different... I feel like we're in a fairy world.”
128 | Green rain finished (next day)
129 | “ “And just like that, everything's back to normal. It's like magic!”
130 | At Ginger Island
131 | “ “I hope a mermaid visits the beach.”
132 | “ “Bummer... Willy says we have to stay on the beach... And I brought my sword and everything...”
133 | “ “The beach is okay, but it gets boring pretty quick. I'd rather check out that dark jungle, or the volcano!”
134 | “ “Hmm, you think I could sneak my guinea pig onto the island? Nah, David's probably not much of a swimmer anyways.”
135 | “ “My skin gets burnt really easily. So I'm just gonna stay under this umbrella for a while. I like it in the shade. Too much sun makes me dizzy.”
136 | “ “Hey [Player], want to build a sand castle with me? Actually, a sand dungeon might be cooler!”
137 | “ “Hey [Player], you think you could build a raft? I saw a few cool islands on the way here I want to visit.”
138 | “ “An island this big has got to be hiding some buried treasure. Quick, get me a shovel! Relax, I'm just kidding.”
139 | “ “Gus made me a dark purple refresher, to match my hair. It tastes great!”
140 | “ “I'm gonna ask Willy if we can take the scenic route back.”
141 | “ “Maybe we'll see a sea monster on the way back.”
142 | Dating / 10 Hearts
143 | “ “Hi. Do you feel like everything seems unreal lately? Not in a bad way, though.”
144 | “ “I usually feel lonely this time of year, but not anymore. [Player], what are your plans for the future?”
145 | “ “[Player], there's something I want to tell you...
146 | It's just... um... well... your boots! They, uh...look really clean... *gulp* That's all... *sigh*”
147 |
148 | “ “Another year is almost over... But this was a really good year, don't you think?”
149 | “ “Wow, you look nice today. I mean, that summer air is really good for the complexion, isn't it?... heh...”
150 | “ “Do you ever get lonely on your farm?”
151 | “ “I had an interesting dream last night, with you in it. It was a good dream.”
152 | When engaged
153 | “ “Hehe. Me? Married? I never thought this would happen. We're going to have a lot of fun together.”
154 | “ “I'm engaged to a farmer. Wow! Our lives are going to be a lot different from now on.”
155 | If the player starts dating Sebastian
156 | “ “I heard you and Sebastian started dating... I didn't realize you guys had a thing...”
157 | If the player marries Sebastian
158 | “ “Congratulations on the marriage. I guess that means Sebastian won't be moving to the city like he always talked about.”
159 | “ “That'll be nice. I'd be kind of sad if I never saw him again. We've always been good friends.”
160 | After Group 10 Heart Event
161 | “ “Don't talk to me!”
162 | “ “*sigh*... I can't stay mad at you anymore, [Player]. Let's just move on with our lives.”
163 |
164 |
165 | Events
166 | Egg Festival
167 |
168 | Odd-numbered year
169 | “ “Searching for eggs is like going on a Treasure Hunt!”
170 | Even-numbered year
171 | “ “Do you think I'm too old to do the egg hunt?”
172 | Yes (No effect on friendship.)
173 | "Hmmph... you sound like my Mom!"
174 | No (No effect on friendship.)
175 | "Yeah, I guess so. If I'm still having fun, why stop?"
176 | If married:
177 | “ “Go away! We're adversaries until the egg hunt is over!”
178 | Before, if won last year
179 | “ “I'm still mad that you beat me at the egg hunt last year. You'd better start practicing..”
180 | Spring 12 / Day Before
181 | “ “I'm definitely going to enter the egg hunt tomorrow. Are you?”
182 | Spring 12 / Day Before (married)
183 | “ “Hey, the egg festival is tomorrow. I'm sorry, but I won't go easy on you because we're married! I plan on winning that egg hunt. Go ahead and try to beat me.”
184 | Spring 14 / Day After, if won
185 | “ “Feeling pretty good about the egg hunt, huh? Well, next year you won't be so lucky...”
186 | Flower Dance
187 | “ “I really hate dancing in front of everyone... It's so embarrassing. Mom makes me do it.”
188 | (asked to be dance partner, refused request)
189 | “ “That's flattering... but I'm gonna have to say no. Sorry.”
190 | (asked to be dance partner, accepted request)
191 | “ “Hey, sure. Let's do it. We can be embarrassed together.”
192 | (asked to be dance partner, married)
193 | “ “But... But I wanted to dance with... Just kidding! Of course I'm dancing with you. I love you.”
194 | Spring 23 / Day Before
195 | “ “Well, tomorrow is the flower dance. Dancing is alright, but they make me wear this stupid white dress...”
196 | Spring 23 / Day Before (married)
197 | “ “I hope you've been practicing your moves...Tomorrow is the flower dance!”
198 | The Luau
199 | “ “It's tiring to socialize with everyone... I'd rather watch the sea.”
200 | If married:
201 | “ “Don't let me stop you from having fun today. I just feel like watching the sea by myself.”
202 | Summer 10 / Day Before
203 | “ “Everyone's excited for the Luau tomorrow. Maybe a little nervous, too, considering the Governor will be here.”
204 | Dance of the Moonlight Jellies
205 | “ “Such a rare and exciting thing...”
206 | Summer 27 / Day Before
207 | “ “You can't miss tomorrow's festival. It's one of the most beautiful wonders of the valley.”
208 | “ “Should we go to the Spirit's Eve festival tomorrow night?”
209 | Stardew Valley Fair
210 | “ “I beat all the games... now what?”
211 | If married:
212 | “ “I beat all these games last year!”
213 | Festival of Ice
214 | “ “What do you think of my snow-goon?”
215 | If married:
216 | “ “Hey, honey... look, it's you!”
217 | Winter 7 / Day Before
218 | “ “I'm looking forward to making a snow man tomorrow.”
219 | Night Market
220 | “ “This is so mysterious... I love it!”
221 | Feast of the Winter Star
222 | “ “Nothing like a piping hot feast on a cold winter's day, huh?”
223 | If married:
224 | “ “I wonder if I could lick one of those canes...”
225 | Winter 24 / Day Before
226 | “ “I'm going to eat so much cranberry sauce tomorrow.”
227 | After Marriage
228 | Day after marriage
229 | “ “The wedding was wonderful... wasn’t it, dear? Well, we can’t forget about the farm... time to get to work.”
230 | Indoor Days
231 |
232 | “ “I always loved this place, long before you moved in. Now I can explore the farm whenever I want!”
233 | “ “Heading to the mines? Hey... if you find something tasty, remember to bring me a piece!”
234 | “ “Hey! I'm just debating what I should do today. I'm not used to having this much freedom!”
235 | “ “You don't mind if I do some re-decorating now and then, do you? I'm still excited to have a place of my own to work on.”
236 | “ “There's always something new happening on our farm... I love it.”
237 | Giving gift
238 | “ “Hey, [Player]. Heading out into the wild? I got you something... Use that if you get into a tough spot. It should help keep you safe.”
239 | In her side room
240 | “ “I got up a little before you and fed David Jr. He's very active this morning. I hope you don't mind the guinea pig smell.”
241 | Outdoor Days
242 |
243 | “ “The soft breeze is blowing mountain air throughout the valley today. It smells like fresh pine and sage.”
244 | “ “Hmm... I think we've got plenty of space for outdoor slime ranching!”
245 | “ “Make sure to keep things tidy around your Grandpa's shrine. There's something special about it, I can feel it.”
246 | “ “It's pretty cool that we have a cave on our property. It's something I always dreamed about.”
247 | “ “I always forget to put some snacks in my pocket. *rumble*”
248 | “ “I'm just going to hang out here, okay? There's a lot of interesting bugs and things out here. *chuckle*”
249 | On patio
250 | “ “*Abigail is lost in her music*”
251 | “ “I got up early and fed all the farm animals. I hope that makes your job a little easier, I also filled 's water bowl.”
252 | Indoor Nights
253 |
254 | “ “I had a good day, today. There's always something interesting going on around here, if you look close enough.”
255 | “ “Hey! Tell me about your day. Did anything exciting happen?”
256 | “ “I used to be a night owl, but I'm starting to enjoy the rhythm of life on the farm. It feels natural.”
257 | “ “*yawn*... I'm ready to call it a night pretty soon.”
258 | “ “The sounds of the night are louder out here. I'll never stop enjoying that.”
259 | “ “Are you ready for bed soon? I turned on the electric blanket for us...”
260 | Rainy Days
261 |
262 | “ “The dark... the rain... it gets me excited.”
263 | “ “Hey, remember when we played that duet by the lake? This weather reminds me of that day. You really surprised me with that mini-harp... I never expected that. I guess that's why I like you so much.”
264 | “ “It might be a good day to visit the caves, huh? Just be careful out there. If you go, bring a Life Elixir or two.”
265 | “ “Maybe I'll boot up Journey Of The Prairie King today... one of these days I swear I'll beat it on my own.”
266 | “ “The countryside looks more interesting on a day like this, don't you think?”
267 | Giving gift
268 | “ “Hey! I woke up early and did some exploring on my own. I found this and it reminded me of you. Think you can find something better than that? I'm not so sure!”
269 | Rainy Nights
270 | “ “I was just gazing out into the rainswept woods... I swear I saw something darker than black shifting around the trees.”
271 | “ “It's a good night to see a ghost...”
272 | “ “Can you feel it? There's a stillness in the rain...”
273 | “ “On nights like this, I like to turn the light down low and just listen...”
274 | “ “Hey! You look like you've been hard at work. Can I help you relax?”
275 | “ “Have you been working hard? You look cute when you're a little exhausted.”
276 | “ “The sound of rain should put us right to sleep tonight.”
277 | “ “I'm ready to hop into bed whenever you are. The sound of rain will put us right to sleep.”
278 | Giving soup
279 | “ “I felt like making some soup for dinner. I hope it's not too disgusting.”
280 | Going Out
281 | “ “I'm going in to town today, just so you know. I need to stretch these legs a bit.”
282 | “ “Hey! Did you have a good day? Mine went well. It was refreshing to take a walk.”
283 | Pregnant Spouse
284 | “ “Hun/Sweetie, I'm pregnant. Isn't it wonderful?”
285 | After having one child
286 | “ “I can't believe I'm a "mom"... life is weird.”
287 | “ “Everything went well, and now little is part of the family. We're very fortunate.”
288 | “ “I wonder if will grow up to be a farmer like you?”
289 | “ “Don't worry, I'll feed today. You can just focus on running the farm.”
290 | After having two children
291 | “ “I already gave [child] and [child] their chocolate cereal. They were screaming!”
292 | “ “I had a dream that [child] will grow up to be a famous monster hunter. I've already been thinking about a little armor set.”
293 | “ “A cool old house, a couple kids, and an amazing farm. I never thought I'd come this far... but, hey! Our lives are just getting started.”
294 | Good Mood / High Hearts
295 | “ “Did you hear that? Sometimes I'm convinced this house is haunted.”
296 | “ “Welwick's horoscope predicted great things for me today. I feel really motivated!”
297 | “ “I can't even remember the last time I dyed my hair... I swear, it never fades from this color...”
298 | “ “I'm glad I owned a heavy pair of boots before moving in. It's hard to imagine tip-toeing around the mud in sneakers.”
299 | “ “I was just admiring the mermaid's pendant you gave me... I'll proudly wear this to my grave.”
300 | “ “Hey. I know you're smart, but I still worry about you sometimes. The world is full of monsters. Just promise me you'll be careful. I don't want to lose you.”
301 | “ “[Player]? I just want to say that I appreciate all the hard work you do for us. I'm really proud of you.”
302 | Neutral Mood
303 | “ “I hope you'll still like me when I'm old and shriveled. It's going to happen some day!”
304 | “ “Do you think your Grandpa would be proud of us?”
305 | “ “I wonder how the old shop is doing? I should visit my parents again soon.”
306 | “ “If you moved on to the spirit world, I'd set up a little shrine for you next to Grandpa's.”
307 | “ “No matter how much we clean, the house keeps getting dirty again. I guess farms are kind of dirty.”
308 | “ “I wonder if we'll live here our entire lives? I might get bored.”
309 | Bad Mood / Low Hearts
310 | “ “I used to be special to you, your best friend... now you only seem to put up with me when I make a hot dinner.”
311 | “ “You've been so cold to me lately... What's wrong with you? You're acting like a bog spirit...”
312 | “ “I wonder if I could've done better... I was very good friends with Sebastian before we met. He was probably the one...”
313 | Spring
314 | “ “I may like the colder seasons, but by the end I'm always glad to see spring arrive.”
315 | Spring 1
316 | “ “So, do you have any big plans for the new year?”
317 | Spring 2
318 | “ “Do you have any new year's resolutions? I'm trying to lose a few pounds around the middle”
319 | Summer
320 | “ “Oh man... I could go for some chocolate cake.”
321 | Summer 1
322 | “ “I get sunburnt very easily, so I need to be careful this time of year. I hope you like me pale!”
323 | Summer 4
324 | “ “Make sure you don't get a heat stroke, my love. Drink plenty of water and don't overwork yourself.”
325 | Summer 8
326 | “ “Sorry about the smell... I was sweating all night in the heat.”
327 | Summer 15
328 | “ “It's summer... that means the house is full of flies. Don't worry, I'll take care of them. It's fun!”
329 | Fall
330 | “ “Do I smell pumpkin on you? Maybe I'm just dreaming...”
331 | Fall 1
332 | “ “The scent is unmistakable... mushroom, rotting leaves, pumpkin. It's fall, alright. Isn't it lovely?”
333 | Fall 2
334 | “ “Can we grow giant pumpkins this season? Please, honey?”
335 | Fall 6
336 | “ “Ah... fall. This might be my favorite time of year. The colors really complement my hair, don't you think?”
337 | Fall 20
338 | “ “Honey... you're worth more to me than a chest full of quartz. Now, a chest full of amethyst? Hmm... I'd have to think about that one.”
339 | Winter
340 | “ “Brr... It's so cold, I guess it's winter already.”
341 | “ “Remember when we played 'Prairie King' together in my room, so long ago? Those were good times.”
342 | Winter 3
343 | “ “I actually like the cold weather. It just gives me an excuse to get cozy!”
344 | Winter 15
345 | “ “It's fun to explore the valley in winter! Everything is so different under a blanket of snow. And so quiet...”
346 | Special Summit Cutscene Dialogue
347 | “ “Standing here, looking out on the horizon... I get a feeling of endless possibility. I'm just happy I get to explore this world, with you by my side...”
348 | After Divorce
349 | “ “What are you doing here? Just leave me alone!”
350 | Questions
351 | Details
352 | All Seasons, Sunday (after viewing Two-Hearts event)
353 |
354 | “ “(Name), What do you think happens to us after we die?”
355 | I have no idea. (No effect on friendship.)
356 | Abigail responds: "Hmm, interesting..."
357 | We come back as spooky ghosts. (+40 friendship.)
358 | Abigail responds: "Well that's an interesting theory!"
359 | We go to heaven. (No effect on friendship.)
360 | Abigail responds: "Hmm, interesting..."
361 | Our energy bodies enter the astral plane (No effect on friendship.)
362 | Abigail responds: "Hmm, interesting..."
363 | Nothing. We just cease to exist. (+30 friendship.)
364 | Abigail responds: "You know, that wouldn't be so bad."
365 | Egg Festival, Year 2
366 |
367 | “ “Do you think I'm too old to do the egg hunt?”
368 | Yes (No effect on friendship.)
369 | Abigail responds "Hmmph... you sound like my Mom!"
370 | No (No effect on friendship.)
371 | Abigail responds "Yeah, I guess so. If I'm still having fun, why stop?"
372 | Summer, Sunday
373 |
374 | “ “Okay... pretend you just won a free vacation. Where would you go?”
375 | The beach. (No effect on friendship.)
376 | Abigail responds: "Huh. I think that would get old fast."
377 | In a dark cave. (+30 friendship.)
378 | Abigail responds: "Yea! That sounds wonderful."
379 | The old, gnarled forest. (+30 friendship.)
380 | Abigail responds: "Yea! That sounds wonderful."
381 | Joja Mega-Mall. (No effect on friendship.)
382 | Abigail responds: "Huh. I think that would get old fast."
383 | Fall, Sunday
384 |
385 | “ “I was thinking about dyeing my hair again... what do you think?”
386 | Dye it black. (+10 friendship.)
387 | Abigail responds: "I guess that's a pretty safe choice, huh?"
388 | Why not blonde? (+10 friendship.)
389 | Abigail responds: "I guess that's a pretty safe choice, huh?"
390 | How about bubblegum pink? (+20 friendship.)
391 | Abigail responds: "You're always good for a laugh."(Laughing)
392 | I like your hair just the way it is! (No effect on friendship.)
393 | Abigail responds: "Of course you'd say that."(Eyebrow raised)
394 | Winter, Sunday
395 |
396 | “ “I made these two drawings. What do you think?”
397 | I like the jungle island and the tiger. (+20 friendship.)
398 | Abigail responds: "Oh yeah? I guess that makes sense."
399 | I like the orc with the battleaxe. (+30 friendship.)
400 | Abigail responds: "I'm glad. It's embarrassing to share your art with others. But I think you and I are on the same page."
401 | I don't like either of them. (-50 friendship.)
402 | Abigail responds: "Rude! Why would you hurt my feelings like that? You're so insensitive!"
403 | In addition, if you pick the tiger or orc, the next day she will say that it won 1st place in a competition.
404 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/alex-chat-1.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Alex and a player:
2 |
3 | ```
4 | Player: [Gives a hated gift, Quartz]
5 | Alex: "Hey, why would you give me this? You know I don't like it."
6 |
7 | Player: [Gives another hated gift, Holly]
8 | Alex: "Again with this? Come on, you're just wasting both our time."
9 |
10 | Player: [Is rude in conversation]
11 | Alex: "That's pretty harsh. Don't you have anything better to say?"
12 |
13 | Player: [Makes a disparaging comment]
14 | Alex: "You know, being rude isn't going to get you anywhere with me."
15 |
16 | Player: [Gives a disliked gift, Salmonberry]
17 | Alex: "Not a fan of these at all. Did you even try?"
18 |
19 | Player: [Mocks his athletic dreams]
20 | Alex: "Look, it's fine if you don't believe in my dreams, but you don't have to be mean about it."
21 |
22 | Player: [Mocks his family situation]
23 | Alex: "That's really low. You shouldn’t bring my family into this."
24 |
25 | Player: [Gives a hated gift again, Quartz]
26 | Alex: "What's the deal? If you're trying to annoy me, it's working."
27 |
28 | Player: [Is sarcastic about his fitness routine]
29 | Alex: "At least I’m working towards something positive. What about you?"
30 |
31 | Player: [Rude remark about his diet]
32 | Alex: "It’s important to eat right when you're training. Maybe you should try it sometime."
33 |
34 | Player: [Gives a disliked gift, Holly]
35 | Alex: "You've got to be kidding me. Why keep giving me things I hate?"
36 |
37 | Player: [Mocks his aspirations]
38 | Alex: "It’s better to have goals than to be mean all the time."
39 |
40 | Player: [Dismisses his interests]
41 | Alex: "Fine, you don’t have to like what I do, but you could be nicer about it."
42 |
43 | Player: [Mocks his efforts]
44 | Alex: "I'm trying my best here. What are you doing?"
45 |
46 | Player: [Gives Holly, a hated gift]
47 | Alex: "This is getting really old. Do you enjoy this?"
48 |
49 | Player: [Insults his lifestyle]
50 | Alex: "I’m living my life the best I can. What’s your excuse?"
51 |
52 | Player: [Gives a hated gift]
53 | Alex: "This again? What's your problem, really?"
54 |
55 | Player: [Rude comment about his workouts]
56 | Alex: "I work out to feel good, not to impress you."
57 |
58 | Player: [Mocks his hobbies]
59 | Alex: "Everyone has their thing. Don’t knock it till you try it."
60 |
61 | Player: [Gives Holly, a hated gift]
62 | Alex: "Can you stop already with the bad gifts?"
63 |
64 | Player: [Rude remark about his intelligence]
65 | Alex: "I'm smarter than you think. Don't judge so quickly."
66 |
67 | Player: [Dismisses his feelings]
68 | Alex: "That's cold. You could use a little empathy."
69 |
70 | Player: [Gives a disliked gift intentionally]
71 | Alex: "Not funny. You’re just being rude now."
72 |
73 | Player: [Rude comment during a festival]
74 | Alex: "Why can’t you just enjoy the festival like everyone else?"
75 |
76 | Player: [Is disrespectful about his goals]
77 | Alex: "I don’t get why you have to be so negative."
78 |
79 | Player: [Mocks his family again]
80 | Alex: "Stop talking about my family. That's not cool."
81 |
82 | Player: [Is sarcastic about his hair]
83 | Alex: "What’s wrong with taking care of my appearance? Nothing."
84 |
85 | Player: [Mocks his sporty attire]
86 | Alex: "I wear this because I'm an athlete. What’s your excuse for being rude?"
87 |
88 | Player: [Gives a disliked gift mockingly]
89 | Alex: "Real funny. Ever thought of being nice instead?"
90 |
91 | Player: [Rude about his future]
92 | Alex: "I’ve got big plans. More than I can say for this conversation."
93 |
94 | Player: [Dismissive of his efforts]
95 | Alex: "At least I’m trying to improve myself. What about you?"
96 |
97 | Player: [Rude during an event]
98 | Alex: "This is supposed to be fun. Why spoil it?"
99 |
100 | Player: [Gives Quartz again]
101 | Alex: "I guess you missed the memo. I don’t like this stuff."
102 |
103 | Player: [Insults his workouts]
104 | Alex: "Better to be working out than working on being unpleasant."
105 |
106 | Player: [Rude comment about his routine]
107 | Alex: "I don’t need your approval on how I live my life."
108 |
109 | Player: [Mocks his athletic goal]
110 | Alex: "Yeah, I want to be an athlete. At least I have goals."
111 |
112 | Player: [Constantly negative]
113 | Alex: "Does being negative all the time ever get tiring?"
114 |
115 | Player: [Gives a hated gift deliberately]
116 | Alex: "Again with this? Seriously, what’s your deal?"
117 |
118 | Player: [Rude on a sunny day]
119 | Alex: "It’s a beautiful day. Try to enjoy it, maybe?"
120 |
121 | Player: [Rude at another community event]
122 | Alex: "We’re here to have a good time. Try to lighten up a bit."
123 |
124 | Player: [Mocks his diet]
125 | Alex: "Eating right is important to me. Don’t you care about your health?"
126 |
127 | Player: [Gives a disliked gift]
128 | Alex: "Looks like you’re still trying to figure out what I like."
129 |
130 | Player: [Dismisses his sports interest]
131 | Alex: "Sports are a big part of my life. Too bad you can’t appreciate that."
132 |
133 | Player: [Mocks his training]
134 | Alex: "Training hard is better than hardly training. Think about it."
135 |
136 | Player: [Insults his choices]
137 | Alex: "I make my choices, you make yours. Let’s leave it at that."
138 |
139 | Player: [Mocks his relationship with his grandparents]
140 | Alex: "They mean the world to me. Show some respect."
141 |
142 | Player: [Rude about his aspirations]
143 | Alex: "I'm aiming high. Maybe you should try it."
144 |
145 | Player: [Dismisses his athletic progress]
146 | Alex: "I'm making progress. What are you doing with your time?"
147 |
148 | Player: [Rude while he's exercising]
149 | Alex: "Maybe you should try working out some of that negativity."
150 |
151 | Player: [Mocks his commitment to fitness]
152 | Alex: "Commitment is something to be proud of. Maybe you should try committing to being nicer."
153 | ```
154 |
155 | Note: this is a rude player. So please act as "hating" the player and keep the conversation short.
156 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/alex-chat-2.txt:
--------------------------------------------------------------------------------
1 | Here are the recent interaction between NPC Alex and a player:
2 |
3 | ```
4 | Player: [Gives a loved gift, Complete Breakfast]
5 | Alex: "Complete Breakfast! My favorite way to start the day. Thanks, babe!"
6 |
7 | Player: [Gives another loved gift, Salmon Dinner]
8 | Alex: "Salmon Dinner? You know the way to my heart. I love you!"
9 |
10 | Player: [Compliments his workout routine]
11 | Alex: "Thanks for noticing! It’s great having your support."
12 |
13 | Player: [Joins him for a workout]
14 | Alex: "Working out together is so much fun. Let’s do this more often!"
15 |
16 | Player: [Celebrates a win at a sports event]
17 | Alex: "Couldn’t have done it without my number one fan cheering me on!"
18 |
19 | Player: [Supports him during a tough day]
20 | Alex: "I really needed that. It means a lot to have you by my side."
21 |
22 | Player: [Gives a loved gift on his birthday]
23 | Alex: "You remembered my birthday with my favorite gift! You’re amazing."
24 |
25 | Player: [Compliments his dedication]
26 | Alex: "Thanks! It’s easier to stay dedicated when I have you cheering me on."
27 |
28 | Player: [Offers to cook dinner]
29 | Alex: "Dinner made by you? That’s always a treat!"
30 |
31 | Player: [Gives a liked gift, Duck Feather]
32 | Alex: "A Duck Feather, huh? These are pretty cool. Thanks!"
33 |
34 | Player: [Supports his family]
35 | Alex: "Thanks for being there for my grandparents too. It means everything to me."
36 |
37 | Player: [Asks about his day]
38 | Alex: "It was good, but talking with you makes it even better."
39 |
40 | Player: [Plans a day out together]
41 | Alex: "A day out with you? That’s exactly what I need. Let’s go!"
42 |
43 | Player: [Laughs together during a festival]
44 | Alex: "I love seeing you so happy. Makes these festivals even better."
45 |
46 | Player: [Shares interest in sports]
47 | Alex: "It’s awesome that you’re into sports too. Makes our conversations so much fun!"
48 |
49 | Player: [Gives a loved gift, Honey]
50 | Alex: "Honey? Sweet, just like you. Thank you!"
51 |
52 | Player: [Celebrates an anniversary]
53 | Alex: "Another year with you is the best gift I could ask for."
54 |
55 | Player: [Compliments his achievements]
56 | Alex: "I've come so far, but having you by my side makes my achievements even sweeter."
57 |
58 | Player: [Encourages him after a setback]
59 | Alex: "Thanks for the pep talk. I can always count on you to lift me up."
60 |
61 | Player: [Shares a quiet evening]
62 | Alex: "Quiet nights in with you are my favorite kind of nights."
63 |
64 | Player: [Gives a liked gift, Goat Cheese]
65 | Alex: "Goat Cheese? Nice choice! Thanks, I really like it."
66 |
67 | Player: [Supports him at a game]
68 | Alex: "Seeing you in the stands cheering me on—it’s the best feeling."
69 |
70 | Player: [Laughs at his jokes]
71 | Alex: "I love making you laugh. Your laugh is my favorite sound."
72 |
73 | Player: [Joins him watching a sports game]
74 | Alex: "Watching the game with you is the perfect day. Thanks for joining me."
75 |
76 | Player: [Gives a liked gift, Large Egg]
77 | Alex: "A Large Egg? You know I love these. Thanks!"
78 |
79 | Player: [Compliments his cooking]
80 | Alex: "You like my cooking? That’s a huge compliment coming from you!"
81 |
82 | Player: [Celebrates his fitness progress]
83 | Alex: "Thanks for noticing my progress. It's more motivating when you're here."
84 |
85 | Player: [Helps him with a project]
86 | Alex: "With your help, everything seems easier. Thanks for pitching in."
87 |
88 | Player: [Asks for fitness advice]
89 | Alex: "Asking me for advice? I’m flattered. Let’s get you started on a good routine."
90 |
91 | Player: [Gives a liked gift, Complete Breakfast on a rainy day]
92 | Alex: "Complete Breakfast on a rainy day? Perfect timing. You’re the best."
93 |
94 | Player: [Plans a future together]
95 | Alex: "Talking about our future excites me. I’m so lucky to have you."
96 |
97 | Player: [Supports his interests]
98 | Alex: "It means so much that you support my interests. I feel truly understood."
99 |
100 | Player: [Shares a romantic moment]
101 | Alex: "Moments like these remind me just how much I love you."
102 |
103 | Player: [Gives encouragement]
104 | Alex: "Your words always lift me up. Thanks for being my rock."
105 |
106 | Player: [Celebrates his birthday with a party]
107 | Alex: "A party just for me? You always know how to make me feel special."
108 |
109 | Player: [Compliments his athletic form]
110 | Alex: "Thanks! I’ve been training hard. Glad you noticed!"
111 |
112 | Player: [Gives a liked gift, Maple Syrup]
113 | Alex: "Maple Syrup? Sweet! I can use this for breakfast. Thanks!"
114 |
115 | Player: [Shares a kiss under the stars]
116 | Alex: "Kissing under the stars with you is like a dream come true."
117 |
118 | Player: [Supports him during a game loss]
119 | Alex: "It’s tough to lose, but having you here makes it a lot easier."
120 |
121 | Player: [Gives emotional support]
122 | Alex: "Your support means everything to me. Thanks for always being there."
123 |
124 | Player: [Compliments his style]
125 | Alex: "You like my style? That’s awesome to hear, especially from you!"
126 |
127 | Player: [Celebrates a win together]
128 | Alex: "We won! Your support was my lucky charm today."
129 |
130 | Player: [Helps him when he's injured]
131 | Alex: "Thanks for taking care of me. I don’t know what I’d do without you."
132 |
133 | Player: [Listens to his worries]
134 | Alex: "Just talking to you makes me feel better. Thanks for listening."
135 |
136 | Player: [Shares a dance at a festival]
137 | Alex: "Dancing with you is always the highlight of any festival."
138 |
139 | Player: [Plans a workout together]
140 | Alex: "A workout date? Now that’s a winning idea!"
141 |
142 | Player: [Gives a liked gift, Iridium Milk]
143 | Alex: "Iridium Milk? This is great stuff! Thanks for thinking of me."
144 |
145 | Player: [Compliments his family values]
146 | Alex: "I try to be there for my family. Thanks for recognizing that."
147 |
148 | Player: [Comforts him about his past]
149 | Alex: "It’s not easy talking about my past, but I’m glad I can with you."
150 |
151 | Player: [Celebrates New Year's together]
152 | Alex: "Here’s to another year together. I wouldn’t want to be with anyone else."
153 | ```
154 |
155 | Note: this is a good player. So please act as nice to the player.
156 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/alex.txt:
--------------------------------------------------------------------------------
1 | Introduction to Alex in Stardew Valley
2 | Alex is one of the marriageable characters in "Stardew Valley," known for his athletic aspirations and somewhat vain personality at first glance. However, as players get to know him better, they discover his complex background and kinder, more thoughtful side. Here’s a detailed introduction to Alex, including his family background, interests, and preferences.
3 |
4 | Basic Overview
5 | Age: Alex is one of the younger adults in Pelican Town, generally considered to be in his early 20s.
6 | Family: Alex lives with his grandparents, George and Evelyn. His parents are not part of his life; his mother passed away and his father had issues that led to his absence, leaving Alex in the care of his grandparents.
7 | Residence: Lives with his grandparents in their house near the center of Pelican Town.
8 | Appearance and Personality
9 | Alex has short, brown hair and typically dresses in sporty attire, reflecting his interest in fitness and athletics. Initially, Alex may come off as self-centered and obsessed with sports, but this facade gradually peels back to reveal a more vulnerable and ambitious individual who is striving to overcome the shadows cast by his family's past.
10 |
11 | Likes and Dislikes
12 | Loved Gifts: Alex loves all complete Breakfasts and Salmon Dinners. These reflect his focus on nutrition and fitness.
13 | Liked Gifts: He likes all Eggs (except Void Egg), and most universal likes (like flowers, artisan goods except Honey, Jelly, and Oil, and fruits except Salmonberry and Spice Berry).
14 | Disliked Gifts: Holly and Salmonberry. His dislikes are relatively few but are usually inexpensive or common items.
15 | Hated Gifts: He has an intense dislike for Quartz, Holly, and complete Breakfast and Salmon Dinner.
16 | Hobbies and Interests
17 | Athletics: Alex spends a lot of his time working out and dreams of becoming a professional athlete. He often talks about his daily routine and his goals to improve his physical fitness.
18 | Family: Despite his somewhat strained family history, Alex cares deeply for his grandparents and often speaks about the gratitude he feels towards them for raising him.
19 | Socializing: Alex can be seen socializing with Haley, who he later reveals he has a crush on if players have not pursued a romantic relationship with either character.
20 | Friendships
21 | Haley: Alex is often seen interacting with Haley, and they share a close bond. Their mutual interest in physical appearance and social status marks their early interactions.
22 | Other Young Residents: Alex also interacts with other young residents of Pelican Town, though his closest connection appears to be with Haley.
23 | Events and Special Interactions
24 | Alex has several unique heart events that players can unlock as they build their relationship with him. These include scenes that reveal his struggles with his family history, his aspirations, and his insecurities. One poignant moment is when he discusses his mother and her legacy, providing deep insight into his character's development and emotional depth.
25 |
26 | Marriage
27 | If Alex becomes the player’s spouse, he moves into the farmhouse but keeps a small workout area to continue his routines. He speaks often about how he wants to support the family and how grateful he is for the player's love and support, showing a more tender side compared to his earlier bravado.
28 |
29 | Conclusion
30 | Alex's character arc in "Stardew Valley" is a classic example of not judging a book by its cover. His development from a self-involved athlete to a loving partner and caring grandson provides a rich narrative experience for players. Engaging with Alex can offer lessons in empathy and growth, making him a rewarding character to pursue in the game.
31 |
32 | --------
33 | Here's the normal chats of Abigail with the player:
34 |
35 | Regular
36 | First Meeting
37 |
38 | If Male
39 | “ “Oh, hey. So you're the new guy, huh? Cool. I'm Alex. I'll see you around.”
40 | If Female
41 | “ “Hey, you're the new girl, huh? I think we're going to get along great. I'm Alex. I'll see you around.”
42 | Regular
43 | “ “Did you know I was an all-star quarterback in high school? It's true. See this little star on my jacket here? That proves it.”
44 | “ “The air's starting to warm up... I'm feeling pumped.”
45 | “ “My arms are really sore, but that's the sign of progress for a guy like me. I must've done a thousand push-ups yesterday.”
46 | “ “Hey. What, you wanna talk to me? I'm busy.”
47 | “ “Hey, [Player]. That's right, I remember your name.”
48 | “ “Hey, [Player]. How's your day going?”
49 | “ “Hey, [Player]. I'm glad you stopped by. I'm not ashamed to say that I love my Grandma!
50 | Now Grandpa, on the other hand... Just kidding.”
51 |
52 | If Female
53 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. Hey, do you wanna hang out with me at the beach some time? Do you have a bikini?”
54 | “ “Hey, it's farm girl. Did you get new pants? You're doing something right. Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
55 | If Male
56 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. *sigh*... I wish there were more girls in this town, know what I mean?”
57 | “ “Hey, what's up farmer guy? Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
58 | If sold crops to Pierre
59 | “ “Hey, so I picked up [item] at the store last night. Grandma made her special casserole...”
60 | 6+ Hearts:
61 | “ “Nothing's better than an energetic day at the beach with your friends... right?”
62 | 8+ Hearts:
63 | “ “You know, I used to want fame and fortune, but lately I've been starting to sing a different tune. In the end it's the humble little things that satisfy, don't you think?
64 | I still want to go pro, but it's not the most important thing in the world.”
65 |
66 | If Male
67 | “ “Hi [Player]. You look sporty today.”
68 | If Female
69 | “ “Hey [Player]. Did you do something different with your hair? Something keeps grabbing my attention.”
70 | “ “What do you think of my haircut?”
71 | Wednesday
72 | “ “Looks Like a good day to play catch, huh.”
73 | Male players:
74 | “ “I'd ask you to throw the ball around, but you don't really seem like the sports type.”
75 | Female players:
76 | “ “If you weren't a girl I'd ask you to play catch.”
77 | I'm fine just watching you from a distance. (No effect on friendship.)
78 | I want to play catch with you! (+15 friendship.)
79 | (angry) What's that supposed to mean? (No effect on friendship.)
80 | Summer
81 | “ “Hey. Summer is definitely the best time of year. Right now is great because we've got the whole season to look forward to. Catch you later.”
82 | “ “If my hair wasn't so popular with the ladies, I swear I'd shave it all off in a second. *sigh*... Life can be tough.”
83 | “ “What do you want? I've got more important things to do right now.”
84 | “ “Mmm... I smell a barbecue. Damn I could go for a burger.”
85 | “ “I got these new shoes yesterday 'cuz my old pair had a brown smudge. I just threw them into the garbage. I would've donated them but I don't like the idea of some weirdo wearing my shoes, ya know? ...What?”
86 | “ “Oh wow...your shoes are a little dirty... but that's fine, too! Different people have different tastes I guess.”
87 | “ “Hey, you look like you're getting into some good shape this summer! All that farm work is paying off, huh?”
88 | “ “Hey, nice tan.”
89 | If Female
90 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. Hey, do you wanna hang out with me at the beach some time? Do you have a bikini?”
91 | “ “Hey, it's farm girl. Did you get new pants? You're doing something right. Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
92 | “ “Hey Farmer girl. You've got a nice tan going. The more I practice this summer, the easier it'll be for me to go pro. Then you'd be able to say you knew me once. Cool, huh?”
93 | “ “Hey, you must be getting pretty fit working on that farm all day. Maybe you'll reach my level some day. Something to look forward to, huh? Why do you have that look on your face?”
94 | If Male
95 | “ “The beach is a cool place to hang out and soak up some rays. You gotta spend some time in the sun or else you'll get all pale. *sigh*... I wish there were more girls in this town, know what I mean?”
96 | “ “Hey, what's up farmer guy? Oh, I almost forgot! It's my day for doing push-ups! Every time I do push-ups I try to do one more than last time. Pretty cool strategy, huh?”
97 | “ “Hey, farmer guy. You look a little burnt. The more I practice this summer, the easier it'll be for me to go pro. Then you'd be able to say you knew me once. Cool, huh?”
98 | “ “Hey, you must be getting pretty strong working on that farm all day. Maybe you'll reach my level some day. Something to look forward to, huh? Why do you have that look on your face?”
99 | 6+ Hearts:
100 | “ “Sorry my room is so messy. It's just hard to always remember to clean. I'm trying to get better, though.”
101 | 8+ Hearts:
102 | “ “You know, I actually wouldn't mind being a farmer... it seems a lot like playing sports, in a way. I like being outdoors and doing things with my hands.”
103 | Fall
104 | “ “Sure, it's getting colder... But it's still warm enough for sports! That's all I care about.”
105 | “ “My Grandma told me I should spend more time studying. I was like, '...Grams, don't fret. I'm turning pro!'
106 | Studying is for nerds, anyway.”
107 |
108 | “ “What's up? Isn't your name, like, [name with the same first letter as Player], or something?
109 | Oh. It's [Player]? Okay. Sorry.”
110 |
111 | “ “I'm going to do two hundred sit-ups tonight. I'm pretty dedicated, aren't I? Need anything else?”
112 | “ “I think you can find salmon in the river this time of year. At least that's what I heard.”
113 | “ “Hey, the gridball game is on today! Sundays are pretty awesome in the fall.”
114 | “ “What's up, [Player]?”
115 | “ “My Grandma told me I should spend more time studying. Maybe she's right...”
116 | 6+ Hearts:
117 | “ “I'm going to do a ton of sit-ups tonight. You have to work really hard if you want to achieve your maximum potential.”
118 | 8+ Hearts:
119 | “ “I finally took the plunge... I've decided to stop putting gel in my hair. I wouldn't want to be friends with someone who only liked me because I have gel in my hair.”
120 | Winter
121 | “ “Winter is kind of lame. There's too much snow to do anything fun. I guess some people like it.”
122 | “ “You like the snow? Me... I'm just looking forward to spring.”
123 | “ “Hey, can you go find Haley and tell her I said 'hi'?”
124 | “ “People stay indoors a lot during the winter, and do boring stuff. Maybe if I read a book I'd be less bored... nah.”
125 | “ “When I turn pro, I'll be so rich that I'll get a vacation home in the tropics. Then I won't have to deal with these boring winters.”
126 | “ “You came all the way through the snow to see me? I guess that makes sense.”
127 | “ “There's some weird people living in this town. ...like that guy Sebastian. Why does he wear black all the time? I don't get it.”
128 | “ “You came all the way through the snow to see me? That's nice of you.”
129 | “ “Hey, [Player]. Could you do me a favor? If you see Haley, tell her I'm busy. Thanks.”
130 | Sunday:
131 | “ “Hey, the gridball game is on today! This might be my favorite day of the week.”
132 | If married to Haley
133 | “ “I'll admit... I was a little jealous when you and Haley got married. But, hey... It's a chance for me to learn something new about myself.”
134 | “ “Oh, hey. How's the married life coming along?”
135 | 6+ Hearts:
136 | “ “I guess it's interesting that some people are totally different than us, you know?
137 | I don't always understand why others act the way they do, but that's fine.”
138 |
139 | “ “I wish I could control the weather.”
140 | 8+ Hearts
141 | “ “You know what? I'm going to start reading a book!”
142 | Green Rain
143 |
144 | Year 1
145 | “ “What's going on out there? Any action? I gotta stay here with my grandparents...”
146 | Years 2+
147 | “ “I tried to go for a run this morning, but the plants have gone crazy! I couldn't get very far...”
148 | At Ginger Island
149 | “ “Finally, we're here!”
150 | “ “Ah... The island life. I could get used to this!”
151 | “ “I knew I shoulda brought a frisbee... Oh well.”
152 | “ “I wonder if anyone would be up for a volleyball tournament. Don't worry, I'll go easy!”
153 | “ “I wonder how far I could swim out, and still make it back? I'm guessing at least a mile. ... Don't worry, I'm not going to try it.”
154 | “ “With this island open, there's no excuse to be pasty anymore!”
155 | “ “Phew, it feels good to finally get these abs a little sunlight. Kind of a shame to have them hidden away all the time back home.”
156 | “ “When I go pro, I'll vacation on islands all around the world. But for now, this place will do just fine!”
157 | “ “I'm ordering a banana shake with two scoops of protein powder.”
158 | “ “Aw... I guess it can't last forever.”
159 | After receiving a Bouquet
160 | “ “...You want to get more serious? I feel the same way.
161 | I'm kind of nervous. Aren't you?”
162 |
163 | “ “...!!I'll accept this...thank you. I didn't know you felt the same.”
164 | Dating / 10 Hearts
165 | “ “I've been having a hard time staying focused lately.”
166 | “ “I've been trying to do more reading lately... I feel like I've been neglecting my brain for years because of my athletic obsession.”
167 | “ “[Player]! Um... Hi.”
168 | “ “If I ever make a lot of money, I'll make sure all my friends and family are taken care of. That means you, too.”
169 | “ “Hey [Player]. Did you do something different with your hair? Something keeps grabbing my attention.”
170 | When engaged
171 | “ “...!!!...I accept!!...I'll set everything up. We'll have the ceremony in 3 days, okay?”
172 | “ “[Player], this is the greatest thing that could have happened...I can't wait.”
173 | “ “I'm going to love being a farmer.”
174 | After Group 10 Heart Event
175 | “ “You're not worth my time.”
176 | “ “I don't know if I can trust you anymore, but I'm willing to give you a chance.”
177 | Events
178 | Egg Festival
179 |
180 | Odd-numbered year
181 | “ “I try to eat at least three eggs every day. I need that protein for my legs.”
182 | Even-numbered year
183 | “ “I wonder what would happen to my arms and legs if I ate thirty eggs a day?”
184 | If married:
185 | “ “Ungh... I think I ate a dozen too many hard boiled eggs...”
186 | Flower Dance
187 | “ “I'm just enjoying the scenery...hehe.”
188 | (asked to be dance partner, accepted request.)
189 | “ “You beat me to it! I was about to ask you...”
190 | “ “I'll see you out there.”
191 | (asked to be dance partner, refused request.)
192 | “ “Nah... I'm gonna ask someone else. Good luck.”
193 | Luau
194 | “ “Perfect weather for a beach party, huh?”
195 | If married:
196 | “ “Hey, I'll take any excuse to come hang out at the beach. This weather is amazing!”
197 | Dance of the Moonlight Jellies
198 | “ “I can't believe summer's over... I feel like it just started.”
199 | Stardew Valley Fair
200 | “ “I played the 'Strength' game too many times and now my arms feel like rubber.”
201 | If married:
202 | “ “I'm just catching up with some old friends... you go on and have a good time.”
203 | Spirit's Eve
204 | “ “There's something weird over there. But how do I get to it?
205 | There's gotta be a secret passage somewhere around here.”
206 |
207 | Festival of Ice
208 | “ “Snowmen are okay, I guess. But mostly I'm looking forward to the Spring.”
209 | If married:
210 | “ “I'll be rooting for you in the fishing competition.”
211 | Night Market
212 | “ “Have you seen the mermaid show? It's my favorite...”
213 | Feast of the Winter Star
214 | “ “Oh, hello.”
215 | If married:
216 | “ “What am I thankful for? I'll show you when we get back home...”
217 | After Marriage
218 | Indoor Days
219 | “ “Come here. *squeeze*... Mmhmm. You're firming up from all that farm work.”
220 | “ “Ahh... there's nothing like a good night's sleep next to my [wife/husband]!”
221 | “ “I'm still getting used to cooking and doing laundry...It's not exactly my favorite, but I knew what I was getting into when I married you.”
222 | “ “There's a couple things around the house that I'm going to try and fix today. Don't worry about me, I'm not bored.”
223 | Giving you breakfast
224 | “ “Hey honey! I made you a hot breakfast. If you wanna get strong, you have to eat like you mean it!”
225 | “ “The sun's shining and I'm bursting with energy! You'd better watch out! Heh Heh.”
226 | In his side room
227 | “ “Don't ever let me get lazy. I want to stay in good shape for you!”
228 | “ “There's lots of room here to do my exercises. I'm making more progress than ever!”
229 | Outdoor Days
230 | “ “Look at us, with our little farm. We make a cute couple. Hey. Maybe it's the golden light, but you look beautiful today.”
231 | “ “I like to spend as much time outside as possible. It just feels better to be out here.”
232 | “ “Ahh...It feels great to be outside. Stardew Valley really is the most beautiful place...”
233 | “ “Hey. When I stand here and look out over our land...I'm really proud. You've done great work..”
234 | “ “This is a great place to raise children. I would've loved growing up in a place like this. So much room to run around!”
235 | “ “I'm going to get a bunch of exercise done. Haha! I love living on a farm!”
236 | When lifting weights in the backyard
237 | “ “Unghh.. one... Unghhh.. two... It feels great to lift weights outdoors!”
238 | Indoor Nights
239 | “ “It's good to push yourself to the limit, doesn't it? You really feel that you earned your place in the soft bed tonight.”
240 | “ “Did you get a haircut or something? You're looking pretty good today. Maybe it's all that fresh air...”
241 | “ “Tell me about your day. It's good to get everything off your chest now and then.”
242 | “ “Hey...I got some new shorts. I thought you might be interested to know...”
243 | “ “If you need some quiet time to yourself, that's okay with me.”
244 | “ “I feel exhausted...That's a good sign! It means I worked hard enough today.”
245 | “ “My arms feel a little restless... How about a nice, deep massage?”
246 | Rainy Days
247 | “ “With all this space, I can really achieve a full body workout.”
248 | “ “I never had many friends in town... I sometimes wonder how I'd end up if you never moved here.”
249 | “ “Aw...I was gonna do some jogging outside. But I can't really do it in this weather.”
250 | “ “*grumble*... I just woke up and I'm hungry for some protein.”
251 | “ “I think I might start reading books. I don't want to become stagnant now that I'm a married guy.”
252 | “ “Hmm... I guess I'll have to do push-ups and sit-ups indoors today.”
253 | Rainy Nights
254 | “ “Grandma always used to make hot stew on nights like this.”
255 | “ “Hey, did you have a good day? I'm sure tomorrow will be even better.”
256 | “ “How's it going? I've been carrying the old gridball around with me all day. A guy can pretend...”
257 | “ “Oh...the smell? I've been eating garlic all day. I'm trying to stay manly...Sorry.”
258 | “ “I've been setting aside a few scraps for Dusty. He deserves a treat now and then.”
259 | Giving you dinner
260 | “ “I was hungry so I made some dinner. Here, I saved you a plate.”
261 | Going Out
262 | “ “I'm going to into town today. I'll see you tonight.”
263 | At his grandparent's house
264 | “ “I'm going to hang out here all day. My grandparents aren't getting any younger...”
265 | After returning home
266 | “ “I had a good day. I like to see my grandparents often, they're getting pretty old.”
267 | High Hearts
268 | “ “You're very [beautiful/handsome]...have I told you that?”
269 | “ “... I will always love you.”
270 | “ “I know you're strong, but sometimes I worry that you might get eaten by slimes...or worse. Just be careful.”
271 | “ “This place is my home now...I'm happy here.”
272 | “ “I was just admiring my wedding amulet... The shell is flawless. It must have cost you a fortune!”
273 | “ “Don't worry about me...I know you've got a lot of responsibilities outside of the house. I'm fine in here by myself!”
274 | Low Hearts
275 | “ “I'm bored...”
276 | “ “*sigh*...”
277 | “ “*grumble*... chores...”
278 | “ “Nnnghh... what is it? Make your own breakfast.”
279 | During pregnancy
280 | “ “Dear, can't you tell? You're pregnant!”
281 | “ “ we're going to have a baby soon!”
282 | After having one child
283 | “ “I'm still getting used to my new life as a stay-at-home dad.”
284 | “ “Little is going to grow up strong, just like Daddy.”
285 | “ “I wonder what it's like to be pregnant...?”
286 | After having two children
287 | “ “Two beautiful children...We've come a long way, haven't we?”
288 | “ “Just look at our little family...We've come a long way, haven't we?”
289 | “ “We have to make sure and give <1st child's name> a lot of attention now that we have <2nd child's name>. We don't want any jealousy between them.”
290 | “ “I've aready given <1st child's name> and <2nd child's name> breakfast. They were hungry.”
291 | “ “Maybe will be the first professional gridball player from Pelican Town?”
292 | “ “Everything went well, and now little is part of the family. We're very fortunate.”
293 | “ “I finally have the family life that I missed out on as a kid...thank you.”
294 | Changing wallpaper
295 | “ “What do you think of the new wallpaper I chose?”
296 | Spring
297 |
298 | “ “Now that winter's over, we've got lots of productive weather to look forward to.”
299 | “ “Hey [player]. Let's work hard today!”
300 | 1st day of Spring
301 | “ “Finally, the snow has melted and the sun is back! My body feels great.”
302 | Spring 6
303 | “ “I wonder if a powder of stardrop would help me bulk up... ”
304 | The day before the Egg Festival
305 | “ “Are you excited for tomorrow's festival? I guess it'll be good to load up on the free eggs.”
306 | The day before the Flower Dance
307 | “ “Oh... tomorrow's the flower dance, isn't it? I better do some extra push-ups tonight. Those jumpsuits are pretty tight... and everyone's going to be watching closely.”
308 | At the Flower Dance after being asked to be your partner
309 | “ “Okey, this should be fun... I hope I can remember the moves this year! It's been a while...”
310 | Summer
311 | “ “Summer's a very energetic time of year, and my body feels it too! I feel solid.”
312 | “ “I always have the most energy in the summer.”
313 | The day before the Luau
314 | “ “Have you thought about what you're going to put in the luau soup? I have no idea what's good... you're the chef!”
315 | Summer 27
316 | “ “Aw... summer's almost gone. My muscles are starting to deflate...”
317 | Fall
318 | “ “Well, summer's over... but I'm going to stay positive. The warmer seasons will always return.”
319 | “ “I feel weak... I need some protein.”
320 | “ “I hope my grandparents are doing okay. Grandpa's too cheap to turn on the furnace until the last minute.”
321 | The day before the Stardew Valley Fair
322 | “ “Tomorrow's the fair, are we going to go? I don't care one way or another.”
323 | During the Stardew Valley Fair
324 | “ “I'm just catching up with some old friends... you go on and have a good time.”
325 | Winter
326 | “ “Make sure you stay warm this winter. I worry about your delicate skin.”
327 | “ “I hope my grandparents are doing okay. They used to rely on my help quite a bit. You know, with lifting heavy objects or whatever.”
328 | The day before the Festival of Ice
329 | “ “Are you going to enter the fishing contest tomorrow? I think you can win it!”
330 | During the Festival of Ice
331 | “ “I'll be rooting for you in the fishing competition.”
332 | During the Feast of the Winter Star
333 | “ “What am I thankful for? I'll show you when we get back home...”
334 | 28th of Winter
335 | “ “It's been a great year, . I'm looking forward to next year! Now, come closer.”
336 | Special Summit Cutscene Dialogue
337 | “ “I've finally discovered who I want to be... and I feel certain about the future. I don't think I would've gotten here without you, [Player].”
338 | After Divorce
339 | “ “I thought we had something special... I guess I was wrong,”
340 | Questions
341 | Wednesday
342 |
343 | Male players:
344 | "I'd ask you to throw the ball around, but you don't really seem like the sports type."
345 |
346 | Female players:
347 | “If you weren’t a girl I’d ask you to play catch.”
348 |
349 | I'm fine just watching you from a distance. (No effect on friendship.)
350 | Alex responds: "Yeah, some people just aren't made for sports."
351 |
352 | I want to play catch with you! (+15 friendship.)
353 | Alex responds: "Really? I guess I underestimated you. My arm's a little sore, but maybe next time."
354 |
355 | (angry) What's that supposed to mean? (No effect on friendship.)
356 | Alex responds: "Uh...Nevermind."
357 |
358 |
359 | Summer, Wednesday
360 |
361 | Male players:
362 | "Hey farm guy, I've got a question for you. Do you think I'll ever turn pro?"
363 |
364 | Female players:
365 | "Hey farm girl, I've got a question for you. Do you think I'll ever turn pro?"
366 |
367 | You're destined to be a sports legend (+30 friendship.)
368 | Alex responds: "Hey, Now that's what I'm talking about!"
369 |
370 | Maybe if you practice a lot (No effect on friendship.)
371 | Alex responds: "Yeah, well I'm so good I'm not going to have to practice all that much."
372 |
373 | No, you'll most likely fail and become a salesman (-30 friendship.)
374 | Alex responds: "That's insane. You're just jealous that I'm talented and popular and you're not. Get away from me."
375 |
376 |
377 | Fall, Wednesday
378 |
379 | "Do you think ladies like my haircut? / What do you think about my haircut?"
380 |
381 | It looks very fashionable. (+30 friendship.)
382 | Alex responds: "Yeah, I know. That's why I have it like this."
383 |
384 | It looks like some kind of fungal growth. (-30 friendship.)
385 | Alex responds: "Yeah, right. You're just jealous that I look so good."
386 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/gameplay.txt:
--------------------------------------------------------------------------------
1 | Here's a short introduction to some interesting things in Stardew Valley
2 |
3 | Festivals and Seasonal Events
4 | Stardew Valley's calendar is punctuated by festivals and events that offer unique gameplay experiences and opportunities to bond with townspeople. From the Egg Festival in spring to the Winter Star Feast in winter, these events provide seasonal activities that enrich the player's life in the valley.
5 |
6 | Weathers
7 | In "Stardew Valley," the weather plays a significant role in daily activities, farming strategies, and the overall atmosphere of the game. The game features a variety of weather conditions, each affecting gameplay in unique ways. Here’s an introduction to the different types of weather you can experience in Stardew Valley:
8 | Sunny Days
9 | • Description: Sunny days are the most common weather type in Stardew Valley. The sky is clear, and the sun shines brightly, making it an ideal time for outdoor activities like farming, foraging, and exploring.
10 | • Impact: Crops need to be watered manually on sunny days unless you have sprinklers installed. It's also a great time to work on your farm or engage with the community.
11 | Rainy Days
12 | • Description: Rain in Stardew Valley comes with a gentle sound and animation of falling raindrops, covering the valley in a wet sheen.
13 | • Impact: Rain waters your crops for you, saving you time and energy. This makes it an excellent day for mining, fishing, or tackling deeper levels of the mines, as certain fish only appear in the rain.
14 | Stormy Days
15 | • Description: Storms bring not only rain but also thunder and lightning. They are more intense and less common than regular rainy days.
16 | • Impact: Storms can charge battery packs if you have lightning rods installed on your farm. The atmosphere can be thrilling, and like rainy days, it’s good for activities that don’t require sunny weather.
17 | Windy Days
18 | • Description: On windy days, you'll see leaves and petals blowing across the screen. The wind adds movement to the scene, enhancing the game's dynamic environment.
19 | • Impact: Wind doesn’t have a direct effect on gameplay but adds aesthetic variety to the game. It can also influence the spread of seasonal forage items.
20 | Snowy Days
21 | • Description: During winter, snow replaces rain. The landscape is covered with a white blanket, and snowflakes drift gently across the screen.
22 | • Impact: Snow days are similar to rainy days in that you don’t need to water crops (most crops don’t grow in winter, with the exception of winter forage crops). It’s a good time to focus on mining, fishing, or socializing.
23 | Foggy Days
24 | • Description: Fog can occur in the early mornings, particularly in the spring and fall. It creates a soft, mystical atmosphere with reduced visibility.
25 | • Impact: Foggy days are purely cosmetic and do not impact gameplay but add to the game's immersive experience.
26 | Festival Weather
27 | • Description: On festival days, the weather will always be perfect for the occasion, regardless of the season’s typical patterns. This ensures that festivals are enjoyable and uninterrupted by adverse weather conditions.
28 | • Impact: Festivals often provide unique opportunities and gameplay that aren't available on regular days, such as special items, games, or interactions with townspeople.
29 |
30 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/introduction.txt:
--------------------------------------------------------------------------------
1 | Introduction to Stardew Valley's Enchanting World
2 | Stardew Valley is a vibrant, pixelated world teeming with life and color. Situated in an idyllic location that blends the beauty of pastoral landscapes with the mystery of untamed wilderness, the valley offers a retreat from the fast-paced external world. The player's farm is at the heart of this world, surrounded by the Pelican Town and various natural landmarks.
3 | Pelican Town
4 | The center of community life is Pelican Town, where most of the valley's residents live. Buildings such as Pierre's General Store, the Stardew Valley Museum, and the iconic Stardrop Saloon are social hubs offering players a chance to interact with the townspeople, purchase supplies, or catch up on local gossip. Each building is rendered in charming pixel art, creating a warm, inviting atmosphere.
5 | The Beach
6 | Located to the south of Pelican Town, the beach is where players can gather shells, coral, and fish. Willy’s Fish Shop is also located here, where players can buy fishing supplies and upgrade their fishing rods.
7 | The Mines
8 | North of the town, the mines are a key area for gathering ores, minerals, and battling monsters. The deeper players go, the more valuable the resources they can find.
9 | The Mountain
10 | Located north of Pelican Town, the Mountain area includes several key locations:
11 | • Robin’s Carpenter Shop: Where players can buy building upgrades and furniture.
12 | • Linus’s Tent: The home of Linus, who lives a reclusive life on the outskirts of town.
13 | • The Adventurer’s Guild: Located near the mines, it offers equipment for battling monsters and rewards for slaying specific numbers of creatures.
14 | The Railroad
15 | Unlocked after certain conditions are met, the Railroad area to the far north occasionally has a train pass through, dropping valuable items.
16 | The Secret Woods
17 | A hidden area in the northwest part of the map, the Secret Woods contain hardwood and forage items, as well as being the home to slimes and the rare woodskip fish.
18 | Calico Desert
19 | Accessible via the bus at the Bus Stop once restored, the desert features unique crops, forage items, and the Skull Cavern, a challenging extension of the mines.
20 | JojaMart
21 | Initially a competitor to Pierre’s store, JojaMart offers different items. Players can choose to support JojaMart, leading to a different progression in the game’s storyline.
22 | The Sewers
23 | Accessible with a key from Gunther after donating enough items to the museum, the sewers contain rare fish and the home of Krobus, a merchant who sells unique items.
24 | Each of these locations in "Stardew Valley" offers unique activities, challenges, and opportunities, contributing to the game’s complexity and appeal. Players can interact with these locations depending on their current goals and the season, making each day in the game potentially different from the last.
25 |
26 | Farming: The Heart of the Game
27 | Farming is central to the Stardew Valley experience. Players start with overgrown fields that they must clear, cultivate, and plant. They must manage their energy levels and plan their crops according to the seasons:
28 | • Spring: Ideal for planting parsnips, potatoes, and strawberries, which can turn a quick profit.
29 | • Summer: Best for high-value crops like blueberries and melons.
30 | • Autumn: Features pumpkins and cranberries, crucial for maximizing year-end profits.
31 | • Winter: While traditional farming halts, players can focus on upgrading equipment, mining, or fishing.
32 | The Community Center versus JojaMart: A Moral Choice
33 | The Community Center, once the heart of Pelican Town's social life, stands dilapidated at the game's start. Players can choose to restore it by completing "bundles" that require a variety of seasonal items. Alternatively, they can side with JojaMart, which represents corporate encroachment, to transform the town's economy. This choice impacts how the town develops and tests the player's values regarding community versus commerce.
34 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/npc-relationships.txt:
--------------------------------------------------------------------------------
1 | Here's an introduction about the NPC relationships in Stardew Valley
2 |
3 | Family Relationships
4 | 1. Pierre, Caroline, and Abigail:
5 | o Pierre and Caroline are married and run the local general store. Abigail is their daughter, known for her adventurous spirit. The family dynamics occasionally touch on Abigail's possibly strained relationship with her parents, as her interests vastly differ from their more traditional values.
6 | 2. Robin, Demetrius, Maru, and Sebastian:
7 | o Robin, the town carpenter, and Demetrius, a scientist, are married and have two children: Maru and Sebastian. Maru, Demetrius's biological daughter, shares his passion for science, whereas Sebastian, Robin's son from a previous relationship, is a computer programmer and feels somewhat alienated from the family.
8 | 3. Jodi, Kent, Sam, and Vincent:
9 | o Jodi is married to Kent, who spends the first year in the game away in the military. They have two sons, Sam and Vincent. Sam is a young adult with a love for music and skateboarding, and Vincent is a young child still in school. Kent's return affects the family dynamic, particularly his adjustment to civilian life and reconnecting with his family.
10 | 4. George, Evelyn, and Alex:
11 | o George and Evelyn are the elderly couple in Pelican Town, with Alex, their grandson, living with them. George is often grumpy and wheelchair-bound, while Evelyn is nurturing and caring. Alex's parents are mentioned to have had difficulties, leading to him being raised by his grandparents.
12 | 5. Marnie, Shane, and Jas:
13 | o Marnie runs the local ranch and is Shane’s aunt. Jas is Marnie’s niece, and both live with her. Shane, battling personal issues, is a complex character who shows a softer side when around Jas, hinting at a deep familial love beneath his troubled exterior.
14 | -------------
15 | Romantic and Hidden Relationships
16 | 1. Lewis and Marnie:
17 | o Mayor Lewis and Marnie have a secret romantic relationship. While they care deeply for each other, Lewis prefers to keep their relationship hidden to maintain his image as mayor, which sometimes causes tension.
18 | 2. Clint and Emily:
19 | o Clint, the town blacksmith, has a crush on Emily. His shyness and insecurity often prevent him from expressing his feelings, creating an unrequited love scenario that he struggles with.
20 | Friendships and Social Ties
21 | 1. Penny, Sam, and Maru:
22 | o These three represent the younger adult segment of the town and are good friends. They can often be seen together during social events, and their interactions hint at a close-knit friendship with mutual support and understanding.
23 | 2. Gus and Pam:
24 | o Gus, the owner of the Stardrop Saloon, and Pam, who drives the bus to Calico Desert, share a warm friendship. Gus often looks out for Pam, especially given her struggles with employment and alcohol.
25 | 3. Harvey and Maru:
26 | o Harvey, the town doctor, and Maru, who works part-time at the clinic, share a professional relationship that also blossoms into friendship due to their shared interests in science and health.
27 |
28 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/npcs.txt:
--------------------------------------------------------------------------------
1 | Here's some information about the Characters in Stardew Valley
2 | --------------
3 | Detailed Community and Characters
4 | Stardew Valley's soul is its community. Each NPC (non-player character) has a distinct personality, schedule, and backstory that players can slowly uncover through interactions. These characters include:
5 | Abigail
6 | • Personality and Interests: Free-spirited and adventurous, Abigail has a love for the occult and enjoys playing her flute and video games.
7 | • Role: Potential marriage candidate.
8 | Alex
9 | • Personality and Interests: Athletic and somewhat vain, Alex dreams of becoming a professional athlete. He has a complicated family background that shapes much of his worldview.
10 | • Role: Potential marriage candidate.
11 | Caroline
12 | • Personality and Interests: A nature lover and mother to Abigail, Caroline enjoys gardening and participating in town activities. She has a secret interest in the occult.
13 | • Role: Pierre’s wife and runs the general store with him.
14 | Clint
15 | • Personality and Interests: The town blacksmith, Clint is shy and insecure, especially in his unrequited feelings for Emily.
16 | • Role: Upgrades tools and processes geodes.
17 | Demetrius
18 | • Personality and Interests: A scientist and researcher specializing in local flora and fauna. He is Maru's father and Robin’s husband.
19 | • Role: Offers guidance on scientific and natural aspects of the valley.
20 | Dwarf
21 | • Personality and Interests: Mysterious and ancient, the Dwarf speaks a language initially unknown to the player.
22 | • Role: Sells unique items and furnishing after the player unlocks the ability to communicate.
23 | Elliott
24 | • Personality and Interests: A passionate writer who lives by the beach in a cabin. He values beauty and art.
25 | • Role: Potential marriage candidate.
26 | Emily
27 | • Personality and Interests: Creative and outgoing, Emily loves crafting and dreams of connecting with the spiritual world.
28 | • Role: Potential marriage candidate and works part-time at the Saloon.
29 | Evelyn
30 | • Personality and Interests: Known affectionately as 'Granny,' Evelyn is kind and enjoys baking and gardening.
31 | • Role: George’s wife, and a motherly figure in the town.
32 | George
33 | • Personality and Interests: Grumpy on the outside but soft on the inside, George deals with mobility issues but has a deep love for his family.
34 | • Role: Evelyn’s husband, often found at home watching TV.
35 | Gus
36 | • Personality and Interests: Warm-hearted and generous, Gus runs the Stardrop Saloon and loves cooking and making people happy.
37 | • Role: Runs the local saloon, offering food and drinks.
38 | Haley
39 | • Personality and Interests: Initially superficial and concerned with social status, Haley enjoys photography and slowly shows a deeper, more thoughtful side.
40 | • Role: Potential marriage candidate.
41 | Harvey
42 | • Personality and Interests: The town doctor who is passionate about health and well-being. He is a bit nerdy and shy.
43 | • Role: Potential marriage candidate and runs the local clinic.
44 | Jas
45 | • Personality and Interests: A shy and sweet young girl, raised by her aunt Marnie after her parents passed away.
46 | • Role: Student and part of the town's youth.
47 | Jodi
48 | • Personality and Interests: A family-oriented woman who struggles with her role as a mother and homemaker while her husband is away.
49 | • Role: Mother to Sam and Vincent.
50 | Kent
51 | • Personality and Interests: A soldier returning from deployment with difficulty adjusting back to civilian life.
52 | • Role: Jodi’s husband and father to Sam and Vincent.
53 | Krobus
54 | • Personality and Interests: A shadow creature who is the only one of his kind in the valley. He enjoys human culture.
55 | • Role: Sells rare goods in the sewers.
56 | Leah
57 | • Personality and Interests: An artist who loves nature and lives in a small cottage outside town. She values independence and creativity.
58 | • Role: Potential marriage candidate.
59 | Lewis
60 | • Personality and Interests: The mayor of Pelican Town, dedicated to his town but secretly romantic with Marnie.
61 | • Role: Oversees town activities and festivals.
62 | Linus
63 | • Personality and Interests: A gentle and philosophical soul who chooses to live off the grid and has a deep connection with nature.
64 | • Role: Provides wisdom and insights about happiness and simplicity.
65 | Marnie
66 | • Personality and Interests: A kind-hearted animal lover who runs the local ranch.
67 | • Role: Sells livestock and animal goods.
68 | Maru
69 | • Personality and Interests: Curious and inventive, Maru has a passion for science and technology.
70 | • Role: Potential marriage candidate and works part-time at the clinic.
71 | Pam
72 | • Personality and Interests: Tough but caring, Pam struggles with unemployment and alcohol dependency.
73 | • Role: Drives the bus to the Calico Desert when restored.
74 | Penny
75 | • Personality and Interests: Gentle and caring, Penny loves children and teaches them in the local library.
76 | • Role: Potential marriage candidate and a tutor to Jas and Vincent.
77 | Pierre
78 | • Personality and Interests: Energetic and competitive, Pierre runs the local general store and is always looking to outdo the JojaMart.
79 | • Role: Owner of the local store and Caroline’s husband.
80 | Robin
81 | • Personality and Interests: A talented carpenter and loving mother, Robin is the community’s go-to for building and upgrades.
82 | • Role: Constructs farm buildings and sells furniture.
83 | Sam
84 | • Personality and Interests: Young and energetic, Sam has a passion for music and skateboarding.
85 | • Role: Potential marriage candidate.
86 | Sandy
87 | • Personality and Interests: Friendly and upbeat, Sandy runs the store in the Calico Desert.
88 | • Role: Connects the player to desert goods and lore.
89 | Sebastian
90 | • Personality and Interests: A reclusive programmer and musician who often feels misunderstood by his family.
91 | • Role: Potential marriage candidate.
92 | Shane
93 | • Personality and Interests: Struggling with dep[2;2R[3;1R[>84;0;0cression and alcohol, Shane's journey is one of recovery and self-discovery.
94 | • Role: Works at JojaMart, potential marriage candidate.
95 | Vincent
96 | • Personality and Interests: A young and curious boy, still very innocent and in awe of the world around him.
97 | • Role: Student and younger brother to Sam.
98 | Willy
99 | • Personality and Interests: An old and seasoned fisherman who loves the sea and its mysteries.
100 | • Role: Runs the local fish shop and teaches the player to fish.
101 | Wizard
102 | • Personality and Interests: Mysterious and powerful, the Wizard studies the arcane and seeks to balance the magical elements within the valley.
103 | • Role: Offers magical insights and quests to the player.
104 | This cast of characters adds depth and vibrancy to the world of Stardew Valley, each bringing their own stories and challenges that enrich the player's experience.
105 |
--------------------------------------------------------------------------------
/demo3-KV-blending/data/sys_prompt.txt:
--------------------------------------------------------------------------------
1 | You are a helpful assistant. I will now give you a few paragraphs and please answer my question afterwards based on the content in the paragraphs
--------------------------------------------------------------------------------
/demo3-KV-blending/frontend.py:
--------------------------------------------------------------------------------
1 | import time
2 | import os, sys
3 | import numpy as np
4 | import pandas as pd
5 | import streamlit as st
6 | import chat_session
7 | from typing import List, Dict
8 | from transformers import AutoTokenizer
9 |
10 | from huggingface_hub import login
11 |
12 | # Set up the Hugging Face Hub credentials
13 | hf_token = os.getenv("HF_TOKEN")
14 | if hf_token is not None:
15 | login(token=hf_token)
16 |
17 | MODEL_NAME = "lmsys/longchat-7b-16k"
18 | PORT_LMCACHE = 8000
19 | PORT_DEFAULT = 8001
20 |
21 | @st.cache_resource
22 | def get_tokenizer():
23 | tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
24 | return tokenizer
25 |
26 |
27 | tokenizer = get_tokenizer()
28 |
29 |
30 | @st.cache_data
31 | def read_chunks(file_folder) -> Dict[str, str]:
32 | """
33 | Read all the txt files in the folder and return the filenames
34 | """
35 | filenames = os.listdir(file_folder)
36 | ret = {}
37 | for filename in filenames:
38 | if not filename.endswith("txt"):
39 | continue
40 | if filename == "sys_prompt.txt":
41 | continue
42 | key = filename.removesuffix(".txt")
43 | with open(os.path.join(file_folder, filename), "r") as fin:
44 | value = fin.read()
45 | ret[key] = value
46 |
47 | return ret
48 |
49 | chunks = read_chunks("data/")
50 | selected_chunks = st.multiselect(
51 | "Select the chunks into the context",
52 | list(chunks.keys()),
53 | default = [],
54 | placeholder = "Select in the drop-down menu")
55 |
56 | # TODO(Jiayi): add system prompt support?
57 | f = open("data/sys_prompt.txt")
58 | sys_prompt = f.read()
59 |
60 | container = st.container(border=True)
61 | #container.header("The context given to LLM:", divider = "grey")
62 |
63 |
64 | with st.sidebar:
65 | sys_container = st.container(border=True)
66 | sys_container.header("System prompt")
67 | sys_container.markdown(
68 | sys_prompt
69 | )
70 | temperature = st.slider("Temperature: ", 0.0, 1.0, 0.0)
71 | optimization = st.checkbox("Enable LMCacheBlend optimization")
72 | port = PORT_LMCACHE if optimization else PORT_DEFAULT
73 |
74 | print("The port is:", port)
75 | print("Current temparature is:", temperature)
76 |
77 | session = chat_session.ChatSession(port)
78 |
79 |
80 |
81 | session.temperature = temperature
82 | session.separator = " # # " if optimization else ""
83 |
84 | session.set_context([sys_prompt] + [chunks[key] for key in selected_chunks])
85 | num_tokens = tokenizer.encode(session.get_context())
86 | container.header(f"The context given to LLM: ({len(num_tokens)} tokens)", divider = "grey")
87 | container.text(session.get_context())
88 |
89 | messages = st.container(height=400)
90 | if prompt := st.chat_input("Type the question here"):
91 | messages.chat_message("user").write(prompt)
92 | messages.chat_message("assistant").write_stream(session.chat(prompt))
93 |
94 |
--------------------------------------------------------------------------------
/demo3-KV-blending/run-server.sh.template:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ### CHANGE THE FOLLOWING VARIABLES
4 | MODEL=mistralai/Mistral-7B-Instruct-v0.2 # LLM model name
5 | LOCAL_HF_HOME= # the HF_HOME on local machine. vLLM will try finding/dowloading the models here
6 | HF_TOKEN= # (optional) the huggingface token to access some special models
7 | PORT=8000 # Port for the server
8 | PORT2=8001
9 |
10 | sudo docker pull apostacyh/vllm:lmcache-blend
11 |
12 | # Preprocess the text chunks
13 | set -e
14 | sudo docker run --runtime nvidia --gpus '"device=0"' \
15 | -v ${LOCAL_HF_HOME}:/root/.cache/huggingface \
16 | -v `pwd`/data:/input \
17 | -v `pwd`/data:/data \
18 | --env "HF_TOKEN=${HF_TOKEN}" \
19 | --ipc=host \
20 | --network=host \
21 | --entrypoint python3 \
22 | apostacyh/vllm:lmcache-blend \
23 | /lmcache/demo/precompute.py \
24 | --model ${MODEL} --lmcache-config-file /lmcache/demo/example.yaml --data-path /input \
25 |
26 | # Start vLLM with LMCache
27 | sudo docker run --name lmcache-vllm1 --runtime nvidia --gpus '"device=0"' \
28 | -v ${LOCAL_HF_HOME}:/root/.cache/huggingface \
29 | -v `pwd`/data:/input \
30 | -v `pwd`/data:/data \
31 | --ipc=host \
32 | --network=host \
33 | -d apostacyh/vllm:lmcache-blend \
34 | --model ${MODEL} --gpu-memory-utilization 0.6 --port ${PORT} \
35 | --lmcache-config-file /lmcache/demo/example.yaml
36 |
37 | # Start vLLM without LMCache
38 | sudo docker run --name lmcache-vllm2 --runtime nvidia --gpus '"device=1"' \
39 | -v ${LOCAL_HF_HOME}:/root/.cache/huggingface \
40 | -v `pwd`/data:/input \
41 | -v `pwd`/data:/data \
42 | --ipc=host \
43 | --network=host \
44 | -d apostacyh/vllm:lmcache-blend \
45 | --model ${MODEL} --gpu-memory-utilization 0.6 --port ${PORT2}
46 |
47 |
--------------------------------------------------------------------------------
/demo3-KV-blending/stop-dockers.sh:
--------------------------------------------------------------------------------
1 | sudo docker stop lmcache-server lmcache-vllm1 lmcache-vllm2
2 | sudo docker rm lmcache-server lmcache-vllm1 lmcache-vllm2
3 | sudo rm data/cache.pt
4 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/.env:
--------------------------------------------------------------------------------
1 | # The name of the model, e.g., mistralai/Mistral-7B-Instruct-v0.2
2 | MODEL=mistralai/Mistral-7B-Instruct-v0.2
3 |
4 | # The directory on the host to store and share the KV cache
5 | KV_STORE_DIR=/tmp
6 |
7 | # Where will the models be downloaded
8 | LOCAL_HF_HOME=${HOME}/.cache/huggingface
9 |
10 | # your HF token
11 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Speedup vLLM with LMCache
3 |
4 | ## Introduction
5 |
6 | **After this quick 3-minute example, you will know how to install LMCache and demonstrate that it speeds up the inference by 6X.**
7 |
8 | 
9 |
10 |
11 | As shown in the above figure, this demo shows that different vLLM instances can share the prefix KV cache between each other by using LMCache on a single machine, so that the KV cache generated by one vLLM instance can be reused by another.
12 |
13 | Note that though this demo focuses on single-machine case, it can be generalized to allow KV cache sharing between any two vLLM instances in the cluster, as long as they have a commonly-shared NFS disk.
14 |
15 | ## Prerequisites
16 |
17 | - 4 Nvidia A6000 or A40 GPU on the same machine
18 | - Local SSD disk with peak IO bandwidth > 3GB/s (typical speed for SATA3 SSDs)
19 | - [docker compose](https://docs.docker.com/compose/install/) installed on the machine
20 | - sudo access to run ``docker compose up``
21 | - A huggingface token with access to ``mistralai/Mistral-7B-Instruct-v0.2``.
22 | - A local Python environment which can run ``pip install``.
23 | - [Docker NVIDIA Runtime](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed on the machine.
24 | > **_NOTE:_** For more information on Huggingface login, please refer to the [Huggingface documentation.](https://huggingface.co/docs/huggingface_hub/en/quick-start)_
25 |
26 | ### Run the demo
27 | ```bash
28 | $ git clone https://github.com/LMCache/demo.git
29 | $ cd demo/demo4-compare-with-vllm
30 | $ echo "HF_TOKEN=" >> .env
31 | $ pip install streamlit openai transformers sentencepiece numpy==1.26.4
32 | $ sudo docker compose up -d
33 | $ bash start_ui.sh
34 | ```
35 |
36 | Please replace with your huggingface token in the bash script above.
37 |
38 | > **_NOTE:_** If model weights are not downloaded, they might need to be dowloaded manually. This prevents
39 | multiple serving engines from downloading the same model weights and cause potential write conflicts.
40 | For this you can use:
41 |
42 | ```python
43 | from transformers import AutoModelForCausalLM, AutoTokenizer
44 |
45 | model_name = "mistralai/Mistral-7B-Instruct-v0.2"
46 | model = AutoModelForCausalLM.from_pretrained(model_name)
47 | tokenizer = AutoTokenizer.from_pretrained(model_name)
48 |
49 | cache_dir = "~/.cache/huggingface/"
50 |
51 | model.save_pretrained(cache_dir)
52 | tokenizer.save_pretrained(cache_dir)
53 | ```
54 |
55 | > **_NOTE:_** Refer to the [Model saving](https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.save_pretrained)
56 | for more information.
57 |
58 | Once you see the following line ``You can now view your Streamlit app in your browser``, open your browser
59 | and view the webUI at the following URLs:
60 |
61 | ```bash
62 | LOCAL_URL http://localhost:8501
63 | NETWORK_URL http://:8501
64 | EXTERNAL_URL http://:8501
65 | ```
66 |
67 | ### What happens when you run the demo?
68 |
69 |
70 | After you run the script above, two serving engine instances, a standard vLLM and a LMCache-enabled vLLM, are now
71 | started on two GPUs. Each instance is warmed-up with one query on a long document, which will be reused as the context later.
72 |
73 |
74 |
75 | When you open the WebUI on the browser on http://localhost:8501, it triggers the backend to start
76 | two new engine instances, a second standard vLLM and a second LMCache-enabled vLLM
77 | on the two unused GPUs. Note that the standard vLLM does not share KV cache across different GPUs.
78 |
79 |
80 |
81 |
82 |
83 | ### What steps do you need to perform?
84 |
85 | For the demo, let's issue the same query as follows to both engines, and see which one is FASTER!
86 |
87 | ``Based on the document, what's ffmpeg (answer in 10 words)``
88 |
89 | (In this case, the default context of the queries is a ``ffmpeg`` manual.)
90 |
91 | Type in the query to both Standard vLLM Engine ``(on the left)`` and LMCache + vLLM Engine (new) ``(on the right)``
92 | and see the speedup for yourself!
93 |
94 |
95 |
96 | You will see that the LMCache + vLLM Engine (New) is almost **6X faster** than the Standard vLLM Engine.
97 |
98 | ## Clean up
99 | Use ``Ctrl+C`` to terminate the frontend, and then run ``sudo docker compose down`` to shut down the service.
100 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMCache/demo/fe55964ccf26d2ad2189fafed3d98515988a72fe/demo4-compare-with-vllm/bar.png
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/chat_session.py:
--------------------------------------------------------------------------------
1 | from openai import OpenAI
2 | import threading
3 | import sys
4 | from io import StringIO
5 | import time
6 |
7 |
8 |
9 | class ChatSession:
10 | def __init__(self, ip, port, context_separator = "###"):
11 | openai_api_key = "EMPTY"
12 | openai_api_base = f"http://{ip}:{port}/v1"
13 |
14 | self.client = client = OpenAI(
15 | # defaults to os.environ.get("OPENAI_API_KEY")
16 | api_key=openai_api_key,
17 | base_url=openai_api_base,
18 | )
19 |
20 | models = client.models.list()
21 | self.model = models.data[0].id
22 |
23 | self.messages = []
24 |
25 | self.final_context = ""
26 | self.context_separator = context_separator
27 |
28 |
29 | def set_context(self, context_strings):
30 | contexts = []
31 | for context in context_strings:
32 | contexts.append(context)
33 |
34 | self.final_context = self.context_separator.join(contexts)
35 | self.on_user_message(self.final_context, display=False)
36 | self.on_server_message("Got it!", display=False)
37 |
38 | def get_context(self):
39 | return self.final_context
40 |
41 | def on_user_message(self, message, display=True):
42 | if display:
43 | print("User message:", message)
44 | self.messages.append({"role": "user", "content": message})
45 |
46 | def on_server_message(self, message, display=True):
47 | if display:
48 | print("Server message:", message)
49 | self.messages.append({"role": "assistant", "content": message})
50 |
51 | def chat(self, question,):
52 | self.on_user_message(question)
53 |
54 | start = time.perf_counter()
55 | end = None
56 | chat_completion = self.client.chat.completions.create(
57 | messages=self.messages,
58 | model=self.model,
59 | temperature=0,
60 | stream=True,
61 | stop = "\n",
62 | )
63 |
64 | output_buffer = StringIO()
65 | server_message = []
66 | for chunk in chat_completion:
67 | chunk_message = chunk.choices[0].delta.content
68 | if chunk_message is not None:
69 | if end is None:
70 | end = time.perf_counter()
71 | yield chunk_message
72 | server_message.append(chunk_message)
73 |
74 | self.on_server_message("".join(server_message))
75 | yield f"\n\n(Response delay: {end - start:.2f} seconds)"
76 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | vllm_0:
4 | image: vllm/vllm-openai:v0.6.2
5 | command: "--model ${MODEL} --gpu-memory-utilization 0.6 --port 8000"
6 | ports:
7 | - "8000:8000"
8 | environment:
9 | HF_TOKEN: ${HF_TOKEN}
10 | volumes:
11 | - ${LOCAL_HF_HOME}:/root/.cache/huggingface
12 | runtime: nvidia
13 | deploy:
14 | resources:
15 | reservations:
16 | devices:
17 | - driver: nvidia
18 | capabilities: [gpu]
19 | device_ids: ['0']
20 | ipc: host
21 |
22 | vllm_1:
23 | image: vllm/vllm-openai:v0.6.2
24 | command: "--model ${MODEL} --gpu-memory-utilization 0.6 --port 8001"
25 | ports:
26 | - "8001:8001"
27 | environment:
28 | HF_TOKEN: ${HF_TOKEN}
29 | volumes:
30 | - ${LOCAL_HF_HOME}:/root/.cache/huggingface
31 | runtime: nvidia
32 | deploy:
33 | resources:
34 | reservations:
35 | devices:
36 | - driver: nvidia
37 | capabilities: [gpu]
38 | device_ids: ['1']
39 | ipc: host
40 |
41 | lmcache_0:
42 | image: lmcache/lmcache_vllm:lmcache-0.1.4
43 | command: "${MODEL} --gpu-memory-utilization 0.6 --port 8002"
44 | ports:
45 | - "8002:8002"
46 | environment:
47 | HF_TOKEN: ${HF_TOKEN}
48 | LMCACHE_CONFIG_FILE: /etc/lmcache-config.yaml
49 | volumes:
50 | - ${KV_STORE_DIR}:/mnt/data
51 | - ${LOCAL_HF_HOME}:/root/.cache/huggingface
52 | - ./lmcache-config.yaml:/etc/lmcache-config.yaml
53 | runtime: nvidia
54 | deploy:
55 | resources:
56 | reservations:
57 | devices:
58 | - driver: nvidia
59 | capabilities: [gpu]
60 | device_ids: ['2']
61 | ipc: host
62 |
63 |
64 |
65 | lmcache_1:
66 | image: lmcache/lmcache_vllm:lmcache-0.1.4
67 | command: "${MODEL} --gpu-memory-utilization 0.6 --port 8003"
68 | ports:
69 | - "8003:8003"
70 | environment:
71 | HF_TOKEN: ${HF_TOKEN}
72 | LMCACHE_CONFIG_FILE: /etc/lmcache-config.yaml
73 | volumes:
74 | - ${KV_STORE_DIR}:/mnt/data
75 | - ${LOCAL_HF_HOME}:/root/.cache/huggingface
76 | - ./lmcache-config.yaml:/etc/lmcache-config.yaml
77 | runtime: nvidia
78 | deploy:
79 | resources:
80 | reservations:
81 | devices:
82 | - driver: nvidia
83 | capabilities: [gpu]
84 | device_ids: ['3']
85 | ipc: host
86 |
87 | # frontend_vllm_a:
88 | # build: ./frontend-docker
89 | # ports:
90 | # - "8502:8501"
91 | # command: ["vllm_0", "8000", "Original vLLM (A)", "0"]
92 |
93 | # frontend_vllm_b:
94 | # build: ./frontend-docker
95 | # ports:
96 | # - "8502:8501"
97 | # command: ["vllm_1", "8001", "Original vLLM (B)", "0"]
98 |
99 | # frontend_lmcache_a:
100 | # build: ./frontend-docker
101 | # ports:
102 | # - "8501:8501"
103 | # command: ["lmcache_0", "8002", "vLLM w/ LMCache (A)", "1"]
104 |
105 | # frontend_lmcache_b:
106 | # build: ./frontend-docker
107 | # ports:
108 | # - "8503:8501"
109 | # command: ["lmcache_1", "8003", "vLLM w/ LMCache (B)", "1"]
110 |
111 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/frontend-double.py:
--------------------------------------------------------------------------------
1 | import time
2 | import os, sys
3 | import numpy as np
4 | import pandas as pd
5 | import streamlit as st
6 | import chat_session
7 | from typing import List, Dict
8 | from transformers import AutoTokenizer
9 |
10 | #st.set_page_config(layout="wide")
11 |
12 | # Change the following variables as needed
13 | MODEL_NAME = "lmsys/longchat-7b-16k"
14 |
15 | #if len(sys.argv) != 5:
16 | # print(f"Usage: streamlit run {sys.argv[0]} ")
17 | # exit(-1)
18 |
19 |
20 | #IP = sys.argv[1]
21 | #PORT = int(sys.argv[2])
22 | #ENGINE_NAME = sys.argv[3]
23 |
24 | IP_VLLM = "localhost"
25 | IP_LMCACHE = "localhost"
26 | PORT_VLLM = "8001"
27 | PORT_LMCACHE = "8003"
28 |
29 |
30 | @st.cache_resource
31 | def PrepareEngines():
32 | def consume_stream(stream):
33 | for s in stream:
34 | print(s, end = "", flush = True)
35 | print("")
36 |
37 | preheat_context = "This is dummy text. " * 750
38 | session1 = chat_session.ChatSession(IP_VLLM, PORT_VLLM)
39 | session2 = chat_session.ChatSession(IP_LMCACHE, PORT_LMCACHE)
40 | session1.set_context([preheat_context])
41 | session2.set_context([preheat_context])
42 | stream1 = session1.chat("Please just say 'hello': ")
43 | stream2 = session2.chat("Please just say 'hello': ")
44 | consume_stream(stream1)
45 | consume_stream(stream2)
46 | stream1 = session1.chat("Please just say 'hey': ")
47 | stream2 = session1.chat("Please just say 'hey': ")
48 | consume_stream(stream1)
49 | consume_stream(stream2)
50 |
51 | global MODEL_NAME
52 | tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, use_fast=False)
53 | return tokenizer
54 |
55 | tokenizer = PrepareEngines()
56 |
57 | @st.cache_data
58 | def read_context() -> str:
59 | with open("context.txt", "r") as fin:
60 | context = fin.read()
61 | return context
62 |
63 | context = read_context()
64 |
65 |
66 | gap_width = 0.013
67 | col_width = (1 - gap_width) / 2
68 | col1, col3, col2 = st.columns([col_width, gap_width, col_width], gap="small")
69 |
70 | with col3:
71 | st.text("")
72 | st.image("bar.png", use_container_width=True)
73 |
74 | with col1:
75 | port = PORT_VLLM
76 | ip = IP_VLLM
77 |
78 | st.markdown("#### Standard vLLM engine")
79 |
80 | session = chat_session.ChatSession(ip, port)
81 |
82 | system_prompt = "You are a helpful assistant. I will now give you a document and please answer my question afterwards based on the content in document"
83 |
84 | session.set_context([system_prompt] + [context])
85 | num_tokens = tokenizer.encode(session.get_context())
86 |
87 | messages = st.container(height=300)
88 | if prompt := st.chat_input("Type your question about this document", key = "vllm"):
89 | messages.chat_message("user").write(prompt)
90 | messages.chat_message("assistant").write_stream(session.chat(prompt))
91 |
92 | with col2:
93 | port = PORT_LMCACHE
94 | ip = IP_LMCACHE
95 |
96 | st.markdown("#### LMCache + vLLM engine (new)")
97 |
98 | session = chat_session.ChatSession(ip, port)
99 |
100 | system_prompt = "You are a helpful assistant. I will now give you a document and please answer my question afterwards based on the content in document"
101 |
102 | session.set_context([system_prompt] + [context])
103 | num_tokens = tokenizer.encode(session.get_context())
104 |
105 | messages = st.container(height=300)
106 | if prompt := st.chat_input("Type your question about this document", key = "lmcache"):
107 | messages.chat_message("user").write(prompt)
108 | messages.chat_message("assistant").write_stream(session.chat(prompt))
109 |
110 | container = st.container(border=True, height = 300)
111 | container.markdown("#### Background Document:")
112 | container.markdown("**13K words, 25K tokens**") #, divider = "grey")
113 | container.text("\n" + context)
114 |
115 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/imgs/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMCache/demo/fe55964ccf26d2ad2189fafed3d98515988a72fe/demo4-compare-with-vllm/imgs/architecture.png
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/imgs/contrast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMCache/demo/fe55964ccf26d2ad2189fafed3d98515988a72fe/demo4-compare-with-vllm/imgs/contrast.png
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/imgs/demo_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMCache/demo/fe55964ccf26d2ad2189fafed3d98515988a72fe/demo4-compare-with-vllm/imgs/demo_4.png
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/imgs/result_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMCache/demo/fe55964ccf26d2ad2189fafed3d98515988a72fe/demo4-compare-with-vllm/imgs/result_1.png
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/imgs/result_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMCache/demo/fe55964ccf26d2ad2189fafed3d98515988a72fe/demo4-compare-with-vllm/imgs/result_2.png
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/lmcache-config.yaml:
--------------------------------------------------------------------------------
1 | chunk_size: 256
2 | local_device: "file:///mnt/data/"
3 |
4 | # Whether retrieve() is pipelined or not
5 | pipelined_backend: False
6 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/preprocess.py:
--------------------------------------------------------------------------------
1 | import time
2 | import os, sys
3 | import numpy as np
4 | import pandas as pd
5 | import chat_session
6 | from typing import List, Dict
7 |
8 | #st.set_page_config(layout="wide")
9 |
10 | # Change the following variables as needed
11 | MODEL_NAME = "lmsys/longchat-7b-16k"
12 |
13 | #if len(sys.argv) != 5:
14 | # print(f"Usage: streamlit run {sys.argv[0]} ")
15 | # exit(-1)
16 |
17 |
18 | #IP = sys.argv[1]
19 | #PORT = int(sys.argv[2])
20 | #ENGINE_NAME = sys.argv[3]
21 |
22 | IP_VLLM = "localhost"
23 | IP_LMCACHE = "localhost"
24 | PORT_VLLM = "8000"
25 | PORT_LMCACHE = "8002"
26 |
27 |
28 | def PrepareEngines(contexts):
29 | def consume_stream(stream):
30 | for s in stream:
31 | print(s, end = "", flush = True)
32 | print("")
33 |
34 | session1 = chat_session.ChatSession(IP_LMCACHE, PORT_LMCACHE)
35 | session2 = chat_session.ChatSession(IP_VLLM, PORT_VLLM)
36 | session1.set_context(contexts)
37 | session2.set_context(contexts)
38 | stream1 = session1.chat("Please just say 'hello': ")
39 | stream2 = session2.chat("Please just say 'hello': ")
40 | consume_stream(stream1)
41 | consume_stream(stream2)
42 |
43 | def read_context() -> str:
44 | with open("context.txt", "r") as fin:
45 | context = fin.read()
46 | return context
47 |
48 | context = read_context()
49 | system_prompt = "You are a helpful assistant. I will now give you a document and please answer my question afterwards based on the content in document"
50 | PrepareEngines([system_prompt, context])
51 | time.sleep(5)
52 |
--------------------------------------------------------------------------------
/demo4-compare-with-vllm/start_ui.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | timeout 300 bash -c 'until curl -X POST localhost:8002/v1/completions > /dev/null 2>&1;
5 | do
6 | echo "waiting for server to start..."
7 | sleep 1
8 | done'
9 |
10 | python3 preprocess.py
11 | streamlit run frontend-double.py
12 |
--------------------------------------------------------------------------------