1010
1111import typer
1212
13- from graphrag .config .defaults import graphrag_config_defaults
13+ from graphrag .config .defaults import (
14+ DEFAULT_CHAT_MODEL ,
15+ DEFAULT_EMBEDDING_MODEL ,
16+ graphrag_config_defaults ,
17+ )
1418from graphrag .config .enums import IndexingMethod , SearchMethod
1519from graphrag .prompt_tune .defaults import LIMIT , MAX_TOKEN_COUNT , N_SUBSET_MAX , K
1620from graphrag .prompt_tune .types import DocSelectionType
@@ -104,6 +108,18 @@ def _initialize_cli(
104108 resolve_path = True ,
105109 autocompletion = ROOT_AUTOCOMPLETE ,
106110 ),
111+ model : str = typer .Option (
112+ DEFAULT_CHAT_MODEL ,
113+ "--model" ,
114+ "-m" ,
115+ prompt = "Specify the default chat model to use" ,
116+ ),
117+ embedding_model : str = typer .Option (
118+ DEFAULT_EMBEDDING_MODEL ,
119+ "--embedding" ,
120+ "-e" ,
121+ prompt = "Specify the default embedding model to use" ,
122+ ),
107123 force : bool = typer .Option (
108124 False ,
109125 "--force" ,
@@ -114,7 +130,9 @@ def _initialize_cli(
114130 """Generate a default configuration file."""
115131 from graphrag .cli .initialize import initialize_project_at
116132
117- initialize_project_at (path = root , force = force )
133+ initialize_project_at (
134+ path = root , force = force , model = model , embedding_model = embedding_model
135+ )
118136
119137
120138@app .command ("index" )
@@ -143,11 +161,6 @@ def _index_cli(
143161 "-v" ,
144162 help = "Run the indexing pipeline with verbose logging" ,
145163 ),
146- memprofile : bool = typer .Option (
147- False ,
148- "--memprofile" ,
149- help = "Run the indexing pipeline with memory profiling" ,
150- ),
151164 dry_run : bool = typer .Option (
152165 False ,
153166 "--dry-run" ,
@@ -173,7 +186,6 @@ def _index_cli(
173186 index_cli (
174187 root_dir = root ,
175188 verbose = verbose ,
176- memprofile = memprofile ,
177189 cache = cache ,
178190 dry_run = dry_run ,
179191 skip_validation = skip_validation ,
@@ -207,11 +219,6 @@ def _update_cli(
207219 "-v" ,
208220 help = "Run the indexing pipeline with verbose logging." ,
209221 ),
210- memprofile : bool = typer .Option (
211- False ,
212- "--memprofile" ,
213- help = "Run the indexing pipeline with memory profiling." ,
214- ),
215222 cache : bool = typer .Option (
216223 True ,
217224 "--cache/--no-cache" ,
@@ -233,7 +240,6 @@ def _update_cli(
233240 update_cli (
234241 root_dir = root ,
235242 verbose = verbose ,
236- memprofile = memprofile ,
237243 cache = cache ,
238244 skip_validation = skip_validation ,
239245 method = method ,
0 commit comments