15
15
// See the License for the specific language governing permissions and
16
16
// limitations under the License.
17
17
18
+ #include " flags.h"
18
19
#include " debug.h"
19
20
#include " llama.cpp/cores.h"
20
21
#include " llamafile.h"
@@ -47,7 +48,7 @@ bool FLAG_trace = false;
47
48
bool FLAG_unsecure = false ;
48
49
const char *FLAG_file = nullptr ;
49
50
const char *FLAG_ip_header = nullptr ;
50
- const char *FLAG_listen = " 0 .0.0.0 :8080" ;
51
+ const char *FLAG_listen = " 127 .0.0.1 :8080" ;
51
52
const char *FLAG_model = nullptr ;
52
53
const char *FLAG_prompt = nullptr ;
53
54
const char *FLAG_url_prefix = " " ;
@@ -74,6 +75,8 @@ int FLAG_verbose = 0;
74
75
int FLAG_warmup = true ;
75
76
int FLAG_workers;
76
77
78
+ std::vector<std::string> FLAG_headers;
79
+
77
80
static wontreturn void usage (int rc, int fd) {
78
81
tinyprint (fd, " usage: " , program_invocation_name, " -m MODEL -l [HOST:]PORT\n " , NULL );
79
82
exit (rc);
@@ -236,6 +239,13 @@ void llamafile_get_flags(int argc, char **argv) {
236
239
continue ;
237
240
}
238
241
242
+ if (!strcmp (flag, " -H" ) || !strcmp (flag, " --header" )) {
243
+ if (i == argc)
244
+ missing (" --header" );
245
+ FLAG_headers.push_back (argv[i++]);
246
+ continue ;
247
+ }
248
+
239
249
if (!strcmp (flag, " --http-ibuf-size" )) {
240
250
if (i == argc)
241
251
missing (" --http-ibuf-size" );
0 commit comments