Skip to main content

Spavik

Spavik for Python: predictions in your app, without an ML stack

PyPI Python versions CI License: Apache 2.0

Spavik is a prediction API for developers and AI agents. You send the history your application already keeps, such as past customers, leads, orders or shipments, and Spavik creates a model from it in one call. Your code then asks the questions that matter to the business: will this customer cancel, will this lead buy, what will this house sell for, how many orders will come in tomorrow.

There is no model to design, host or retrain by hand. This package is the official Python client: it handles authentication, retries, safe replays and data conversion, so a prediction is a method call.

pip install spavik

A first prediction in five minutes

  1. Create a free account on spavik.co and copy your API key from the dashboard. No credit card is required.
  2. Export it: export SPAVIK_API_KEY="sk-spv-api-..."
  3. Download churn.csv, 120 synthetic customers with their plan, seats, support tickets and whether they cancelled.
  4. Run this script beside the file:
from spavik import Spavik

with Spavik() as client:
    # Free: does this table say anything about churn?
    report = client.evaluate("churn.csv", target="churn")
    print(report["assessment"]["message"])

    # Free: create a model from the 120 past customers.
    model = client.train("churn.csv", target="churn")

    # One credit: will this customer cancel?
    result = model.predict({"plan": "pro", "seats": 12, "tickets_90d": 2})
    print(result.predictions)

Keep model.id: the model stays available, and later predictions reuse it without training again.

What you can predict

Anything your history already records the answer to. Each guide below comes with a dataset and complete code.

Question your app asks Answer Guide
Will this customer cancel? yes or no, with a probability Churn prediction
Will this lead become a customer? yes or no, with a probability Lead conversion
What will this property sell for? a number House prices
How many hours will this parcel take? a number Delivery times
How many orders tomorrow? the next values of a series Order forecast
What will tomorrow's peak demand be? the next values of a series Electricity demand

Forecasting needs no model at all: send the series and the number of steps.

forecast = client.forecast("sales.csv", target="sales", horizon=7)
print(forecast.points)

How a model lives

evaluate tells you, for free, whether the data can predict the column you chose and how it compares with a simple guess. train creates the model, also for free. predict scores new rows and is, with forecast, the only billed step. Once the real outcome is known, model.submit_outcomes(...) reports it, model.performance() shows how the predictions held up, and model.refresh() folds the new examples into the model.

Training needs at least 100 rows, and results are usually limited below 200. Reaching that size improves the odds without promising a good model, which is why the evaluation comes first.

Plans

The Free plan includes 100 predictions per calendar month, reset on the 1st at 00:00 UTC, and one active model. Training, evaluation and backtests are free on every plan. Paid plans and their limits are on the pricing page.

Works with your data and your agents

Pass a CSV path, CSV or JSON text, a dict, a list of dicts or a pandas DataFrame (pip install "spavik[pandas]"). Dates, Decimal and missing values are converted for you. AsyncSpavik offers the same methods for asyncio applications.

If you build with an AI agent, the same operations are available as tools from the Spavik MCP server, and a TypeScript SDK covers Node.js and edge runtimes.

Documentation

The API may still change before 1.0, and breaking changes are listed in the changelog. Contributions are welcome, see CONTRIBUTING.md.

License

Apache-2.0

Metadata

Release files for spavik 0.1.2

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

Source distribution (sdist)

Source distribution for spavik 0.1.2
File Size Uploaded Provenance Actions
spavik-0.1.2.tar.gz 58.9 kB Without provenance Details for spavik-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 94.0 kB

Release files / spavik-0.1.2.tar.gz

Download URL spavik-0.1.2.tar.gz
Size 58.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b849a21012e9d920c79244f00aecbbce697f2ef1894e09cb588a509440af3cae
BLAKE2b-256 checksum
How to use checksums
765e2a93a33a885d7df999813fce99d38da3a3824f70e5157e59a21a233ddb04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / spavik-0.1.2-py3-none-any.whl

Download URL spavik-0.1.2-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21d606272fb4dd9dcf2cfc750db47c63a92eaa1141506fe09ee16e86bd936768
BLAKE2b-256 checksum
How to use checksums
da94accffe6e49025bdb38cdc15179cec86044f562b959238d8b88e35f638c1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for spavik 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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