Using Custom LLM

I was working on a data analyst agent, and I want to use a custom LLM. I have a model hosted on a server with a URL, and I need to use the LLM via that URL. I tried creating a custom class, but it did not work.