gpCAM

[!NOTE]
New in 8.7: GPOptimizer handles multi-task GPs. Pass y_data of shape (V, No) and
choose multi_task_mode ('independent', the default, 'cartesian' or 'kronecker').
fvGPOptimizer is deprecated; GPOptimizer(..., multi_task_mode="cartesian") replaces it
exactly. Requires fvgp ~= 4.11; see HISTORY.rst.
[!NOTE]
Upgrading from 8.3.x? gpCAM 8.4 targets fvgp ~= 4.8 and renames a few
constructor kwargs (gp2Scale_dask_client → dask_client,
gp2Scale_linalg_mode → linalg_mode, gp_rank_n_update → rank_n_update), and
replaces calc_inv=True with linalg_mode="CholInv". Full migration notes are in
HISTORY.rst.
gpCAM (gpcam.lbl.gov) is an API and software designed to make advanced Gaussian Process function approximation and autonomous data acquisition/Bayesian Optimization for experiments and simulations more accurate, faster, simpler, and more widely available. The tool is based on a flexible and powerful Gaussian process regression at the core. The flexibility stems from the modular design of gpCAM which allows the user to implement and import their own Python functions to customize and control almost every aspect of the software. That makes it possible to easily tune the algorithm to account for various kinds of physics and other domain knowledge and to identify and find interesting features, in Euclidean and non-Euclidean spaces. A specialized function optimizer in gpCAM can take advantage of HPC architectures for fast analysis time and reactive autonomous data acquisition. gpCAM broke a 2019 record for the largest exact GP ever run! Below you can see a simple example of how to set up an autonomous experimentation loop.
Usage
The following demonstrates a simple usage of the gpCAM API (see interactive demo).
!pip install gpcam
from gpCAM import GPOptimizer
my_gp = GPOptimizer(x_data,y_data,)
my_gp.train()
train_at = [10,20,30] #optional
for i in range(100):
new = my_gp.ask(np.array([[0.,1.]]))["x"]
my_gp.tell(new, f1(new).reshape(len(new)))
if i in train_at: my_gp.train()
Designing experiments with Claude Code
gpCAM ships with a set of Claude Code skills that guide an AI assistant through designing autonomous experiments — custom kernels, acquisition functions, noise models, and the full ask/tell/train loop. Experimentalists who want smart, autonomous data acquisition without deep knowledge of GP math or the gpCAM API can use these skills to design autonomous experiments.
Installing the gpCAM marketplace in Claude Code
The repo ships as a Claude Code plugin marketplace. Inside any Claude Code session, run:
/plugin marketplace add lbl-camera/gpCAM
/plugin install gpcam@gpcam
The first command registers this repo as a marketplace; the second installs the gpcam plugin from it, which bundles all of the skills below. After install, the skills are available to Claude in any project — no need to clone the repo locally.
To update later, run /plugin marketplace update gpcam; to remove, /plugin uninstall gpcam@gpcam.
Available skills