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

Struct ConnectionEvictingClient

pkg/model/connection_evicting_client.go:18–23  ·  view source on GitHub ↗

ConnectionEvictingClient wraps a grpc.Backend. When any inference method fails with a connection error (server unreachable), it calls the evict callback to remove the model from the ModelLoader's cache. The error is still returned to the caller — the NEXT request will trigger rescheduling via SmartR

Source from the content-addressed store, hash-verified

16// still returned to the caller — the NEXT request will trigger rescheduling
17// via SmartRouter.
18type ConnectionEvictingClient struct {
19 grpc.Backend
20 modelID string
21 evict func()
22 once sync.Once
23}
24
25func newConnectionEvictingClient(inner grpc.Backend, modelID string, evict func()) grpc.Backend {
26 return &ConnectionEvictingClient{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected