miosa-modal-shim
Drop-in replacement for the Modal Python SDK that routes all compute to MIOSA instead. Existing Modal scripts run on MIOSA with zero code changes.
Installation
# Replace modal with the MIOSA shim
pip uninstall modal
pip install miosa-modal-shim
The package installs a modal Python module that shadows the real Modal SDK.
All import modal statements resolve to this shim.
Configuration
Set your MIOSA API key:
export MIOSA_API_KEY="mki_..."
The shim also reads MODAL_TOKEN_ID as a fallback, so existing CI
configurations that set Modal credentials continue to work after you swap
the key value.
Usage
Your existing Modal code works unchanged:
import modal
app = modal.App("my-app")
@app.function(gpu="any", image=modal.Image.debian_slim().pip_install("torch"))
def train(data):
import torch
return torch.tensor(data).sum().item()
# Runs on a MIOSA sandbox with a GPU
result = train.remote(data=[1, 2, 3])
print(result) # 6.0
Execution modes
| Method | Where it runs |
|---|---|
fn.local(...) |
Current process, no sandbox |
fn(...) |
Same as local |
fn.remote(...) |
MIOSA sandbox (ephemeral VM) |
fn.map(iter1, iter2) |
Parallel MIOSA sandboxes (up to 10 concurrent) |
Image builder
image = (
modal.Image.debian_slim(python_version="3.11")
.apt_install("git", "ffmpeg")
.pip_install("torch", "transformers")
.run_commands("echo 'setup done'")
)
Secrets
# From explicit dict
secret = modal.Secret.from_dict({"HF_TOKEN": "hf_..."})
# From environment (reads MYAPP_* env vars)
secret = modal.Secret.from_name("myapp")
@app.function(secrets=[secret])
def inference():
...
Volumes
vol = modal.Volume.from_name("training-data", create_if_missing=True)
@app.function(volumes={"/data": vol})
def process():
...
Volumes provide API compatibility. Persistent cross-sandbox storage is on the roadmap.
What is supported
| Feature | Status |
|---|---|
modal.App / modal.Stub |
Fully supported |
@app.function() |
Fully supported |
@app.cls() |
Construction only |
modal.Image (debian_slim, from_registry, pip/apt/run_commands) |
Fully supported |
modal.Volume |
API-compatible stub |
modal.Secret (from_name, from_dict) |
Fully supported |
function.remote() |
Fully supported |
function.local() |
Fully supported |
function.map() |
Fully supported |
| GPU selection (T4, L4, A10G, A100, H100, L40S) | Fully supported |
Not yet supported
modal.web_endpoint/modal.asgi_app/modal.wsgi_appmodal.Cronmodal.Dict/modal.Queue- Class method-level
.remote()dispatch
License
MIT
Metadata
Release files for miosa-modal-shim 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| miosa_modal_shim-0.1.0.tar.gz | 7.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| miosa_modal_shim-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.7 kB
Release files / miosa_modal_shim-0.1.0.tar.gz
| Download URL | miosa_modal_shim-0.1.0.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45451bbf6ab4bd2e27841494ddcaf7637f2e2961cf4bdb90b187b141e0fbcefc
|
|
BLAKE2b-256 checksum How to use checksums |
5ffef312e52abfa2960924ef7bcb3c82dc83365625d6e2991e2f5f21f57b9781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / miosa_modal_shim-0.1.0-py3-none-any.whl
| Download URL | miosa_modal_shim-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7aa00805673569a70388a0056ca1d3fe79b11804c09dab19da16a113fab5844
|
|
BLAKE2b-256 checksum How to use checksums |
bdd37687be50ed7e28cca94186f319d62efea3d149876bcdfa6cf281d6efc59d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for miosa-modal-shim 0.1.0
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.