Skip to main content

Prism PHP

Prism PHP is a Laravel package designed to streamline the integration of Large Language Models (LLMs) and other AI functionalities into Laravel applications. It provides a unified, Laravel-native interface for interacting with various AI providers, such as OpenAI, Anthropic, Gemini, XAI, and Ollama.
Key features of Prism PHP include:
  • Unified API: 
    Offers a single, consistent API for interacting with multiple AI providers, abstracting away the complexities of different provider-specific APIs.
  • Provider Switching: 
    Enables easy switching between different AI providers by simply changing a configuration option, without requiring significant code modifications.
  • Text Generation: 
    Simplifies the generation of text using LLMs, with options for controlling parameters like temperature and topP.
  • Structured Output Handling: 
    Facilitates the generation and parsing of structured outputs from LLMs, which is crucial for building applications that require specific data formats.
  • Multi-modal Capabilities: 
    Supports handling of various input types, including text, and offers features like speech-to-text and text-to-speech.
  • Tools and Function Calling: 
    Provides a mechanism for defining and utilizing tools or functions that LLMs can call to perform specific actions or retrieve information.
  • Blade Templates as Prompts: 
    Allows the use of Blade templates for defining and managing AI prompts, promoting reusability and maintainability.
  • Prism Server: 
    Enables the creation of local AI model servers within your Laravel application, allowing for direct interaction with models.
In essence, Prism PHP aims to make AI integration feel as native and intuitive within Laravel as working with other core Laravel features like Eloquent, simplifying the development of AI-powered applications