acon96 / home-llm

A Home Assistant integration & Model to control your smart home using a Local LLM
483 stars 56 forks source link

Added Option to use port 0 to be able to use non local services #152

Closed fixtse closed 3 weeks ago

fixtse commented 1 month ago

Added a validation to skip adding the port to the OpenAI compatible API URL if port 0 is used. This will allow users to use external services, like OpenRouter with the integration.

I realize this might not be the best way to implement it, since it's not obvious to the user, but it works.

acon96 commented 1 month ago

I would rather just make the port field optional in the setup flow and if no port is provided then it would default to leaving out that part of the URL entirely.

descention commented 4 weeks ago

Could you do the int() conversion inline, f"{int(port)}" and test port directly from its configuration with if port? I don't know enough for the language to know this myself.