Download the PHP package sudhaus7/ai-eloki-platform without Composer

On this page you can find all versions of the php package sudhaus7/ai-eloki-platform. 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 ai-eloki-platform

Eloki Platform

eloki.net platform bridge for Symfony AI.

Eloki exposes an OpenAI-compatible chat API in front of an Ollama backend, so this bridge combines an OpenAI-shaped request/response contract with Ollama-style option handling and NDJSON streaming.

This bridge includes support for:

Installation

Requires PHP 8.2+, symfony/ai-platform ^0.12 and symfony/http-client ^7.3|^8.0.

Set your API key in the environment so the bridge can pick it up without extra wiring:

Usage

The endpoint is fixed at https://demo.eloki.net/ — the factory takes no $endpoint argument.

Factory::createProvider() returns the bare provider if you want to compose it with other providers in your own Platform instance. Both factory methods accept an $apiKey, a custom HttpClientInterface, Contract and EventDispatcherInterface.

Authentication

The API key is sent as Authorization: Bearer …. If you do not pass apiKey explicitly, the bridge falls back to $_ENV['ELOKI_API_KEY']:

Factory::createHttpClient() exposes the same wiring on its own — a base-URI-scoped EventSourceHttpClient with the bearer token applied — if you need a preconfigured client outside the platform, e.g. to build a standalone ModelCatalog:

Without a client and without ELOKI_API_KEY in the environment, ModelCatalog throws an InvalidArgumentException.

Streaming

Streaming is opt-in — the bridge sends stream: false unless you ask for it:

Text, thinking and completed tool calls are emitted as separate deltas, followed by token usage and a finish_reason metadata delta.

Options

Option handling follows Ollama's split between top-level request keys and nested model options. Known top-level keys (stream, format, keep_alive, tools, think, logprobs, top_logprobs for chat; truncate, keep_alive, dimensions for embeddings) stay at the root of the payload, everything else is moved into options:

Models

The model catalog is resolved at runtime from GET api/models — there is no hardcoded model list. Capabilities are derived from the server's model metadata:

Eloki / Ollama capability Symfony AI capability
completion INPUT_MESSAGES
embedding EMBEDDINGS
tools, builtin_tools TOOL_CALLING
thinking THINKING
vision INPUT_IMAGE

Models that report completion additionally get OUTPUT_TEXT and OUTPUT_STREAMING, and every non-embedding model gets OUTPUT_STRUCTURED. Presets (models flagged preset: true) are read from info.meta.capabilities, plain models from ollama.capabilities. A model whose metadata carries no capabilities raises an InvalidArgumentException — that usually means the Eloki server is too old and needs an upgrade.

Resources

License

MIT


All versions of ai-eloki-platform with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/ai-platform Version ^0.12
symfony/http-client Version ^7.3|^8.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 sudhaus7/ai-eloki-platform contains the following files

Loading the files please wait ...