mormot.ai
Two independent Pascal libraries for building AI applications on top of mORMot 2. They share no code and no dependency — pick one, or use both in the same program.
mormot.ai.sdk
The LLM client: one API for OpenAI, Anthropic and Gemini. Chat, SSE
streaming, tool calling, cost tracking, a multi-deployment router with
fallback, and an OpenAI-compatible proxy server. Ported from the LiteLLM
Python SDK to mormot.ai.litellm.* units.
Switch provider by changing one string:
LLM.Chat('openai/gpt-4o', Messages)->LLM.Chat('anthropic/claude-sonnet-4-20250514', Messages).
Start here — or jump to the API reference.
mormot2-pgvector
The retrieval half: vector search and RAG over Pascal source code, using
PostgreSQL + pgvector and a local
Ollama embedder. Ships a chunker, a hybrid retriever (cosine + tsvector),
a RAG orchestrator, and three CLI programs.
Start here — or read the RAG primer first.
Which one do I need
| I want to… | Use |
|---|---|
| Call an LLM from Pascal | mormot.ai.sdk |
| Swap providers without rewriting code | mormot.ai.sdk |
| Expose an OpenAI-compatible endpoint | mormot.ai.sdk (proxy) |
| Search my own corpus by meaning | mormot2-pgvector |
| Ground answers in my own code/documents | mormot2-pgvector (retrieval) + mormot.ai.sdk (generation) |
Status
Both projects are published and working, but under active development. The documentation tracks the code closely rather than exactly: expect a few gaps between what is written here and the very latest commit. Issues and PRs welcome.