Search by

cognesy / instructor-polyglot

ddebowczyk

Unified LLM connectivity layer for PHP applications

Package info

github.com/cognesy/instructor-polyglot

pkg:composer/cognesy/instructor-polyglot

Statistics

Installs: 805

Dependents: 8

Suggesters: 1

Stars: 0

Open Issues: 0

v2.10.1 2026-09-13 07:31 UTC

README

Unified LLM connectivity layer for InstructorPHP.

It provides two facades:

  • Inference for chat/completion responses
  • Embeddings for vector generation

Example

<?php

use Cognesy\Polyglot\Inference\Inference;
use Cognesy\Polyglot\Inference\Reasoning\ReasoningEffort;
use Cognesy\Polyglot\Inference\Reasoning\ReasoningSelection;

$message = Inference::using('openai')
    ->withModel('gpt-5.6')
    ->withMessages('Write one short sentence about PHP.')
    ->withReasoning(ReasoningSelection::effort(ReasoningEffort::Medium))
    ->get();

echo $message->content()->toString();

Documentation

  • packages/polyglot/docs/quickstart.md
  • packages/polyglot/docs/essentials/inference-class.md
  • packages/polyglot/docs/essentials/reasoning.md
  • packages/polyglot/docs/embeddings/overview.md
  • packages/polyglot/docs/_meta.yaml