Download the PHP package lonnieezell/scribe without Composer
On this page you can find all versions of the php package lonnieezell/scribe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lonnieezell/scribe
More information about lonnieezell/scribe
Files in lonnieezell/scribe
Package scribe
Short Description A simple AI prompting library for CodeIgniter 4
License MIT
Informations about the package scribe
Myth/Scribe
A CodeIgniter 4 package that gives you a clean, driver-based abstraction for talking to AI language models. Point it at Claude, OpenAI, or Gemini — your application code stays the same regardless of which provider you use.
What it does
You define a Prompt class that describes what you want the AI to do. Scribe takes care of building the system prompt, calling the right provider, and returning a normalized AIResponse you can work with in plain PHP.
Key Features
- Driver-based — swap providers (Claude, OpenAI, Gemini) without touching your prompt classes
- Structured output — pass a JSON schema and get typed data back via
toArray() - Test-friendly —
FakeDriverlets you unit-test prompts without any HTTP calls - CI4-native — auto-discovered via Composer, wired into CI4's service layer; no manual wiring needed
What it isn't
- No streaming — responses are returned as a complete string, not streamed token-by-token
- No conversation management — each
run()call is stateless; multi-turn chat history is your responsibility - No agent loop — there is no built-in tool-calling or autonomous reasoning loop
- Not a full AI framework — no embeddings, RAG, vector search, or fine-tuning helpers
- Not a managed client — it does not retry, throttle, or rotate API keys on your behalf
If you need those features, this library is intentionally out of scope for them.
Requirements
- PHP 8.2+
- CodeIgniter 4.7+
Installation
Install via Composer:
Publish the config file so you can add your API keys:
Then open app/Config/AI.php and set at least one driver's apiKey:
Quick Start
1. Create a Prompt class
2. Run it
3. Test it
Configuration
The AI config class lives at app/Config/AI.php after publishing. The key settings:
| Key | Description |
|---|---|
$defaultDriver |
Driver used when none is specified on the prompt (default: 'claude') |
$drivers['claude'] |
Anthropic Claude settings: apiKey, model, timeout |
$drivers['openai'] |
OpenAI settings: apiKey, model, timeout |
$drivers['gemini'] |
Google Gemini settings: apiKey, model, timeout |
A specific prompt can override the driver at runtime:
Documentation
Full documentation — installation, core concepts, configuration, structured output, testing, and the changelog — is available at:
https://lonnieezell.github.io/scribe
Contributing
- Fork the repo and create a feature branch.
- Run the full CI suite before opening a PR:
composer ci - All new code must include tests and pass PHPStan level 5.
License
MIT — see LICENSE.