File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 4
4
uploads
5
5
.ipynb_checkpoints
6
6
* .db
7
- _test
7
+ _test
8
+ ! /data
9
+ /data /*
10
+ ! /data /litellm
11
+ /data /litellm /*
12
+ ! data /litellm /config.yaml
13
+
14
+ ! data /config.json
Original file line number Diff line number Diff line change 6
6
7
7
from pathlib import Path
8
8
import json
9
+ import yaml
10
+
9
11
import markdown
10
12
import requests
11
13
import shutil
@@ -163,6 +165,40 @@ def parse_section(section):
163
165
DOCS_DIR = f"{ DATA_DIR } /docs"
164
166
Path (DOCS_DIR ).mkdir (parents = True , exist_ok = True )
165
167
168
+
169
+ ####################################
170
+ # LITELLM_CONFIG
171
+ ####################################
172
+
173
+
174
+ def create_config_file (file_path ):
175
+ directory = os .path .dirname (file_path )
176
+
177
+ # Check if directory exists, if not, create it
178
+ if not os .path .exists (directory ):
179
+ os .makedirs (directory )
180
+
181
+ # Data to write into the YAML file
182
+ config_data = {
183
+ "general_settings" : {},
184
+ "litellm_settings" : {},
185
+ "model_list" : [],
186
+ "router_settings" : {},
187
+ }
188
+
189
+ # Write data to YAML file
190
+ with open (file_path , "w" ) as file :
191
+ yaml .dump (config_data , file )
192
+
193
+
194
+ LITELLM_CONFIG_PATH = f"{ DATA_DIR } /litellm/config.yaml"
195
+
196
+ if not os .path .exists (LITELLM_CONFIG_PATH ):
197
+ print ("Config file doesn't exist. Creating..." )
198
+ create_config_file (LITELLM_CONFIG_PATH )
199
+ print ("Config file created successfully." )
200
+
201
+
166
202
####################################
167
203
# OLLAMA_API_BASE_URL
168
204
####################################
You can’t perform that action at this time.
0 commit comments