Back to directory

FerryAI — native AI inference for PHP

FerryAI runs ONNX, GGUF and RubixML models directly inside a PHP 8.3+ process through FFI, giving PHP applications chat, streaming, embeddings, RAG and vector search without a Python sidecar, HTTP microservice or Docker container.

FerryAI — native AI inference for PHP

FerryAI loads native shared libraries such as onnxruntime and llama.cpp directly through PHP's FFI extension, the same C APIs Python bindings use, instead of shelling out to a subprocess or running a separate Python service. This removes the HTTP round-trip and duplicated process memory of a typical Python sidecar setup, and lets model weights be shared across PHP workers.

Its ONNX backend handles embeddings, similarity, classification and moderation with CPU or GPU acceleration; its llama.cpp backend handles chat and token-by-token streaming, including JSON Schema output enforced through GBNF grammars rather than prompt engineering. A built-in model cache downloads from Hugging Face, verifies file hashes and applies an LRU eviction policy.

It is an early release (v0.1.1) with a stabilizing public API, tested with PHPStan and Psalm and hundreds of automated tests, and is released under the MIT license.

More in Inference

See all 770
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • Lifeboat

    iterate.ai

    A local inference server that puts an OpenAI- and Anthropic-compatible API in front of open-weight language models running on hardware you control, from a laptop to a GPU cluster.

  • Claude S40

    github.com

    An unofficial Claude chat client for 2007-era Nokia Series 40 phones, built as a Java ME app plus a small Go relay server, with web search, reading mode and saved chats.