Skip to content

Remove the models not specified in the values file #177

@Fabhiahn

Description

@Fabhiahn

Is your feature request related to a problem? Please describe

I think there should be an option to automatically remove models present on the disk but not specified in the values file, to avoid outdated models lingering on the system and wasting disk space.

Describe the solution you'd like

Similarly to how .Values.ollama.models are used in deployment postStart hook to pull and run specific models, it would be useful to also check which models are currently present and compare them to the desired list. If any extra models are found, they could be removed automatically. This behavior should be optional and controlled via a flag in values.yaml. This would help keep disk usage under control and ensure the environment stays in sync with the declared config.

Describe alternatives you've considered

I currently implement this cleanup using an init container, but it would be cleaner and more integrated if this option existed natively within the postStart lifecycle hook.

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions