joaopauloschuler/neural-api
CAI NEURAL API - Pascal based deep learning neural network API optimized for AVX, AVX2 and AVX512 instruction sets plus OpenCL capable devices including AMD, Intel and NVIDIA.
What it solves
Most deep learning stacks require Python, CUDA, and heavy dependency trees that are hard to deploy and maintain. This library offers a native Pascal alternative that compiles to a single binary, runs on CPU (AVX/AVX2/AVX512) and OpenCL GPUs, and can execute real modern models—including LLMs, text-to-image, and audio generation—without any Python or CUDA lock-in.
How it works
The library is written in Pascal (Lazarus/Free Pascal) and provides neural network layers, training utilities, and data structures (Volumes). It uses AVX SIMD instructions for fast CPU math and OpenCL for GPU offload. It can load HuggingFace checkpoints and run them through example programs like ChatTerminal (terminal chat) and ChatServer (OpenAI-compatible HTTP endpoint). It also includes examples for text-to-image, text-to-music, audio separation, TTS, and super-resolution. Models are saved/loaded in a portable format, so you can train on CPU and run on GPU, or move between vendors.
Who it’s for
Developers who want to build and deploy deep learning applications in Pascal, especially those who prefer a single native executable without Python or CUDA dependencies. It suits systems programmers who need to integrate LLMs or other generative models into native applications, as well as researchers and hobbyists who like clean, readable code that compiles to fast native binaries.
Highlights
- Run real LLMs natively (Qwen, Llama, Mistral, Phi-3, OLMoE) via terminal chat or an OpenAI-compatible server.
- Generate images from text (Qwen-Image-2.1), music from text (MusicGen), separate audio stems, and convert text to speech (Kokoro TTS).
- Built-in modern architectures: GPT-style transformers, Mixture-of-Experts, RWKV, xLSTM, spiking neurons, and normalizing flows.
- AVX/AVX2/AVX512 CPU paths plus OpenCL acceleration for AMD, Intel, and NVIDIA GPUs.
- Compiles to a single self-contained native binary—no runtime or dependency tree.
- Clean, easy-to-learn Pascal source that stays readable while delivering native performance.
Related
- Project
- Project
- Project
- Project
- Project