# salesforce/einstein-platform architecture

> Architecture diagram of the GitHub repository salesforce/einstein-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/salesforce/einstein-platform
- Repository: https://github.com/salesforce/einstein-platform

## Overview

##### Main Components

a) Core Components:
- Einstein AI Platform (Central Hub)
- LLM Open Connector Interface
- Einstein Trust Layer
- Einstein Studio Model Builder
- Models API Service
- External LLM Providers Integration Layer

b) Integration Components:
- Built-in LLM Connectors (OpenAI, Azure OpenAI, Google Gemini Pro, Anthropic Claude)
- Custom LLM Connector Implementation Layer
- Authentication & Security Layer

**[Client Applications Layer]**
- ↓
**[Einstein Platform Layer]**
- ↓
**[Trust & Security Layer]**
- ↓
**[Connector Layer]**
- ↓
**[External LLM Services Layer]**

##### Key Elements to Highlight

a) API Endpoints:
- `/chat/completions` endpoint
- Models API endpoints
- Authentication flow paths

b) Security Components:
- IP allowlisting mechanism
- Bearer token authentication
- HTTPS/443 port requirement

c) Integration Patterns:
- Both built-in and custom connector paths
- Standardized API specification flow

##### Specific Implementation Details

- The OpenAPI specification compliance
- The transformation layer between external LLMs and the standardized interface
- The Einstein Trust Layer's role in securing communications
- The connection points with Einstein Studio Model Builder

##### Notes Section

Technical notes regarding:
- Required HTTPS configuration
- IP allowlisting requirements
- Authentication header formats
- Usage object specifications

Remember to include version information and any relevant compliance or certification badges that apply to the architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef platform fill:#3498db,stroke:#2980b9,color:white
    classDef security fill:#27ae60,stroke:#219a52,color:white
    classDef external fill:#e67e22,stroke:#d35400,color:white
    classDef api fill:#9b59b6,stroke:#8e44ad,color:white
    classDef connector fill:#95a5a6,stroke:#7f8c8d,color:white
    
    %% Client Layer
    subgraph ClientLayer
        Client[Client Applications]
    end

    %% Einstein Platform Layer
    subgraph EinsteinPlatform
        EAP[Einstein AI Platform]:::platform
        Studio[Einstein Studio Model Builder]:::platform
        ModelAPI[Models API Service]:::api
        OpenConnector[LLM Open Connector Interface]:::api
    end
    click ModelAPI "https://github.com/salesforce/einstein-platform/blob/main/api-specs/models/models.yaml"
    click OpenConnector "https://github.com/salesforce/einstein-platform/blob/main/api-specs/llm-open-connector/llm-open-connector.yml"

    %% Trust & Security Layer
    subgraph SecurityLayer
        TrustLayer[Einstein Trust Layer]:::security
        Auth[Authentication & Security]:::security
        IPAllow[IP Allowlisting]:::security
    end

    %% Connector Layer
    subgraph ConnectorLayer
        BuiltIn[Built-in LLM Connectors]:::connector
        Custom[Custom LLM Connector Implementation]:::connector
    end

    %% External Services Layer
    subgraph ExternalLayer
        OpenAI[OpenAI]:::external
        Azure[Azure OpenAI]:::external
        Gemini[Google Gemini Pro]:::external
        Claude[Anthropic Claude]:::external
        AWS[AWS]:::external
        Groq[Groq]:::external
        HF[HuggingFace]:::external
        Samba[SambaNova]:::external
        IBM[IBM]:::external
    end
    click AWS "https://github.com/salesforce/einstein-platform/tree/main/documentation/cookbook-assets/llm-open-connector-aws"
    click Groq "https://github.com/salesforce/einstein-platform/tree/main/documentation/cookbook-assets/llm-open-connector-groq"
    click HF "https://github.com/salesforce/einstein-platform/tree/main/documentation/cookbook-assets/llm-open-connector-huggingface"
    click Samba "https://github.com/salesforce/einstein-platform/tree/main/documentation/cookbook-assets/llm-open-connector-sambanova"

    %% Connections
    Client --> EAP
    EAP --> Studio
    EAP --> ModelAPI
    EAP --> OpenConnector
    OpenConnector --> TrustLayer
    TrustLayer --> Auth
    Auth --> IPAllow
    TrustLayer --> BuiltIn
    TrustLayer --> Custom
    BuiltIn --> OpenAI & Azure & Gemini & Claude
    Custom --> AWS & Groq & HF & Samba & IBM

    %% Legend
    subgraph Legend
        L1[Platform Components]:::platform
        L2[Security Components]:::security
        L3[External Services]:::external
        L4[API Components]:::api
        L5[Connector Components]:::connector
    end
```
