Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http Local server #61

Open
Khampol opened this issue Nov 9, 2024 · 1 comment
Open

Http Local server #61

Khampol opened this issue Nov 9, 2024 · 1 comment

Comments

@Khampol
Copy link

Khampol commented Nov 9, 2024

I have my own local server llm. How enter ip ? Actually it do not work.

image

BTW where these models location? They are loaded by Comfy itself or ? ....

image

@HiyungXu
Copy link

    def init_client(self, address: str, api_type: str) -> Tuple[OmostLLMServer]:
        """Initialize LLM client with HTTP server address."""

        if api_type == "OpenAI":
            if address.endswith("v1"):
                server_address = address
            else:
                server_address = os.path.join(address, "v1")
        
            model_id = ""

        elif api_type == "TGI":
            if address.endswith("v1"):
                server_address = address
                server_info_url = address.replace("v1", "info")
            else:
                server_address = os.path.join(address, "v1")
                server_info_url = os.path.join(address, "info")
            #Get model_id from server info
            server_info = requests.get(server_info_url, timeout=5).json()
            model_id = server_info["model_id"]

        client = OpenAI(base_url=server_address, api_key="_")

        return (OmostLLMServer(client, model_id),)

I think the author has not finished this code yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants