Skip to main content

A fast and simple web server for machine learning models

Project description

☄️ Meteorite

A fast and simple web server to host your Machine Learning model.

Install the pip package

pip install meteorite

Write your server

import json
import meteorite

app = meteorite.Meteorite()
app.set_webhook_url("https://testapp.via.routehead.com")

@app.predict
def predict(data):
    body = data.decode("utf-8")
    """
    Run your model on the input
    """
    return body

app.start(port=4000) # port is 4000 by default

By default, the server starts at port 4000. The predict function will run with GET/POST requests on /predict.

Get your result: a webhook

The set_webhook_url function has been added to the Meteorite API to get responses from prediction requests. This makes Meteorite suitable for use in long-running ML tasks.

The webhook URL

Your webhook URL must accept a POST request at the specific route. The result JSON will be sent as body of the request.

Project status

This project is under active development. We will not recommend you to use this package for critical applications. We will welcome all contributions! Please refer to the contributions section for more details.

Some of the features we're still working on:

  • Pass POST request String and JSON into the Python function.
  • Return String and JSON with the correct content type headers.
  • Graceful error handling (⚠️ Priority).
  • Customise the port for the server
  • Allow more datatypes for POST request to the model.
  • Create more examples.

Contribute to ☄️ Meteorite

Please refer to the CONTRIBUTING.md docs for details.

Join our Discord channel if you have more questions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

meteorite-0.1.0-cp311-none-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

meteorite-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

meteorite-0.1.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.6 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

meteorite-0.1.0-cp310-none-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

meteorite-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

meteorite-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.6 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

meteorite-0.1.0-cp39-none-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

meteorite-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

meteorite-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

meteorite-0.1.0-cp38-none-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

meteorite-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

meteorite-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

meteorite-0.1.0-cp37-none-win_amd64.whl (3.3 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

meteorite-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

meteorite-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.6 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page