@@ -110,20 +110,27 @@ function getQuantTag(filepath?: string): string {
110110}
111111
112112const snippetLlamacpp = ( model : ModelData , filepath ?: string ) : LocalAppSnippet [ ] => {
113- const command = ( binary : string ) => {
114- const snippet = [ "# Load and run the model:" , `${ binary } -hf ${ model . id } ${ getQuantTag ( filepath ) } ` ] ;
113+ const serverCommand = ( binary : string ) => {
114+ const snippet = [
115+ "# Start a local OpenAI-compatible server with a web UI:" ,
116+ `${ binary } -hf ${ model . id } ${ getQuantTag ( filepath ) } ` ,
117+ ] ;
118+ return snippet . join ( "\n" ) ;
119+ } ;
120+ const cliCommand = ( binary : string ) => {
121+ const snippet = [ "# Run inference directly in the terminal:" , `${ binary } -hf ${ model . id } ${ getQuantTag ( filepath ) } ` ] ;
115122 return snippet . join ( "\n" ) ;
116123 } ;
117124 return [
118125 {
119126 title : "Install from brew" ,
120127 setup : "brew install llama.cpp" ,
121- content : command ( "llama-server" ) ,
128+ content : [ serverCommand ( "llama-server" ) , cliCommand ( "llama-cli" ) ] ,
122129 } ,
123130 {
124131 title : "Install from WinGet (Windows)" ,
125132 setup : "winget install llama.cpp" ,
126- content : command ( "llama-server" ) ,
133+ content : [ serverCommand ( "llama-server" ) , cliCommand ( "llama-cli" ) ] ,
127134 } ,
128135 {
129136 title : "Use pre-built binary" ,
@@ -132,17 +139,17 @@ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[]
132139 "# Download pre-built binary from:" ,
133140 "# https://github.com/ggerganov/llama.cpp/releases" ,
134141 ] . join ( "\n" ) ,
135- content : command ( "./llama-server" ) ,
142+ content : [ serverCommand ( "./llama-server" ) , cliCommand ( "./llama-cli" ) ] ,
136143 } ,
137144 {
138145 title : "Build from source code" ,
139146 setup : [
140147 "git clone https://github.com/ggerganov/llama.cpp.git" ,
141148 "cd llama.cpp" ,
142149 "cmake -B build" ,
143- "cmake --build build -j --target llama-server" ,
150+ "cmake --build build -j --target llama-server llama-cli " ,
144151 ] . join ( "\n" ) ,
145- content : command ( "./build/bin/llama-server" ) ,
152+ content : [ serverCommand ( "./build/bin/llama-server" ) , cliCommand ( "./build/bin/llama-cli" ) ] ,
146153 } ,
147154 ] ;
148155} ;
0 commit comments