Download the PHP package b7s/neuraphp without Composer
On this page you can find all versions of the php package b7s/neuraphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package neuraphp
Short Description Local text embeddings via PHP FFI, powered by embedding.cpp. No Python, no API calls, no external services at runtime.
License MIT
Informations about the package neuraphp
Features
- Local embeddings — No API calls, no network latency, no data leaving your server
- PHP FFI — Direct memory access to a C library, no separate process
- Fluent API —
Neuraphp::make()->model(ModelReference::fromEnum(Model::AllMiniLML12V2))->embed('text') - Multiple models — AllMiniLM-L6-v2, AllMiniLM-L12-v2, Paraphrase, BGE, E5, multilingual; or any BERT-compatible HuggingFace model
- Quantization — F32, F16, Q4_0, Q4_1 for speed/quality tradeoffs
- Vector math — Cosine similarity, dot product, Euclidean distance, L2 normalization
- CLI tools —
neuraphp installfor auto-setup,neuraphp doctorfor diagnostics,neuraphp infofor configuration - Laravel integration — Optional service provider and facade
- Framework-agnostic — Works with any PHP 8.3+ project
Docs: CLI Reference
Add to your project:
Quick Start
For more examples, custom models, batch embedding, and the full API, see the Advanced Guide
⚠️ Prerequisites: embedding.cpp Library & Model
Neuraphp requires
libbert_shared.so(compiled from embedding.cpp) and a GGUF model file to function.
Minimum versions required to compile the library:
| Tool | Min Version | Install |
|---|---|---|
| Git | 2.0+ | git-scm.com |
| CMake | 3.18+ | cmake.org |
| GNU Make | 3.81+ | sudo apt install build-essential / xcode-select --install |
| C++ compiler (g++/clang++) | GCC 10+ / Clang 10+ (C++20) | sudo apt install g++ / xcode-select --install |
| Rust (cargo) | 1.75+ | rustup.rs |
| Git LFS | 2.0+ | sudo apt install git-lfs / brew install git-lfs |
| Python | 3.8+ | (model conversion only) |
There are two ways to set these up:
Option A: Automatic Installation (Recommended)
Run the installation command - it clones, compiles, and downloads everything for you:
You need to run this command just once for each model you want to use. If you don't change the model, you don't need to re-run it.
This will:
- Check prerequisites (git, cmake, make, C++ compiler, Rust, git-lfs)
- Clone embedding.cpp into a temp directory and compile
libbert_shared.so - Download the default model (all-MiniLM-L6-v2) from HuggingFace
- Convert the model to GGUF format (requires Python 3.8+, torch, transformers)
- Copy only final artifacts to
bin/neuraphp-data/in your project root- Clean up temp files and create
bin/neuraphp-data/.gitignoreso artifacts are never committed
- Clean up temp files and create
Options:
Testing
License
MIT