janhq / jan

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer. Multiple engine support (llama.cpp, TensorRT-LLM)
https://jan.ai/
GNU Affero General Public License v3.0
23.82k stars 1.39k forks source link

feat: Allow HTTP proxy authentication inputs #4047

Open louis-jan opened 1 week ago

louis-jan commented 1 week ago

Specs

Problem Statement

Cortex.cpp now supports proxy configurations with endpoints that enable clients to configure proxy endpoints and authentication.

The PR #4046 aims to restore the HTTP proxy feature, which routes legacy configurations to cortex.cpp. However, it would be beneficial to include more settings that allow users to input authentication credentials, such as username and password, which are essential for most proxy services.

Feature Idea

See attached screenshot:

Screenshot 2024-11-19 at 19 58 49

See cortex.cpp configurations endpoint: https://cortex.so/api-reference#tag/configurations/patch/v1/configs

Screenshot 2024-11-19 at 20 01 09

Acceptance criteria

GIVEN:

  1. The cortex.cpp file already supports proxy authentication configurations.
  2. Jan has already configured the configurations to be routed to the endpoint.

WHEN:

  1. Users go to the app settings page
  2. Users input the proxy authentication settings such as username as password

THEN:

  1. App should include those settings in the configs request
  2. App should allow users to download models via the proxy

Design

Figma link: https://www.figma.com/design/DYfpMhf8qiSReKvYooBgDV/Jan-App-(3rd-version)?node-id=9134-70125&m=dev

User can click on HTTPS Proxy settings from Advanced Settings:

Screenshot 2024-11-27 at 6 52 51 PM

It opens a sub-page for its detailed settings:

Screenshot 2024-11-27 at 7 09 04 PM

[Note] Remove Ignore SSL Certificate here:

Screenshot 2024-11-27 at 6 53 13 PM