Introduction
Chalk is the platform for production AI: context, runtime, and learning for your agents and models.
Chalk gives you the infrastructure to build, run, and improve production AI in your own cloud:
Chalk delivers these through the Context Engine and Chalk’s runtime, both built on the same philosophy: define what you need in Python, and run it on infrastructure you control.
Most teams assemble a production AI stack from a feature store, a vector database, retrieval and prompt tooling, an orchestration layer, a sandbox runtime, and a governance story, then fight to keep them all consistent. Chalk replaces that stack with a single platform. Teams use it to:
Context, Runtime, and Learning run in the same Chalk environment, so they can use each other directly: an agent can request features, and a feature can call a deployed model. Core Concepts shows how the three areas fit together.
The Context Engine is a real-time feature computation engine that serves as the single source of truth for your features. You define features once in Python, and Chalk computes and serves them directly from your data sources at inference time in milliseconds.
Unlike traditional feature stores, which behave like databases or caching layers, Chalk keeps training and serving perfectly in sync and makes feature development faster. It adds built-in monitoring, a branch-based deployment model for feature versioning, and deployment inside your own cloud. This is especially critical for teams working with sensitive data or in regulated industries.
Here’s a quick example of declarative feature engineering in Chalk:
from chalk.features import features
from chalk import online
@features
class User:
id: int
total_orders: int
chargeback_rate: float
fraud_score: float
@online
def score_fraud(
orders: User.total_orders, cbr: User.chargeback_rate,
) -> User.fraud_score:
return 0.7 * cbr + 0.3 * (orders < 3)
You can query features in real time, or as of any point in the past for training and evaluation. For example, a larger fraud pipeline can expose a fraud prediction alongside transaction features:
The interactive example shows a recorded fraud query plan. Select an operator to inspect it, or use the zoom controls to explore the graph.
Chalk’s runtime runs your agents, models, and code. Each workload takes one of three shapes:
Your agents reach hosted LLMs through the Model Gateway, and your MCP servers and SaaS tools through the MCP Gateway.
Here’s a simple example of spinning up a sandbox:
import chalkcompute
sandbox = chalkcompute.Sandbox(
image=chalkcompute.Image.debian_slim("3.13").pip_install(["anthropic"]),
cpu="2",
memory="4Gi",
).run()
print(sandbox.exec("echo", "hello!").stdout_text)
sandbox.terminate()
Each sandbox runs under gVisor, with its own filesystem, network namespace, and resource limits. A sandbox created with chalk_identity=True gets its own workload identity, so no two sandboxes share credentials. The same SDK runs persistent services on scaling groups, for example a GPU-backed model server:
import chalkcompute
server = chalkcompute.ScalingGroup(
image=chalkcompute.Image.base("vllm/vllm-openai:latest"),
gpu="nvidia-l4:1", cpu="4", memory="16Gi", port=8000,
min_replicas=0, max_replicas=1,
entrypoint=["--model", "Qwen/Qwen2.5-7B-Instruct"],
).deploy()
Learning covers training models and testing changes to agents and models before you ship them.
A training function reads a dataset produced by an offline query, so the model trains on the feature values each row would have seen in production at that row’s point in time. You register the trained model in the model registry and serve it on its own scaling group, where a feature can call it.
An evaluation runs a task, usually a deployed function such as an agent or a prompt, against a fixed dataset of examples, and scorers grade each output. Each run records a trace of the task for every row, so you can inspect each step and compare runs of a new version against the same examples.
chalk login and chalk init. chalk init installs chalkpy for the Context Engine and chalkcompute to run agents and models. The Setup Guide walks through each step.chalk apply to deploy them.@chalkcompute.function and invoke it remotely.Next steps: read the docs overview, Core Concepts, the feature engineering guide, and the API reference.