Download the PHP package ardagnsrn/ollama-php without Composer

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

Ollama PHP Library

This is a PHP library for Ollama. Ollama is an open-source project that serves as a powerful and user-friendly platform for running LLMs on your local machine. It acts as a bridge between the complexities of LLM technology and the desire for an accessible and customizable AI experience.

Total Downloads Latest Version License

☕️ Buy me a coffee

Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)

Buy Me A Coffee

Table of Contents

Get Started

Requires PHP 8.1+\ Requires Ollama

You can find Official Ollama documentation here.

First, install Ollama PHP via the Composer package manager:

Then, you can create a new Ollama client instance:

Usage

Completions Resource

create

Generate a response for a given prompt with a provided model.

createStreamed

Generate a response for a given prompt with a provided model and stream the response.

Chat Resource

create

Generate a response for a given prompt with a provided model.

Also, you can use the tools parameter to provide custom functions to the chat. tools parameter can not be used with createStreamed method.

createStreamed

Generate a response for a given prompt with a provided model and stream the response.

Models Resource

list

List all available models.

show

Show details of a specific model.

create

Create a new model.

createStreamed

Create a new model and stream the response.

copy

Copy an existing model.

delete

Delete a model.

pull

Pull a model from the Ollama server.

pullStreamed

Pull a model from the Ollama server and stream the response.

push

Push a model to the Ollama server.

pushStreamed

Push a model to the Ollama server and stream the response.

runningList

List all running models.

Blobs Resource

exists

Check if a blob exists.

create

Create a new blob.

Embed Resource

create

Generate an embedding for a given text with a provided model.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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


All versions of ollama-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.9
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 ardagnsrn/ollama-php contains the following files

Loading the files please wait ....