PHPackages                             codingwisely/taskallama - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. codingwisely/taskallama

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codingwisely/taskallama
=======================

Taskallama is a Laravel package that seamlessly integrates with Ollama’s LLM API to empower your applications with AI-driven text generation, task management assistance, and more. Designed for simplicity and scalability, Taskallama brings the power of language models to your Laravel projects.

v1.0.0(1y ago)111301[4 PRs](https://github.com/coding-wisely/taskallama/pulls)MITPHPPHP ^8.3CI passing

Since Nov 17Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/coding-wisely/taskallama)[ Packagist](https://packagist.org/packages/codingwisely/taskallama)[ Docs](https://github.com/codingwisely/taskallama)[ GitHub Sponsors](https://github.com/CodingWisely)[ RSS](/packages/codingwisely-taskallama/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (6)Used By (0)

Taskallama: Laravel Integration with Ollama LLM API
===================================================

[](#taskallama-laravel-integration-with-ollama-llm-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1def1583c6bd6d1ee94ebe448657ee500a2c8eaa99ea5c1e0c3eab8f98543b9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64696e67776973656c792f7461736b616c6c616d612e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374)](https://packagist.org/packages/codingwisely/taskallama)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/16e416f6518a61737aebd6e3bd44123c4a281e89c8c2b2d4afb291a205b77bc7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f64696e67776973656c792f7461736b616c6c616d612f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d436f64652532305374796c65267374796c653d666f722d7468652d6261646765266c6f676f3d676974687562)](https://github.com/coding-wisely/taskallama/actions/workflows/fix-php-code-style-issues.yml?branch=main)[![Total Downloads](https://camo.githubusercontent.com/4ddfde36f15bcfb5b384b8bd4d091ddb987ba2051ffec9b7aea7ad6464f20734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64696e67776973656c792f7461736b616c6c616d612e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374)](https://packagist.org/packages/codingwisely/taskallama)

**Taskallama** is a Laravel package that provides seamless integration with Ollama's LLM API. It simplifies generating AI-powered content, from professional task writing to conversational agents, with minimal effort. Whether you're building a task management system, an HR assistant for job posts, or blog content generation, Taskallama has you covered.

**Why i built it?** Simple reasons - i want to implement a ai helper on or Project and task management system at [Taskavel.com](https://taskavel.com) to help me quickly scaffold the task. We gonna use it also on our another SaaS project, Advanced ATS system at [Bagel.blue](https://bagel.blue) to make it easy to create a Job Postings.

---

Features
--------

[](#features)

- Simple API for generating AI responses via the Ollama LLM.
- Supports task creation, conversational AI, embeddings, and more.
- Customizable agent personalities for tailored responses.
- Integration with Laravel Livewire for real-time interactions.
- Configurable options like streaming, model selection, and temperature.

---

---

Prerequisites
-------------

[](#prerequisites)

1. **Ollama Installation**

    - Taskallama requires [Ollama](https://ollama.com/) to be installed and running locally on your machine. You can download and install Ollama from their official website:
        - [Ollama Installation Guide](https://ollama.com/)
2. **Ollama Configuration**

    - By default, Taskallama connects to Ollama at `http://127.0.0.1:11434`. Ensure that Ollama is running and accessible at this address. You can update the `OLLAMA_URL` in the config file if it's hosted elsewhere.
3. **System Requirements**

    - PHP `^8.3` or higher.
    - Laravel `^11.0` or higher.

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require codingwisely/taskallama
```

Next, you should publish the package's configuration file:

```
php artisan vendor:publish --tag="taskallama-config"
```

This will publish a `taskallama.php` file in your `config` directory where you can configure your Ollama API key and other settings.

```
return [
    'model' => env('OLLAMA_MODEL', 'llama3.2'),
    'default_format' => 'json',
    'url' => env('OLLAMA_URL', 'http://127.0.0.1:11434'),
    'default_prompt' => env('OLLAMA_DEFAULT_PROMPT', 'Hello Taskavelian, how can I assist you today?'),
    'connection' => [
        'timeout' => env('OLLAMA_CONNECTION_TIMEOUT', 300),
    ],
];
```

### Usage

[](#usage)

#### Basic Example (non-stream)

[](#basic-example-non-stream)

Generate a response using a prompt:

```
use CodingWisely\Taskallama\Facades\Taskallama;

$response = Taskallama::agent('You are a professional task creator...')
    ->prompt('Write a task for implementing a new feature in a SaaS app.')
    ->model('llama3.2')
    ->options(['temperature' => 0.5])
    ->stream(false)
    ->ask();

return $response['response'];
```

#### Basic Example (stream)

[](#basic-example-stream)

Generate a stream response using a prompt:

```
use CodingWisely\Taskallama\Facades\Taskallama;

return response()->stream(function () use () {
    Taskallama::agent('You are a professional task creator...')
        ->prompt('Write a task for implementing a new feature in a SaaS app.')
        ->model('llama3.2')
        ->options(['temperature' => 0.5])
        ->stream(true)
        ->ask();
 }, 200, [
    'Cache-Control' => 'no-cache',
    'X-Accel-Buffering' => 'no',
    'Content-Type' => 'text/event-stream',
]);
```

#### Chat Example

[](#chat-example)

Create a conversational agent:

```
use CodingWisely\Taskallama\Facades\Taskallama;
$messages = [
    ['role' => 'user', 'content' => 'Tell me about Laravel'],
    ['role' => 'assistant', 'content' => 'Laravel is a PHP framework for web development.'],
    ['role' => 'user', 'content' => 'Why is it so popular?'],
];

$response = Taskallama::agent('You are a Laravel expert.')
    ->model('llama3.2')
    ->options(['temperature' => 0.7])
    ->chat($messages);
```

#### Livewire Integration Example

[](#livewire-integration-example)

Integrate Taskallama into a Livewire component for real-time task generation:

```
namespace App\Livewire;

use CodingWisely\Taskallama\Taskallama;
use Livewire\Component;

class AskTaskallama extends Component
{
    public $question = '';
    public $response = '';

    public function ask()
    {
        if (empty(trim($this->question))) {
            $this->response = "Please provide a valid question.";
            return;
        }

        try {
            $this->response = Taskallama::agent('You are a task-writing assistant.')
                ->prompt($this->question)
                ->model('llama3.2')
                ->options(['temperature' => 0])
                ->stream(false)
                ->ask()['response'] ?? "No response received.";
        } catch (\Exception $e) {
            $this->response = "Error: " . $e->getMessage();
        }
    }

    public function render()
    {
        return view('livewire.ask-taskallama');
    }
}
```

#### Embeddings Example

[](#embeddings-example)

Generate embeddings for advanced search or semantic analysis:

```
$embeddings = Taskallama::agent('Embedding Assistant')
    ->model('llama3.2')
    ->options(['temperature' => 0.5])
    ->ask();

print_r($embeddings);
```

### Additional Methods

[](#additional-methods)

#### List Local Models

[](#list-local-models)

```
$models = Taskallama::getInstance()->listLocalModels();
print_r($models);
```

#### Retrieve Model Information

[](#retrieve-model-information)

```
$modelInfo = Taskallama::getInstance()->getModelInfo('llama3.2');
print_r($modelInfo);
```

#### Retrieve Model Settings

[](#retrieve-model-settings)

```
$modelSettings = Taskallama::getInstance()->getModelSettings('llama3.2');
print_r($modelSettings);
```

#### Pull or Delete a Model

[](#pull-or-delete-a-model)

If you're pulling model, make sure you set this a background job, as it may take a while to download the model.

```
$pullModel = Taskallama::getInstance()->pull('mistral');
$deleteModel = Taskallama::getInstance()->delete('mistral');
```

### Testing

[](#testing)

Run the tests with:

```
composer test
```

### License

[](#license)

This package is open-source software licensed under the MIT License. Please see the [LICENSE.md](LICENSE.md) file for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance67

Regular maintenance activity

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

547d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3660336cb86277baabd729b38399053f1ee9945aa129b7b24a62c048d78bf533?d=identicon)[coding-wisely](/maintainers/coding-wisely)

---

Top Contributors

[![IbtissamNoukta](https://avatars.githubusercontent.com/u/78157509?v=4)](https://github.com/IbtissamNoukta "IbtissamNoukta (19 commits)")[![nezaboravi](https://avatars.githubusercontent.com/u/1515172?v=4)](https://github.com/nezaboravi "nezaboravi (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelCodingWiselytaskallamaOllama LLMlarevel ai

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codingwisely-taskallama/health.svg)

```
[![Health](https://phpackages.com/badges/codingwisely-taskallama/health.svg)](https://phpackages.com/packages/codingwisely-taskallama)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
