godorama is a Godot 4 GDExtension that embeds llama.cpp directly through libllama.
It is intended to be a production-facing local runtime for Godot projects, not a subprocess wrapper.
LlamaLoraAdapterConfig- editor-friendly
Resourcefor LoRA adapter path + scale
- editor-friendly
LlamaMultimodalConfig- editor-friendly
Resourceformmprojprojector configuration
- editor-friendly
LlamaModelConfig- editor-friendly
Resourcefor GGUF model configuration - optional LoRA adapter array
- optional multimodal projector config
- editor-friendly
LlamaSession- async text generation
- message-based chat templating
- multimodal generation with image/audio inputs
- tokenization / detokenization
- text embeddings
- LoRA adapter count and multimodal capability introspection
- request-scoped multimodal token accounting
LlamaEvalSession- async embedding-prefill evaluation over
inputs_embeds - optional hidden-state readback
- intended for native evaluation workflows such as hybrid speech runtimes
- async embedding-prefill evaluation over
RagCorpusConfigRagCorpusRagAnswerSession
- Model open is asynchronous. Godot callers must use
poll()to flush queued signals on the main thread. - LoRA adapters are loaded at
open()time throughllama.cpp's stable adapter API and applied when the session context is created. - Chat message templating goes through
llama.cpp'scommon/chat.*Jinja path, not the limitedllama_chat_apply_template()helper. disable_thinkingis meaningful for message-templated generation. It is not a magic prompt rewrite for rawgenerate_async(prompt).LlamaEvalSessionis the supported way to run prefill/eval style embedding inputs from Godot without exposing rawllama_*handles.- Multimodal requests are submitted through
generate_multimodal_async()/generate_multimodal_messages_async(). The Godot layer validates media dictionaries, file readability, and media-marker counts before the request reaches the worker thread. - Completed multimodal requests include
multimodal_token_countin theircompletedstats, andget_multimodal_token_count(request_id)returns the stored count for completed multimodal requests. - RAG storage is local-only and embedded.
RagCorpususes libSQL in-process, with exact cosine retrieval executed in SQL by default. - The current RAG surface is intentionally cosine-only. The old
vector_metricsetting is no longer part ofRagCorpusConfig. - Runtime log verbosity is filtered by default. Set
GODORAMA_LLAMA_LOG_LEVEL=debug|info|warn|error|silentto override.
cmake --preset dev
cmake --build --preset build-dev
ctest --preset test-dev --output-on-failureThe current build also expects a thirdparty/libsql checkout at commit
0653c5788d77ef16a97c56ff3e9fdc11717a72d9. docs/BUILD.md includes the exact
setup commands.
Optional multimodal scaffold:
cmake --preset dev -DGODOT_LLAMA_ENABLE_MTMD=ONIf a sandboxed environment interferes with the ctest wrapper itself, run the test binaries directly from build/dev/tests/... to distinguish a harness problem from a test failure.
docs/BUILD.mddocs/API.mddocs/ARCHITECTURE.mddocs/RAG_ARCHITECTURE.mddocs/RAG_API.mddocs/RAG_EVALUATION.md