Polyglot allows you to use custom HTTP clients for specific connection requirements:

<?php
use Cognesy\Http\Config\HttpClientConfig;use Cognesy\Http\HttpClient;use Cognesy\Polyglot\Inference\Inference;

// Create a custom HTTP client configuration
$httpConfig = new HttpClientConfig(
    connectTimeout: 5,      // 5 seconds connection timeout
    requestTimeout: 60,     // 60 seconds request timeout
    idleTimeout: 120,       // 120 seconds idle timeout for streaming
    maxConcurrent: 10,      // Maximum 10 concurrent requests
    failOnError: true,      // Throw exceptions on HTTP errors
);

// Create a custom HTTP client
$httpClient = new HttpClient('guzzle', $httpConfig);

// Use the custom HTTP client with Inference
$inference = new Inference();
$inference->withHttpClient($httpClient);

// Make a request with the custom HTTP client
$response = $inference->with(
    messages: 'This request uses a custom HTTP client.'
)->get();

echo $response;