Download the PHP package prism-php/bedrock without Composer

On this page you can find all versions of the php package prism-php/bedrock. 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 bedrock

Total Downloads Latest Stable Version License

Prism Bedrock

Unlock the power of AWS Bedrock services in your Laravel applications with Prism Bedrock. This package provides a standalone Bedrock provider for the Prism PHP framework.

Installation

Configuration

Add the following to your Prism configuration (config/prism.php):

Usage

Text Generation

Structured Output (JSON)

Embeddings (with Cohere models)

Model names

[!IMPORTANT] When using inference profiles via an ARN, you should urlencode the model name.

Supported API Schemas

AWS Bedrock supports several API schemas - some LLM vendor specific, some generic.

Prism Bedrock supports three of those API schemas:

Each schema supports different capabilities:

Schema Text Structured Embeddings
Converse
Anthropic
Cohere

* A unified interface for multiple providers. See AWS documentation for a list of supported models.

** The Converse schema does not support Anthropic's native features (e.g. PDF vision analysis). This schema uses Anthropic's native schema and therefore allows use of Anthropic native features. Please note however that Bedrock's Anthropic schema does not yet have feature parity with Anthropic. Notably it does not support documents or citations, and only supports prompt caching for Claude Sonnet 3.7 and Claude Haiku 3.5. To use documents with Anthropic's models, use them via the Converse schema (though note that this not the same as using Anthropic's PDF vision directly).

Auto-resolution of API schemas

Prism Bedrock resolves the most appropriate API schema from the model string. If it is unable to resolve a specific schema (e.g. anthropic for Anthropic), it will default to Converse.

Therefore if you use a model that is not supported by AWS Bedrock Converse, and does not have a specific Prism Bedrock implementation, your request will fail.

If you wish to force Prism Bedrock to use Converse instead of a vendor specific interface, you can do so with withProviderOptions():

Cache-Optimized Prompts

For supported models, you can enable prompt caching to reduce latency and costs:

[!TIP] Anthropic currently supports a cacheType of "ephemeral". Converse currently supports a cacheType of "default". It is possible that Anthropic and/or AWS may add additional types in the future.

Structured Adapted Support

Both Anthropic and Converse Schemas do not support a native structured format.

Prism Bedrock has adapted support by appending a prompt asking the model to a response conforming to the schema you provide.

The performance of that prompt may vary by model. You can override it using withProviderOptions():

License

The MIT License (MIT). Please see License File for more information.

Authors

This library is created by TJ Miller with contributions from the Open Source Community.


All versions of bedrock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0|^12.0
aws/aws-sdk-php Version ^3.339
prism-php/prism Version >=0.77.1
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 prism-php/bedrock contains the following files

Loading the files please wait ....