mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-24 12:35:00 +00:00
feat: add --single-active-backend to allow only one backend active at the time (#925)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
1079b18ff7
commit
afdc0ebfd7
20 changed files with 238 additions and 164 deletions
|
@ -17,8 +17,9 @@ type Options struct {
|
|||
|
||||
externalBackends map[string]string
|
||||
|
||||
grpcAttempts int
|
||||
grpcAttemptsDelay int
|
||||
grpcAttempts int
|
||||
grpcAttemptsDelay int
|
||||
singleActiveBackend bool
|
||||
}
|
||||
|
||||
type Option func(*Options)
|
||||
|
@ -80,6 +81,12 @@ func WithContext(ctx context.Context) Option {
|
|||
}
|
||||
}
|
||||
|
||||
func WithSingleActiveBackend() Option {
|
||||
return func(o *Options) {
|
||||
o.singleActiveBackend = true
|
||||
}
|
||||
}
|
||||
|
||||
func NewOptions(opts ...Option) *Options {
|
||||
o := &Options{
|
||||
gRPCOptions: &pb.ModelOptions{},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue