Download the PHP package citomni/vectorembedding without Composer

On this page you can find all versions of the php package citomni/vectorembedding. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vectorembedding

CitOmni VectorEmbedding

citomni/vectorembedding is a reusable CitOmni provider package for semantic embedding integrations. It offers one compact, stable internal contract for embedding-style requests and responses, so application code can work against a consistent structure rather than provider-specific JSON payloads. The package is intentionally narrow in scope: It is designed to be deterministic, explicit, and operationally useful, not a speculative "AI toolbox" bucket.

At its core, VectorEmbedding separates application intent from provider transport. The application submits a normalized request, VectorEmbedding resolves a profile, delegates provider translation to an adapter, performs the outbound HTTP call through the existing CitOmni cURL service, parses the provider response back into a common format, and returns one stable internal embedding response. This design keeps the public surface area small while preserving room for provider-specific capabilities through explicit escape hatches.

Highlights

Why VectorEmbedding

Embedding APIs differ in endpoint structure, request shape, option semantics, authentication headers, output dimensionality handling, and response envelopes. Those differences are operationally real, but they should not leak into every controller, command, or application service. VectorEmbedding exists to absorb that variability behind a single internal request/response model and a profile-based configuration layer. Profiles select concrete adapters and models; adapters perform provider-specific translation; the application stays focused on intent.

In practical terms, this yields four advantages:

Design principles

VectorEmbedding follows a deliberately conservative architecture:

Requirements

OPcache is strongly recommended in production.

Installation

`

Register the package provider in config/providers.php:

Once registered, the package exposes the vectorEmbedder service and the vectorembedding:embed CLI command.

Public service

The primary entry point is the VectorEmbedding service:

The service is responsible for:

  1. Validating raw input shape.
  2. Normalizing the internal request.
  3. Resolving the selected profile.
  4. Validating structural request shape.
  5. Instantiating the configured adapter.
  6. Building the provider URL, payload, and headers.
  7. Sending the HTTP request via $this->app->curl->execute(...).
  8. Parsing and normalizing the provider response.
  9. Returning the common response format.

Internal request format

VectorEmbedding uses a compact internal request model centered on profile, items, options, provider_options, and debug.

Items

The request is intentionally item-based rather than text-shortcut-based. This keeps the internal contract structurally consistent and leaves room for broader modality support later.

Text is the canonical baseline in V1:

V1 is honest about what it supports: The package is multimodal-ready in contract shape, but current adapters and CLI usage are text-first.

Options and provider-specific escape hatch

VectorEmbedding uses an explicit package-level whitelist for options. The currently recognized package-level keys are:

Unknown option keys fail fast. This is deliberate and avoids silently swallowing typos such as dimensons.

Provider-specific deviations belong in provider_options, which acts as the sanctioned escape hatch for capabilities that do not fit the cross-provider abstraction cleanly. In V1, adapters may choose to reject unsupported provider_options entirely.

Debug flags

The request may also include a small debug subtree:

These control whether raw provider response data and the built provider payload are attached to the normalized response.

Normalized response format

Adapters normalize provider responses into a common structure:

This response model gives application code one stable place to read:

Response guarantees

Configuration

VectorEmbedding is configured under the vectorembedding node. The important concept is the profile: the application selects a profile, and the profile resolves to a concrete adapter and endpoint configuration.

Configuration semantics

Notes on credentials

The package baseline may define empty api_key values, but production or application-level configuration must provide real credentials before the profile can be used successfully.

Provider adapters

Adapters are the translation boundary between VectorEmbedding's internal format and each provider's native API contract.

An adapter is responsible for:

The adapter contract is intentionally small:

This keeps provider logic sharply localized and prevents transport, logging, or profile selection concerns from bleeding into adapter implementations.

Transport model

VectorEmbedding delegates HTTP execution to the existing CitOmni cURL service:

That service remains the transport authority. It validates transport request shape, performs the HTTP call, applies timeout and SSL behavior, and returns the raw transport result. VectorEmbedding does not replace or duplicate that layer. Instead, it builds the cURL request array, delegates execution, and lets the adapter decode and interpret the response body.

This separation is consequential:

Logging

VectorEmbedding logs through the existing CitOmni log service when that service is available.

Useful VectorEmbedding log context typically includes:

Suggested log categories are intentionally few and high-signal:

Logging policy

The package does not attempt to build a second observability stack. It simply logs package-level execution context in a compact, explicit way. Because the underlying cURL service may also log, production installations should use a deliberate logging policy rather than accidentally generating duplicate transport noise.

Caching

The current V1 implementation does not implement response caching.

A future-friendly cache config node may exist in the package baseline, but caching is not yet active in the shared service flow. At present:

This is intentional. The package keeps the service pipeline small and real first, rather than introducing persistence before there is a concrete need.

CLI usage

VectorEmbedding exposes a command-line entry point:

A profile may be selected explicitly:

Request options may be supplied from the CLI:

The full normalized response may be printed as JSON:

In plain mode, the command prints the first vector and then a compact info line containing the resolved profile, provider, model, cache status, vector count, dimensions, duration, and token usage where available.

Operational notes

Profiles are the stable application contract

Application code should target profile ids rather than provider-specific endpoints or model payload formats directly. This keeps provider translation localized to adapters and configuration.

The response contract is vector-first from day one

The package returns vectors[], even when a request often yields only one vector. This avoids a future breaking change from vector to vectors.

Transport remains delegated

VectorEmbedding does not replace the CitOmni cURL service. Transport validation, HTTP execution, timeout handling, and low-level request mechanics remain delegated to the existing infrastructure layer.

Validation is intentionally split

Logging should be explicit, not noisy

VectorEmbedding logs package-level success and failure context. Since the underlying cURL service may also log, production installations should choose a deliberate logging policy rather than accidentally doubling transport detail.

Package structure

The package is organized around a small set of clear responsibilities:

A representative structure includes:

Performance notes

Composer example:

Then run:

Error model

VectorEmbedding defines its own domain exception family for request, configuration, adapter, provider-request, and provider-response failures.

The main exception types are:

This keeps the fault surface small, explicit, and package-local.

Error handling philosophy

Fail fast.

VectorEmbedding does not hide malformed requests, profile misconfiguration, unsupported item types, malformed provider responses, or transport preparation failures behind vague fallback behavior. Invalid structure should fail as invalid structure; config problems should fail as config problems; provider response problems should fail as provider response problems.

That bias is deliberate. In integration code, silent fallback logic often looks convenient right up until it becomes the reason nobody can tell what actually happened.

Example

Position within CitOmni

VectorEmbedding follows the broader CitOmni philosophy: explicit contracts, deterministic behavior, small public surfaces, and low overhead. It does one thing narrowly but well: it gives CitOmni applications a disciplined and reusable way to generate semantic embeddings without forcing application code to speak every provider's dialect.


Contributing


Coding & Documentation Conventions

All CitOmni projects follow the shared conventions documented here: CitOmni Coding & Documentation Conventions


License

CitOmni VectorEmbedding is open-source under the MIT License. See LICENSE.

Trademark notice: "CitOmni" and the CitOmni logo are trademarks of Lars Grove Mortensen. Usage of the name or logo must follow the policy in NOTICE. Do not imply endorsement or affiliation without prior written permission.


Trademarks

"CitOmni" and the CitOmni logo are trademarks of Lars Grove Mortensen. You may make factual references to "CitOmni", but do not modify the marks, create confusingly similar logos, or imply sponsorship, endorsement, or affiliation without prior written permission. Do not register or use "citomni" (or confusingly similar terms) in company names, domains, social handles, or top-level vendor/package names. For details, see NOTICE.


Author

Developed by Lars Grove Mortensen © 2012-present.


CitOmni - low overhead, high performance, ready for anything.


All versions of vectorembedding with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
citomni/kernel Version ^1.0
citomni/infrastructure Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package citomni/vectorembedding contains the following files

Loading the files please wait ...