Blog

All Blog Posts  |  Next Post  |  Previous Post

Add AI superpower to your Delphi & C++Builder apps part 1

Today

TMS Software Delphi  Components
Image generated by OpenAI

Many software developers view AI primarily as a tool to boost productivity and improve their software development skills. But there’s another powerful angle: using AI to enhance and extend the functionality of the applications we build. That’s exactly what we’ve been exploring over the past year—specifically from the perspective of Delphi and C++Builder developers. In this blog series, we’ll walk you through, step by step, the tools and techniques we’ve already developed for you to leverage. At the same time, we hope to spark a lively discussion and inspire new ideas about how AI can help us build software with functionality that feels out of this world. In this first article, we’ll start with a small but essential step: how to use LLMs from within your applications. In the next part, we’ll dive into LLM function calling and how it can enable deep integrations with your apps. 

Integrating LLMs via REST API with TMS FNC Cloud Pack's TTMSFNCCloudAI Component

The surge in Large Language Models (LLMs) such as ChatGPT, Claude, Mistral, and others has revolutionized how applications interact with language. Whether you want to translate content, summarize data, or build intelligent assistants, these models provide a consistent and scalable interface through REST APIs.

In this article, we’ll explore how you can abstractly and efficiently work with a wide range of LLM services—like OpenAI, DeepSeek, Claude, Gemini, Perplexity, Grok, Ollama, Mistral —using the powerful TTMSFNCCloudAI component from TMS FNC Cloud Pack.


A Unified Approach to LLM Integration

Each cloud LLM provider offers slightly different API semantics, authentication methods, and payload structures. However, at a higher level, their interfaces boil down to a simple pattern:

  1. Send text input ("prompt")

  2. Receive generated text response ("completion")

This is commonly referred to as the Completion REST API.

With TTMSFNCCloudAI, you don’t need to worry about low-level details. The component abstracts away REST communication, authentication, and request building, so you can focus purely on integrating language capabilities into your app.

Supported AI services include at this moment:
TMS Software Delphi  Components

  • OpenAI (ChatGPT)
    Leading AI research and deployment company, creator of GPT-4 and ChatGPT.

  • Gemini (Google AI)
    Google's flagship multimodal AI family developed by Google DeepMind.

  • Claude (Anthropic)
    Anthropic’s family of helpful, harmless, and honest AI assistants.

  • Grok (xAI)
    AI developed by Elon Musk’s xAI, integrated with X (formerly Twitter).

  • DeepSeek
    Open-source and commercial LLMs focused on code and reasoning tasks.

  • Mistral
    European AI company offering open-weight LLMs like Mistral and Mixtral.

  • Ollama
    A local runtime for running LLMs on your own machine with a simple CLI.

  • Perplexity AI
    An AI-powered answer engine combining web search and conversational AI.


Common Use Cases

You can use these models for a variety of natural language processing tasks:

  • Translation between languages

  • Summarization of documents or datasets

  • Information retrieval from user input

  • Conversational agents and chatbots

  • And much more you'll uncover in the next article on function calling! 

All these use cases follow the same underlying pattern: send context → receive a response. This makes them perfect candidates for abstraction.


Step-by-Step Integration Workflow

The typical workflow using the TTMSFNCCloudAI component looks like this:

  1. Request an API key from the LLM provider (e.g., OpenAI, Anthropic).

  2. Select your model (e.g., gpt-4, claude-3-7-sonnet, mistral-medium).

  3. Set the prompt context, and optionally the system role (instructions for the model’s behavior).

  4. Send the request via HTTPS POST.

  5. Receive and process the generated response text.

All of this is encapsulated cleanly by the component, making it straightforward to switch between providers or models.


Code Example: Ask Claude About Development Tools

Here's a practical example of how to call Anthropic's Claude model using TTMSFNCCloudAI in a Delphi or C++Builder application:

pascal
FFNCAI.Settings.ClaudeModel := 'claude-3-7-sonnet-20250219'; FFNCAI.APIKeys.Claude := KEY_CLAUDE; FFNCAI.Service := aiClaude; FFNCAI.Context.Text := 'What is a powerful development tool for creating native Windows ' + 'applications with a RAD component based visual approach?'; FFNCAI.SystemRole.Text := 'You are an IT expert'; FFNCAI.Execute();

Once Execute is called, the request is sent, and the response text will be available via the result event or property for further use in your application.

And of course it is reassuring to see that the LLM responds with Delphi as its first recommendation 😉:

TMS Software Delphi  Components


Why Use TTMSFNCCloudAI?

- Rapid Development: Eliminate the boilerplate of REST clients and JSON handling.
- Flexibility: Switch between LLM providers without rewriting logic.
- RAD Integration: Seamlessly integrates into the Delphi or C++Builder apps built for Windows, macOS, Linux, iOS, Android.
- Cross-platform: Build once, deploy anywhere.


Get started

As LLMs become increasingly critical in building intelligent applications, having a robust and unified abstraction like TTMSFNCCloudAI allows you to stay focused on the logic and user experience—not the plumbing.

In upcoming articles, we’ll dive deeper into function calling, RAG, agents, MCP servers & clients.  
If you have an active TMS ALL-ACCESS license, you can now get also access to the first test version of TMS AI Studio that uses the TTMSFNCCloudAI component but also has everything on board to let you build MCP servers and clients. 
Register now to participate in this testing via this landing page.

TMS Software Delphi  Components



Bruno Fierens




This blog post has not received any comments yet.



Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post