Registry / ai-ml / kernel

kernel

JSON →
library0.63.0pypypi✓ verified 84d ago

The official Python library for the Kernel API, providing tools to interact with Kernel's platform for AI-powered data processing. Current version 0.63.0, released under MIT license. Active development with frequent releases.

pip install kernel
INSTALL
IMPORT
SIG · KERNEL
K
kernel
ai-mlpythonv0.63.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Kernel
from kernel import Kernel
import kernel
Kernel is the main client class, not a module-level name
AsyncKernel
from kernel import AsyncKernel
from kernel.async_client import AsyncKernel
AsyncKernel is directly importable from kernel since v0.50
KernelError
from kernel.exceptions import KernelError
from kernel.errors import KernelError
Exceptions module renamed from 'errors' to 'exceptions' in v0.55

Initialize the Kernel client with an API key and make a query. Set KERNEL_API_KEY environment variable.

import os from kernel import Kernel client = Kernel(api_key=os.environ.get('KERNEL_API_KEY', '')) response = client.query(prompt='What is the capital of France?') print(response)
Debug
Known issues
breakingIn v0.60, the `query` method response format changed from returning a string to a structured object with `text` field.
fix
Access response.text instead of treating response as a string.
affects: >=0.60.0
deprecatedThe `kernel.errors` module is deprecated and will be removed in v1.0. Use `kernel.exceptions` instead.
fix
Update imports from `from kernel.errors import ...` to `from kernel.exceptions import ...`
affects: >=0.55.0
gotchaAPI key must be passed via `api_key` parameter or set as `KERNEL_API_KEY` environment variable. Passing `token` parameter is not supported and will be silently ignored.
fix
Use `api_key` parameter or set the environment variable.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'kernel'
Library not installed.
fix
Run `pip install kernel`
kernel.errors.KernelError: API key not found
Missing API key.
fix
Set KERNEL_API_KEY environment variable or pass `api_key` parameter.
AttributeError: 'str' object has no attribute 'text'
Response format changed in v0.60; expecting string but code uses .text accessor.
fix
If using response.text, ensure library version >=0.60. Otherwise, use the raw string response.
Upgrade
Version history
0.63.0latest on PyPI · released Jun 5, 2026
Audit
Dependencies
httpxrequiredHTTP client
pydanticrequireddata validation
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
kernel — pip install kernel · libregistry