Skip to main content

normalize_local_base

Function normalize_local_base 

Source
pub fn normalize_local_base(input: &str) -> String
Expand description

Reduce a user-entered server address to its origin/base, tolerating both a bare http://127.0.0.1:1234 and a fully-qualified http://127.0.0.1:1234/v1/chat/completions. Trailing slashes and the known OpenAI-compat path suffixes are stripped so the result can have a fresh path appended.