PHP code example of aisdk / cerebras

1. Go to this page and download the library: Download aisdk/cerebras library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aisdk / cerebras example snippets


use AiSdk\Cerebras;
use AiSdk\Generate;

$result = Generate::text('Explain closures in PHP in one sentence.')
    ->model(Cerebras::model('qwen-3.8-27b'))
    ->run();

echo $result->text;