Skip to content

Commit

Permalink
add Capacity field to aiModels.json to override capacity for external…
Browse files Browse the repository at this point in the history
… containers
  • Loading branch information
ad-astra-video committed Sep 12, 2024
1 parent 78cd031 commit 0167dec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,11 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
//external containers are expected to manage multiple runners and auto scale to extent of supply.
//increase capacity to upper limit per external container
if config.URL != "" {
modelConstraint.Capacity = 100
if config.Capacity == 0 {
modelConstraint.Capacity = 1
} else {
modelConstraint.Capacity = config.Capacity
}
}
// If the config contains a URL we call Warm() anyway because AIWorker will just register
// the endpoint for an external container
Expand Down
1 change: 1 addition & 0 deletions core/ai.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type AIModelConfig struct {
URL string `json:"url,omitempty"`
Token string `json:"token,omitempty"`
Warm bool `json:"warm,omitempty"`
Capacity int `json:"capacity,omitempty"`
OptimizationFlags worker.OptimizationFlags `json:"optimization_flags,omitempty"`
//used by orchestrator
Gateway string `json:"gateway"`
Expand Down

0 comments on commit 0167dec

Please sign in to comment.