MCPcopy
hub / github.com/mudler/LocalAI / OnFirstComplete

Method OnFirstComplete

core/services/nodes/inflight.go:63–65  ·  view source on GitHub ↗

OnFirstComplete registers a callback that fires once after the first tracked inference call completes. This is used to release the initial in-flight reservation (set during model load) after the triggering request finishes, so that in-flight returns to 0 when the model is idle.

(fn func())

Source from the content-addressed store, hash-verified

61// reservation (set during model load) after the triggering request finishes,
62// so that in-flight returns to 0 when the model is idle.
63func (c *InFlightTrackingClient) OnFirstComplete(fn func()) {
64 c.onFirstComplete = fn
65}
66
67func (c *InFlightTrackingClient) track(ctx context.Context) func() {
68 if err := c.registry.IncrementInFlight(ctx, c.nodeID, c.modelName, c.replicaIndex); err != nil {

Callers 2

RouteMethod · 0.95
inflight_test.goFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected