@@ -93,6 +93,8 @@ type Diffusers struct {
93
93
ControlNet string `yaml:"control_net"`
94
94
}
95
95
96
+ // LLMConfig is a struct that holds the configuration that are
97
+ // generic for most of the LLM backends.
96
98
type LLMConfig struct {
97
99
SystemPrompt string `yaml:"system_prompt"`
98
100
TensorSplit string `yaml:"tensor_split"`
@@ -144,20 +146,39 @@ type LLMConfig struct {
144
146
YarnBetaSlow float32 `yaml:"yarn_beta_slow"`
145
147
}
146
148
149
+ // AutoGPTQ is a struct that holds the configuration specific to the AutoGPTQ backend
147
150
type AutoGPTQ struct {
148
151
ModelBaseName string `yaml:"model_base_name"`
149
152
Device string `yaml:"device"`
150
153
Triton bool `yaml:"triton"`
151
154
UseFastTokenizer bool `yaml:"use_fast_tokenizer"`
152
155
}
153
156
157
+ // TemplateConfig is a struct that holds the configuration of the templating system
154
158
type TemplateConfig struct {
155
- Chat string `yaml:"chat"`
156
- ChatMessage string `yaml:"chat_message"`
157
- Completion string `yaml:"completion"`
158
- Edit string `yaml:"edit"`
159
- Functions string `yaml:"function"`
160
- UseTokenizerTemplate bool `yaml:"use_tokenizer_template"`
159
+ // Chat is the template used in the chat completion endpoint
160
+ Chat string `yaml:"chat"`
161
+
162
+ // ChatMessage is the template used for chat messages
163
+ ChatMessage string `yaml:"chat_message"`
164
+
165
+ // Completion is the template used for completion requests
166
+ Completion string `yaml:"completion"`
167
+
168
+ // Edit is the template used for edit completion requests
169
+ Edit string `yaml:"edit"`
170
+
171
+ // Functions is the template used when tools are present in the client requests
172
+ Functions string `yaml:"function"`
173
+
174
+ // UseTokenizerTemplate is a flag that indicates if the tokenizer template should be used.
175
+ // Note: this is mostly consumed for backends such as vllm and transformers
176
+ // that can use the tokenizers specified in the JSON config files of the models
177
+ UseTokenizerTemplate bool `yaml:"use_tokenizer_template"`
178
+
179
+ // JoinChatMessagesByCharacter is a string that will be used to join chat messages together.
180
+ // It defaults to \n
181
+ JoinChatMessagesByCharacter * string `yaml:"join_chat_messages_by_character"`
161
182
}
162
183
163
184
func (c * BackendConfig ) SetFunctionCallString (s string ) {
0 commit comments