$headers Optional headers. * @param mixed $data Optional request data. * @return Request */ protected function createRequest( HttpMethodEnum $method, string $path, array $headers = array(), $data = null ): Request { // llama.cpp exposes the OpenAI-compatible API directly under /v1/. $path = ltrim( (string) preg_replace( '#^v1/?#', '', ltrim( $path, '/' ) ), '/' ); $path = 'v1/' . $path; return new Request( $method, LlamaCppProvider::url( $path ), $headers, $data, $this->getRequestOptions() ); } }