llm-cerebras
This is a plugin for LLM that adds support for the Cerebras inference API.
Installation
Install this plugin in the same environment as LLM.
pip install llm-cerebras
Configuration
You'll need to provide an API key for Cerebras.
llm keys set cerebras
Listing available models
The plugin automatically fetches the latest available models from the Cerebras API and caches them for 24 hours.
llm models list | grep cerebras
# CerebrasModel: cerebras-llama3.1-8b
# CerebrasModel: cerebras-llama3.3-70b
# CerebrasModel: cerebras-llama-4-scout-17b-16e-instruct
# CerebrasModel: cerebras-qwen-3-32b
Refreshing models
To get the latest models from the Cerebras API and update the cache:
llm cerebras refresh
This will fetch the current list of available models and save them to the cache. The models are automatically cached for 24 hours, so you typically don't need to refresh manually unless you want to check for newly released models.
Schema Support
The llm-cerebras plugin supports schemas for structured output. You can use either compact schema syntax or full JSON Schema:
# Using compact schema syntax
llm -m cerebras-llama3.3-70b 'invent a dog' --schema 'name, age int, breed'
# Using multi-item schema for lists
llm -m cerebras-llama3.3-70b 'invent three dogs' --schema-multi 'name, age int, breed'
# Using full JSON Schema
llm -m cerebras-llama3.3-70b 'invent a dog' --schema '{
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"},
"breed": {"type": "string"}
},
"required": ["name", "age", "breed"]
}'
Schema with Descriptions
You can add descriptions to your schema fields to guide the model:
llm -m cerebras-llama3.3-70b 'invent a famous scientist' --schema '
name: the full name including any titles
field: their primary field of study
year_born int: year of birth
year_died int: year of death, can be null if still alive
achievements: a list of their major achievements
'
Creating Schema Templates
You can save schemas as templates for reuse:
# Create a template
llm -m cerebras-llama3.3-70b --schema 'title, director, year int, genre' --save movie_template
# Use the template
llm -t movie_template 'suggest a sci-fi movie from the 1980s'
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-cerebras
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
Running Tests
To run the unit tests:
pytest tests/test_cerebras.py tests/test_schema_support.py
To run integration tests (requires a valid API key):
pytest tests/test_integration.py
To run automated user workflow tests:
pytest tests/test_automated_user.py
You can run specific test types using markers:
pytest -m "integration" # Run only integration tests
pytest -m "user" # Run only user workflow tests
License
Apache 2.0
Metadata
Release files for llm-cerebras 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llm_cerebras-0.1.8.tar.gz | 12.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_cerebras-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / llm_cerebras-0.1.8.tar.gz
| Download URL | llm_cerebras-0.1.8.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
405b3ca02288529c4fa63369633fe8caf0546b253d2b74fcc4534a252131c8bf
|
|
BLAKE2b-256 checksum How to use checksums |
8e37225d4cf836c10b5d32e1fca25efd925c1e8c503159cf23419d1d9455728a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / llm_cerebras-0.1.8-py3-none-any.whl
| Download URL | llm_cerebras-0.1.8-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88f7260b9f40aeea7539c882bfb1ec7ef56f4469af9347a15066d9b5f605d973
|
|
BLAKE2b-256 checksum How to use checksums |
32b29a8d2b47676581d2367d09e80f99e5e7e7767e8363cd088ba408963db273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for llm-cerebras 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.