Download the PHP package artisanpack-ui/ai without Composer

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

ArtisanPack UI AI

Shared AI foundation for the ArtisanPack UI ecosystem. Sits alongside artisanpack-ui/core and artisanpack-ui/hooks as a shared layer that other ArtisanPack UI packages can optionally depend on.

Built on top of laravel/ai.

See the AI RFC for design context and the roadmap for downstream feature work.

What this package gives you

Installation

Publish the config if you want to customise defaults:

Quick start

Access the shared foundation via the facade or helper:

Run an agent shipped by any ecosystem package (this example uses artisanpack-ui/seo):

That single call runs the full pipeline: feature-gate check → credential resolution → cache lookup → provider call → telemetry event → cache store. There's no separate setup on the calling side.

Documentation

Start at docs/home.md for the full documentation index. Direct links:

Hooks

The package fires hooks from artisanpack-ui/hooks at the shared prompter seam, so a downstream package can add safety prompts, PII scrubbing, or audit logging uniformly across every agent — no per-agent patching.

Hook Type Fired Signature
ap.ai.registerFeatures filter on service-provider boot, so packages can register their feature agents (FeatureRegistry $registry)
ap.ai.promptGenerated filter inside LaravelAiAgentPrompter::prompt() before the provider call (string $prompt, array $context)
ap.ai.responseReceived action inside LaravelAiAgentPrompter::prompt() after the provider returns, before JSON decoding (string $response, array $context)
ap.ai.registerTools filter inside LaravelAiAgentPrompter::prompt() once per prompt, after the calling agent's own withTools() list is seeded (array $tools, array $context)

$context for the prompt/response/tools hooks carries provider, model, instructions, and attachments (count).

Admin surfaces

Once cms-framework is installed and migrations are run, the following surfaces register automatically under Admin → Packages → AI:

Each page is capability-gated on manage_ai_settings. cms-framework wires the capability; other stacks must define it themselves.

JSON API

The React and Vue starter kits consume the same data through REST endpoints so they don't have to depend on Livewire. All endpoints are Sanctum-authenticated by default and gated on the same manage_ai_settings ability.

Method Path Purpose
GET /api/artisanpack-ai/settings Read current settings (no plaintext key)
PUT /api/artisanpack-ai/settings Update credentials + overrides
GET /api/artisanpack-ai/features List registered features
POST /api/artisanpack-ai/features/{key}/toggle Enable or disable a feature
GET /api/artisanpack-ai/usage?from=…&to=… Aggregations for the dashboard
POST /api/artisanpack-ai/test-connection Probe the provider without saving

Customise the prefix, middleware, and ability via config('artisanpack.ai.api'). Full schema in docs/reference/api-schema.json.

Drop-in React / Vue clients

Both @artisanpack-ui/react and @artisanpack-ui/vue ship an ai/ subpath that consumes these endpoints — SettingsPage, UsageDashboard, and FeatureToggles components plus a small createAiApiClient fetch wrapper.

See docs/integration/react-vue-integration.md for authentication, custom fetch wrappers, and long-running agent-output streaming via useStreamingText.

Local models (Ollama)

Ollama is a first-class provider in v1.0.0. Every downstream package that ships an agent is expected to work against Ollama in addition to a cloud provider, so a self-hosted CMS can run without ever paying per-token fees.

1. Install and start Ollama

2. Point the ai package at Ollama

Either flip the environment file:

...or select Ollama in the AI Settings admin page (Admin → Packages → AI → Settings). The admin UI prompts for a base URL instead of an API key when Ollama is chosen, and the "Test connection" button probes GET {base_url}/api/tags before saving.

3. Recommended models per feature

The following ArtisanPack UI agents have been validated end-to-end against a local Ollama daemon:

Agent (feature key) Ollama model Notes
seo.suggest_meta_description llama3.2:3b ~5s per suggestion on an M1; identical schema to Anthropic.
media.generate_alt_text llama3.2:1b Vision-free path — pass the filename + caption context.
cms.summarize_content qwen2.5:7b Higher token budget benefits from the sharper model.

Override the recommendation per feature via config or the admin's advanced-tab per-feature model selector:

4. Local integration test

The package ships a Pest test suite that exercises ConnectionTester with a stubbed Ollama response. To run the real end-to-end suite against your daemon, set:

CI leaves ARTISANPACK_AI_OLLAMA_E2E unset — the gated group is skipped when no daemon is reachable so pipelines stay green on hosted runners.

Contributing

As an open source project, this package is open to contributions from anyone. Please read through the contributing guidelines to learn more about how you can contribute.


All versions of ai with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^12.0|^13.0
artisanpack-ui/core Version ^1.0
artisanpack-ui/hooks Version ^1.3
laravel/ai Version ^0.11.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 artisanpack-ui/ai contains the following files

Loading the files please wait ...