You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`-spf FNAME`, `--system-prompt-file FNAME` Set a file to load a system prompt (initial prompt of all slots), this is useful for chat applications. [See more](#change-system-prompt-on-runtime)
30
+
-
29
31
30
32
## Build
31
33
@@ -164,7 +166,7 @@ node index.js
164
166
165
167
`cache_prompt`: Save the prompt and generation for avoid reprocess entire prompt if a part of this isn't change (default: false)
166
168
167
-
`system_prompt`: Change the system prompt (initial prompt of all slots), this is useful for chat applications.
169
+
`system_prompt`: Change the system prompt (initial prompt of all slots), this is useful for chat applications.[See more](#change-system-prompt-on-runtime)
168
170
169
171
-**POST**`/tokenize`: Tokenize a given text.
170
172
@@ -196,8 +198,32 @@ node index.js
196
198
197
199
It also accepts all the options of `/completion` except `stream` and `prompt`.
198
200
201
+
-**GET**`/props`: Return the required assistant name and anti-prompt to generate the prompt in case you have specified a system prompt for all slots.
202
+
199
203
## More examples
200
204
205
+
### Change system prompt on runtime
206
+
207
+
To use the server example to serve multiple chat-type clients while keeping the same system prompt, you can utilize the option `system_prompt` to achieve that. This only needs to be done once to establish it.
208
+
209
+
`prompt`: Specify a context that you want all connecting clients to respect.
210
+
211
+
`anti_prompt`: Specify the word you want to use to instruct the model to stop. This must be sent to each client through the `/props` endpoint.
212
+
213
+
`assistant_name`: The bot's name is necessary for each customer to generate the prompt. This must be sent to each client through the `/props` endpoint.
214
+
215
+
```json
216
+
{
217
+
"system_prompt": {
218
+
"prompt": "Transcript of a never ending dialog, where the User interacts with an Assistant.\nThe Assistant is helpful, kind, honest, good at writing, and never fails to answer the User's requests immediately and with precision.\nUser: Recommend a nice restaurant in the area.\nAssistant: I recommend the restaurant \"The Golden Duck\". It is a 5 star restaurant with a great view of the city. The food is delicious and the service is excellent. The prices are reasonable and the portions are generous. The restaurant is located at 123 Main Street, New York, NY 10001. The phone number is (212) 555-1234. The hours are Monday through Friday from 11:00 am to 10:00 pm. The restaurant is closed on Saturdays and Sundays.\nUser: Who is Richard Feynman?\nAssistant: Richard Feynman was an American physicist who is best known for his work in quantum mechanics and particle physics. He was awarded the Nobel Prize in Physics in 1965 for his contributions to the development of quantum electrodynamics. He was a popular lecturer and author, and he wrote several books, including \"Surely You're Joking, Mr. Feynman!\" and \"What Do You Care What Other People Think?\".\nUser:",
219
+
"anti_prompt": "User:",
220
+
"assistant_name": "Assistant:"
221
+
}
222
+
}
223
+
```
224
+
225
+
**NOTE**: You can do this automatically when starting the server by simply creating a .json file with these options and using the CLI option `-spf FNAME` or `--system-prompt-file FNAME`.
0 commit comments