calkit / calkit/calkit

I want users to be able to calculate predictions from my project

Open
#34 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
60
Forks
18
Avg merge
1d 16h
Merged PRs (30d)
38

Description

This is the purpose of doing research, really. Can a Calkit user declare an interface to their project to allow others to use it to make predictions? Creating a new Python, R, etc., package is a possibility, but what if the Calkit package itself made it so users did not need to install new software, but instead could run `calkit predict --project someone/some-project --inputs my-inputs.yaml`, or use in a script:

```python
import calkit

prediction = calkit.predict(year=2025, temperature=35.9454, project="someone/some-project", model="main")
```

Maybe this downloads an ML model, maybe it makes a call out to an API to run an inference on the fly (maybe a model hosted on calkit.io), or maybe it's some sort of physics-based simulation. Whatever it is, we want to make the products of a research product usable to others.

## Models

Can a CFD case setup be considered a type of model? Can we use this to make predictions for a modified geometry, or different IBCs?

## Example calculations

1. Probability of an adverse reaction to some drug given age, sex, exercise habits, etc.
2. Reynolds number at which a physical turbine model will achieve asymptotic performance, or perhaps flow speed, given geometry

## MVP

One option for a calculation can be fully declarative

```yaml
calculations:
estimate-something:
kind: linear
params:
slope: 5
intercept: 0
x_name: x
y_name: y
inputs:
- name: x
dtype: float
max: 500
output: y
```

These could be easily evaluated by the backend. Another similar option is [`arithmeval`](https://github.com/enesklcarslan/arithmeval/),
which could produce something like

```yaml
calculations:
estimate-something:
title: Estimate the thing
description: This estimates the thing.
kind: arithmetic
params:
formula: y = 55 * x + 65 # The equals sign will be split upon, and is optional
inputs:
x:
dtype: float
max: 500
description: The number of fish.
outputs:
y:
dtype: float
description: How many barrels you will need.
```

Otherwise, users could specify a Docker container with which to run some sort of command line app or perhaps spin up a REST API with which to get results.

Alternatively, users could ship a WASM-enabled marimo notebook.

Contributor guide

Open the contributing guide

Research direction

Start with the proposed `calkit predict` CLI and `calkit.predict` Python entry points, then compare the declarative YAML calculation, Docker command, REST API, and WASM notebook options. Done requires a decided MVP interface, execution model, and scope for supported project models and inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python, wasm
Domain
backend-api-design, cli, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.