r/homeassistant • u/Frosty-Piccolo-7889 • 2d ago
❓ Support ML models
hello everyone. i want to implement 6 ml models in home assistant for a project in parallel systems.
I want the user to be able to chose what model to use for each room. Is it better to create a container for each model or should i load all 6 in one container and use threads and a state dictionary per room that holds that room's enabled models? The models are interconnected so the output of ml1 is needed as input in ml2 and so on.
0
Upvotes
2
u/diptherial 2d ago
First, I wonder if this would be better posted elsewhere than r/homeassistant ? Seems like it's more about running models, which AFAIK isn't something Home Assistant does natively.
As for your question, I think we need more information about what these models are and what you mean by "containers"; if you mean Docker containers, they'll be isolated within their own process and won't be able to share anything, but if they're truly distinct models that won't matter much. As for the inputs/outputs, this again depends on what these models are, but if they're LLMs you'd typically be ferrying data between them anyway outside of the model runner, so whether there's one container or many of them doesn't matter much.
3
u/cmaxwe 2d ago
You could probably host all the models in a single container. Serve them up via http (FastAPI) and just have a different endpoint for each model/room.
Would hit something like POST http://model-server/model1 with a the data in json and return a json with the results.