SYNTHETIC NEURAL API & PIPELINE SCRIPTING ENGINE
One language for every stage of the AI pipeline. Faster than Python. Safer than C. More expressive than anything in between.
Today's ML pipelines stitch together Python, YAML, JSON, and shell scripts. SYNAPSE replaces all of it.
-- Schema, pipeline, and logic in one file schema ImageInput { path: str, label: str?, width: int, height: int } pipeline classify_images { source: ImageInput[] steps: [preprocess -> embed -> infer] output: ClassResult[] } fn preprocess(img: ImageInput) -> Tensor { load_image(img.path) |> resize(224, 224) |> normalize(mean=[0.485, 0.456]) } async fn infer(t: Tensor) -> ClassResult { let model = load_model("resnet50.synmodel") model.forward(t) }
# schema.json + config.yaml + pipeline.py + run.sh # --- schema.json --- { "type": "object", "properties": { "path": {"type": "string"}, "label": {"type": "string"} }} # --- pipeline.py --- from torchvision import transforms from PIL import Image import torch, yaml, json, subprocess def preprocess(img_path): t = transforms.Compose([ transforms.Resize((224, 224)), transforms.ToTensor(), transforms.Normalize([0.485, 0.456]) ]) return t(Image.open(img_path)) async def infer(tensor): model = torch.load("resnet50.pt") model.eval() with torch.no_grad(): return model(tensor.unsqueeze(0))