nsarrazin HF Staff commited on
Commit
3caf53f
·
1 Parent(s): 4384b2b

feat: add section about `reasoning` field in README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -0
README.md CHANGED
@@ -909,6 +909,60 @@ MODELS=`[
909
  ]
910
  }
911
  ]`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
912
  ```
913
 
914
  ## Common issues
 
909
  ]
910
  }
911
  ]`
912
+
913
+ ```
914
+
915
+ ### Reasoning Models
916
+
917
+ ChatUI supports specialized reasoning/Chain-of-Thought (CoT) models through the `reasoning` configuration field. When properly configured, this displays a UI widget that allows users to view or collapse the model’s reasoning steps. We support three types of reasoning parsing:
918
+
919
+ #### Token-Based Delimitations
920
+
921
+ For models like DeepSeek R1, token-based delimitations can be used to identify reasoning steps. This is done by specifying the `beginToken` and `endToken` fields in the `reasoning` configuration.
922
+
923
+ Example configuration for DeepSeek R1 (token-based):
924
+
925
+ ```json
926
+ {
927
+ "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
928
+ // ...
929
+ "reasoning": {
930
+ "type": "tokens",
931
+ "beginToken": "<think>",
932
+ "endToken": "</think>"
933
+ }
934
+ }
935
+ ```
936
+
937
+ #### Summarizing the Chain of Thought
938
+
939
+ For models like QwQ, which return a chain of thought but do not explicitly provide a final answer, the `summarize` type can be used. This automatically summarizes the reasoning steps using the `TASK_MODEL` (or the first model in the configuration if `TASK_MODEL` is not specified) and displays the summary as the final answer.
940
+
941
+ Example configuration for QwQ (summarize-based):
942
+
943
+ ```json
944
+ {
945
+ "name": "Qwen/QwQ-32B-Preview",
946
+ // ...
947
+ "reasoning": {
948
+ "type": "summarize"
949
+ }
950
+ }
951
+ ```
952
+
953
+ #### Regex-Based Delimitations
954
+
955
+ In some cases, the final answer can be extracted from the model output using a regular expression. This is achieved by specifying the `regex` field in the `reasoning` configuration. For example, if your model wraps the final answer in a `\boxed{}` tag, you can use the following configuration:
956
+
957
+ ```json
958
+ {
959
+ "name": "model/yourmodel",
960
+ // ...
961
+ "reasoning": {
962
+ "type": "regex",
963
+ "regex": "\\\\boxed\\{(.+?)\\}"
964
+ }
965
+ }
966
  ```
967
 
968
  ## Common issues