Skip to main content

gpCAM

PyPI Documentation Status gpCAM CI Codecov PyPI - License DOI Pepy Total Downloads Downloads

[!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

Skill Description
experiment-designer End-to-end autonomous experiment design. Translates a scientist's description of their measurement into a complete gpCAM script.
kernel-designer Design and compose custom kernel functions that encode domain knowledge (smoothness, periodicity, symmetry, anisotropy).
acquisition-functions Write custom acquisition functions that encode experimental priorities (exploration vs exploitation, multi-objective, constraints).
prior-mean-functions Encode known physics or expected trends as prior mean functions.
noise-functions Model position-dependent or heteroscedastic noise from detector characteristics.
cost-functions Account for motor travel time, settling, directional costs, and zone-based penalties.
uncertainty-calibration Validate that the posterior's error bars are trustworthy — scoring rules (NLPD, CRPS, MSLL), coverage/calibration curves, and what to do when the model is over- or under-confident.
troubleshooting Map a gpCAM error message to its cause and fix — non-positive-definite covariance, bounds mismatches, NaNs, Dask hangs, pickling, and silent failures.
gp2scale-advanced Large-scale experiments (>10k points) using sparse kernels and Dask distributed computing.
multi-task-advanced Multi-output / function-valued experiments with fvGPOptimizer.
transformed-optimizers-advanced Constrained observations: LogGPOptimizer for y > 0 and LogitGPOptimizer for y ∈ [0, 1] — predictions and credible intervals stay inside the constrained range.

Once installed, the skills activate automatically when you describe an experiment design problem to Claude, or you can invoke one explicitly (e.g. "use the experiment-designer skill to set up an adaptive XRD scan").

Other agentic platforms

The skills are also compatible with any harness that reads SKILL.md files (e.g. OpenClaw) — clone the repo and point your assistant at the skills/ directory. When this repo is present in your working directory, Claude Code also picks up the root CLAUDE.md and skills/ directory automatically, so the marketplace install is only needed for use outside the repo.

Credits

Main Developer: Marcus Noack (MarcusNoack@lbl.gov)

This code was developed with help from Ron Pandolfi (LBNL), Mark Risser (LBNL), Hengrui Luo (Rice U.), and Vardaan Tekriwal (UCB).

Additional contributions and insights came from across the community, in particular, Kevin Yager, Masafumi Fukuto, and their teams (Brookhaven National Lab).

We acknowledge support from several DOE ASCR, BER, and BES projects, including CAMERA (James Sethian, Jeff Donatelli), SPECTRA (Sherry Li), and CASCADE (Bill Collins), as well as support directly from Lawrence Berkeley National Laboratory.

This package uses the HGDL package of David Perryman and Marcus Noack, which is based on the HGDN algorithm by Noack and Funke.

Release files for gpcam 8.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpcam 8.5.0
File Size Uploaded
gpcam-8.5.0.tar.gz 147.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpcam 8.5.0
File Interpreter ABI Platform
gpcam-8.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 199.9 kB

Release files / gpcam-8.5.0.tar.gz

Download URL gpcam-8.5.0.tar.gz
Size 147.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d055e6458f3276dfaea7b93b0e7bef608e4a6d55c67028b2f9806439136e6754
BLAKE2b-256 checksum
How to use checksums
bb14d000556eb0a2505392a6438763205202a757e8f3737009d39cc227954106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gpcam-8.5.0-py3-none-any.whl

Download URL gpcam-8.5.0-py3-none-any.whl
Size 52.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4ffeb57504f683bc2c921f2486f8b833b0494a3c20b15c7649d3f2391b21e10
BLAKE2b-256 checksum
How to use checksums
fff2c4acf28901710b9442688496cfb4de1fc98e2ff6ea3c535967ee86040949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

8.5.0 This release

2 release files

8.4.3

2 release files

8.4.2

2 release files

8.4.1

2 release files

8.4.0

2 release files

8.3.9

2 release files

8.3.8

2 release files

8.3.7

2 release files

8.3.6

2 release files

8.3.5

2 release files

8.3.4

2 release files

8.3.3

2 release files

8.3.2

2 release files

8.3.1

2 release files

8.3.0

2 release files

8.2.9

2 release files

8.2.8

2 release files

8.2.6

2 release files

8.2.5

2 release files

8.2.4

2 release files

8.2.3

2 release files

8.2.2

2 release files

8.2.1

2 release files

8.2.0

2 release files

8.1.11

2 release files

8.1.9

2 release files

8.1.8

2 release files

8.1.7

2 release files

8.1.6

2 release files

8.1.5

2 release files

8.1.4

2 release files

8.1.3

2 release files

8.1.2

2 release files

8.1.1

2 release files

8.1.0

2 release files

8.0.6

2 release files

8.0.5

2 release files

8.0.4

2 release files

8.0.3

2 release files

8.0.2

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.4.10

2 release files

7.4.9

2 release files

7.4.8

2 release files

7.4.7

2 release files

7.4.6

2 release files

7.4.5

2 release files

7.4.4

2 release files

7.4.3

2 release files

7.4.2

2 release files

7.4.1

2 release files

7.4.0

2 release files

7.3.5

2 release files

7.3.4

2 release files

7.3.3

2 release files

7.3.2

2 release files

7.3.1

2 release files

7.3.0

2 release files

7.2.5

2 release files

7.2.4

2 release files

7.2.3

2 release files

7.2.2

2 release files

7.2.1

2 release files

7.2.0

2 release files

7.1.9

2 release files

7.1.8

2 release files

7.1.7

2 release files

7.1.6

2 release files

7.1.5

2 release files

7.1.4

2 release files

7.1.3

2 release files

7.1.2

2 release files

7.1.1

2 release files

7.1.0

2 release files

7.0.9

2 release files

7.0.8

2 release files

7.0.7

2 release files

7.0.6

2 release files

7.0.5

2 release files

7.0.4

2 release files

7.0.3

2 release files

7.0.1

2 release files

7.0.0

2 release files

6.0.4

2 release files

6.0.3

2 release files

6.0.2

2 release files

6.0.1

2 release files

6.0.0

2 release files

4.8.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page