Polyglot Package Cheatsheet
Code-verified API reference forpackages/polyglot.
Core Facades
Native Batch Jobs (Early Access)
$saved, reconstruct it with BatchReference::fromArray() in a
later process, then call retrieve(), results(), cancel(), or
listJobs() explicitly. See docs/batch-inference/overview.md for the
asynchronous lifecycle and provider capabilities.
Inference Quick Start
Use a preset for the normal path:Inference Constructors
Inference Request Builder Methods
Inference Execution Surfaces
Reasoning, Model Facts, and Pricing
Reasoning is projected from the ordered assistant message:(driver, wire model) key. An absent key
returns unknown facts; the catalog does not infer from the model name:
InferenceRuntime. Reuse one discovered catalog at the application composition
root when local capability policy or metadata is needed. Known semantic fallback
is off by default; direct PHP config uses allowLossyFallback: true, while
Laravel and Symfony connection config uses allow_lossy_fallback: true. Every
accepted adjustment is observable on the effective request and
InferenceRequested event.
Pricing is caller-owned and is not stored in model catalog records:
Streaming (InferenceStream)
Inference Runtime / Provider Setup
Embeddings Quick Start
Embeddings Constructors and Builder Methods
Embeddings Runtime / Provider Setup
Decision Quick Start
Decision Runtime and Pending Result
sdm.decision and sdm.decision.attempt. See docs/decision/overview.md for
serialization, structured content, dynamic options, retry ownership, and live testing.
Bundled Decision presets are explicit:
Provider compatibility does not imply equal quality or calibration. Run the
fixed example corpus with
php examples/B06_Decisions/ProviderEvaluation/evaluate.php <preset>, then
replace it with independently labeled application cases.
Testing
Deterministic test seams:Tests\Support\FakeInferenceDriver- queue sync
InferenceResponsefixtures or streamingPartialInferenceDeltabatches - best for most inference runtime tests that do not need HTTP or adapter coverage
- queue sync
Tests\Support\FakeEmbeddingsDriver- queue
EmbeddingsResponsefixtures and record handled requests - best for most embeddings runtime and memoization tests
- queue
MockHttpDriver- use when transport and provider adapter behavior still matter
- best for golden tests, request assertions, and provider-specific error-path coverage
POLYGLOT_TYPESAFE_LIVE=1- opts into the bounded TypeSafe integration smoke
POLYGLOT_CLASSIFIER_DEV_LIVE=1,POLYGLOT_CLEF_LIVE=1,POLYGLOT_FASTINO_LIVE=1,POLYGLOT_JEFF_LIVE=1,POLYGLOT_LAYA_LIVE=1, andPOLYGLOT_PERPLEXITY_LIVE=1- opt into the corresponding bounded provider smoke
- ordinary test runs remain offline and do not require credentials, Python, model weights, or special hardware