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

Problems with API Hostname Configuration Leading to Connection Errors in OpenRouter.ai #220

Open
lukcz opened this issue Sep 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lukcz
Copy link

lukcz commented Sep 29, 2024

Description

When attempting to configure OpenRouter.ai as an OpenAI-compatible API, the setup fails due to problems with the API Hostname and Port API configurations. Specifically, the hostname gets truncated, and incorrect port settings result in connection errors.


Steps to Reproduce

  1. Access Configuration Page:

    • Navigate to the OpenRouter.ai API configuration interface intended for setting up an OpenAI-compatible API.
  2. Attempt Configuration with Protocol in Hostname:

    • API Hostname: https://openrouter.ai/api/
    • Port API: 443 (Automatically set)
    • Result: Hostname is truncated, and an error Cannot connect to host https:80 is displayed.

    Error with Protocol in Hostname

  3. Attempt Configuration Without Protocol:

    • API Hostname: openrouter.ai/api/
    • Port API: Leave empty
    • Result: https:// is automatically prefixed, and port 443 is appended, causing configuration issues for remote services.

    Forced HTTPS and Port Configuration


Expected Behavior

The configuration interface should allow users to specify the full API hostname, including the protocol (http:// or https://) and the port number, without forcing default values. This flexibility should support both local and remote service configurations.


Actual Behavior

  • Hostname Truncation: Including the protocol in the API Hostname results in the hostname being truncated, leading to connection errors.
  • Forced Defaults: The interface automatically appends https:// and port 443, overriding user inputs and preventing proper configuration of remote services.

Suggested Fix

Remove the separate Port API and Use HTTPS options from the configuration interface. Instead, allow users to define the protocol and port directly within the API Hostname field. This change provides greater flexibility and accommodates various deployment scenarios.

Proposed Configuration Examples:

  • Local Service with HTTP:

    • API Hostname: http://localhost:80
  • Local Service with HTTPS:

    • API Hostname: https://localhost:443
  • Remote Service (e.g., OpenRouter):

    • API Hostname: https://openrouter.ai/api
@lukcz lukcz added the bug Something isn't working label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant