Download the PHP package modfin/bellman without Composer
On this page you can find all versions of the php package modfin/bellman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download modfin/bellman
More information about modfin/bellman
Files in modfin/bellman
Package bellman
Short Description PHP client for bellmand, the Bellman LLM proxy. One API key for OpenAI, Anthropic, Gemini, VoyageAI, Ollama and more.
License MIT
Homepage https://github.com/modfin/bellman-php
Informations about the package bellman
bellman-php
PHP client for bellmand, the Bellman LLM proxy. One URL and one API key give you OpenAI, Anthropic, Gemini (VertexAI), VoyageAI, Ollama, vLLM and xAI behind the same interface.
Requires PHP 8.1+.
Install
If the package is not on Packagist (or you want to pin to the GitHub repo directly),
add the repository to your composer.json first:
Usage
The key name (my-app) identifies the caller in bellmand's logs and metrics, the
token is the API key configured in bellmand.
Configuring a generator
Generators are immutable, every setter returns a new instance, so configure once and reuse.
Also available: topP(), topK(), frequencyPenalty(), presencePenalty(),
stopAt(), thinkingBudget() and includeThinkingParts().
Structured output
Images, PDFs and other files
Pass raw bytes, the client takes care of base64 encoding. Plain strings passed to
prompt() are user messages.
Conversations
Append $res->turn to the prompts to continue a conversation. It holds the
assistant's reply in replay-ready form, including thinking signatures that some
providers require you to send back.
Embeddings
Models
All models known to the Go library are available as static constructors on
Bellman\Models\Anthropic, OpenAI, VertexAI, VoyageAI, Ollama, VLLM,
XAI and OMLX, with the same names as in Go:
Any model bellmand can route to works, including ones not in the catalog:
Usage and errors
Every failure throws Bellman\BellmanException. $e->statusCode holds the HTTP
status from bellmand (null if it was never reached), and $e->isRateLimited()
and $e->isUnauthorized() cover the common cases.
HTTP client
Guzzle is used by default with a 300 second timeout. Any PSR-18 client can be passed instead:
Laravel
Then inject Bellman\Client wherever you need it.
Development
src/Models is generated from the Go library's model definitions. To update it after
models change in bellman, run this from the repo root, with a bellman checkout next to it:
Not yet supported: streaming, and tools / function calling.
All versions of bellman with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
psr/http-client Version ^1.0