mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat: add API_KEY list support (#877)
Co-authored-by: Harold Sun <sunhua@amazon.com>
This commit is contained in:
parent
8c781a6a44
commit
1d1cae8e4d
3 changed files with 59 additions and 19 deletions
6
main.go
6
main.go
|
@ -130,6 +130,11 @@ func main() {
|
|||
EnvVars: []string{"UPLOAD_LIMIT"},
|
||||
Value: 15,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "api-keys",
|
||||
Usage: "List of API Keys to enable API authentication. When this is set, all the requests must be authenticated with one of these API keys.",
|
||||
EnvVars: []string{"API_KEY"},
|
||||
},
|
||||
},
|
||||
Description: `
|
||||
LocalAI is a drop-in replacement OpenAI API which runs inference locally.
|
||||
|
@ -167,6 +172,7 @@ For a list of compatible model, check out: https://localai.io/model-compatibilit
|
|||
options.WithBackendAssets(backendAssets),
|
||||
options.WithBackendAssetsOutput(ctx.String("backend-assets-path")),
|
||||
options.WithUploadLimitMB(ctx.Int("upload-limit")),
|
||||
options.WithApiKeys(ctx.StringSlice("api-keys")),
|
||||
}
|
||||
|
||||
externalgRPC := ctx.StringSlice("external-grpc-backends")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue