Sunday, February 02, 2025

Delphi and AI [7]: How good are local DeepSeek models (for Delphi)

Due to potential privacy concerns with DeepSeek servers (we’re unsure if the data sent over the paid API is kept private), I looked into some smaller DeepSeek models available on the Ollama.com site. These models use less complex AI with fewer parameters than the online version, but they might still be good enough for an average Delphi programmer. We’ll see.

For testing, I used a powerful RTX 4090 card with 24 GB of memory. If your graphics card has less memory, your selection of useful models will be more limited.

I asked all models the same two questions: one on a general programming topic and another specific to the FireMonkey platform. The first question was:

"I have a multiline string containing newline ASCII characters (TMemo.Text). I want to change it to a single-line string with only printable ASCII characters. I could do that with BASE64 encoding, for example. I would, however, like to keep the text as much readable as possible by "encoding" only non-printable characters. Is there a simple way to do that?"

You can check Codellama’s response in an older post (Codellama being the only local model I had tested so far): Delphi and AI [5]: Encoding Multi-line Strings.

Last week, I asked the same question to the online DeepSeek-Reasoning model. Check the answers in this post: Delphi and AI [6]: DeepSeek-Reasoning Model.

The second question was:

"How can I copy text to clipboard in a Delphi Firemonkey application?"

Read here for Codellama’s response: Delphi and AI [4]: Device-ndependent clipboard.

The answer from the online DeepSeek-Reasoning model can be found at the end of this post.

Let’s see how the models are performing! As always, full logs are available on GitHub.