Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

Delphi-AI-Demos

Several Demos in Delphi that show how to use or access LLMs

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

Delphi AI Demos

A collection of Delphi demo applications that show how to integrate AI and Large Language Model (LLM) APIs into Delphi projects. Each demo is self-contained in its own subdirectory with its own README.

Demos

Demo Description Dependencies
ChatDemo Two chat applications that connect to the OpenAI API -- a simple version using only built-in Delphi classes and an advanced version with streaming responses and Markdown rendering Simple: none; Advanced: DelphiGenAI, MarkdownProcessor

Getting Started

  1. Clone with submodules:

    pascal
    git clone --recurse-submodules https://github.com/omonien/Delphi-AI-Demos.git

    Or, if already cloned:

    pascal
    git submodule update --init --recursive
  2. Requirements:

    • Delphi 12.x or 13 (RAD Studio Athens or later)
    • An OpenAI API key (or compatible endpoint)
  3. Navigate into any demo subdirectory and follow the README there for specific setup and build instructions.

Repository Structure

pascal
Delphi-AI-Demos/
  ChatDemo/              Chat applications using the OpenAI API
    source/                Delphi source files
    source/simple/         Simple demo (no dependencies)
    libs/                  Git submodules (DelphiGenAI, MarkdownProcessor)
    Build/                 Build scripts
    Chat.groupproj         Project group
    README.md              Demo-specific documentation

API Key Configuration

All demos look for the API key in the same way:

  1. A settings.ini file next to the executable:
    ini
    [API]
    Key=sk-your-api-key-here
  2. Or the OPENAI_API_KEY environment variable as fallback.

Never commit your API key. The .gitignore already excludes settings.ini.

License

MIT License -- Copyright 2026 Olaf Monien