Download the PHP package eloquage/embed without Composer
On this page you can find all versions of the php package eloquage/embed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eloquage/embed
More information about eloquage/embed
Files in eloquage/embed
Package embed
Short Description Embedding helpers for PHP apps: normalize, chunk metadata, cache keys, and provider-agnostic embedding DTOs for RAG pipelines.
License MIT
Homepage https://github.com/eloquage/embed
Informations about the package embed
Embedding helpers for PHP apps: normalize, chunk metadata, cache keys, and provider-agnostic embedding DTOs for RAG pipelines.
Installation
Install via Composer (pure PHP; always works without a native extension):
Optional native acceleration
When a release includes a TypePHP-built extension (eloquage_embed), you can load it for faster paths. The public PHP API is unchanged.
shivammathur/setup-php (GitHub Actions)
Once the extension is on PECL:
Until then, install from a GitHub Release phpize/PECL tarball or from source (see setup-php wiki: Add extension from source).
docker-php-ext-install
Extract the Release phpize tree to an absolute path, then:
PECL
Windows
Download the Release eloquage_embed.dll, place it in your PHP extension directory, and enable:
On windows-latest with setup-php, the same PECL/DLL path applies once a Windows binary is published.
See TYPEPHP.md for building the extension yourself with the shared builder image.
Usage
Create immutable, provider-neutral records from vectors returned by any SDK or local model:
Embedding records expose id, model, dimensions, vector, and scalar
metadata fields as public read-only values. Record creation requires a
non-blank identity and model, a positive dimension count exactly matching a
non-empty finite numeric vector, and string metadata keys. Normalization
returns a new unit-length record and rejects zero-norm vectors. Chunk metadata
uses the reserved chunk_source, chunk_index, chunk_start_offset, and
chunk_end_offset fields; it annotates without splitting text or calculating
offsets. Batches are non-empty ordered lists and may contain mixed models and
dimensions.
Cache keys are opaque, versioned eloquage-embed:v1:<sha256> values. Text is
hashed byte-for-byte after blank-input validation. Structured JSON-compatible
payloads canonicalize associative-key order while preserving list order,
string contents, and numeric distinctions. Key derivation is deterministic,
in-process, and offline: this package is not a provider SDK and does not make
HTTP requests, read credentials, tokenize text, store cache entries, or depend
on Laravel, eloquage/vector, or eloquage/tokens.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Pull requests and issues are welcome on GitHub.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Miguel Enes
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Development
See AGENTS.md for agent context, tests, and TypePHP Docker builds.