kimodo.cpp README

The project's README from github.com/localai-org/kimodo.cpp. As one markdown file: README.md.

kimodo.cpp

GGML/C++ implementation of NVIDIA's Kimodo text-to-motion model.

Status

The five released Kimodo motion checkpoints accept either a UTF-8 prompt or a precomputed LLM2Vec embedding and generate local rotations plus root translations on CPU or Vulkan:

NVIDIA's Python API expands SOMA's predicted 30 joints to a relaxed-hand 77-joint presentation skeleton. The native API currently returns the 30 joints the model actually predicts. The text encoder uses eight-layer Vulkan chunks by default; set KIMODO_TEXT_LAYER_CHUNK=1..32 to tune VRAM use.

Included: checked GGUF loading, safetensors conversion, DDIM sampling, C/C++ APIs, conditioned multi-prompt transitions, CPU/Vulkan parity tests, skeleton-only GLB export, and a local text-to-motion demo. General constraint input, 77-joint SOMA expansion, skinned-mesh GLB export, and quantised models are not implemented yet.

Build and test on Linux

Install a C++23 compiler, CMake 3.25+, Ninja, Python 3 with the Hugging Face CLI (pip install huggingface_hub), and the Vulkan loader/headers for Vulkan support. GGML is a pinned Git submodule:

git submodule update --init --recursive
scripts/download_gguf_weights.sh --output "$PWD" --model soma-rp-v1.1
cmake --preset debug
cmake --build --preset debug
ctest --preset debug

The standard test suite requires the local motion GGUF, text bundle, and fixtures. It never downloads weights by itself. release, asan-ubsan, and fuzz presets are also available.

Nix is optional and provides these dependencies reproducibly:

nix develop path:. --command cmake --preset debug
nix develop path:. --command cmake --build --preset debug

For sanitizer work:

nix develop path:. --command cmake --preset asan-ubsan
nix develop path:. --command cmake --build --preset asan-ubsan
nix develop path:. --command env \
  LD_LIBRARY_PATH="$PWD/build/asan-ubsan/ggml/src:$PWD/build/asan-ubsan/ggml/src/ggml-vulkan:$LD_LIBRARY_PATH" \
  ASAN_OPTIONS=detect_leaks=0:abort_on_error=1 UBSAN_OPTIONS=print_stacktrace=1 \
  ctest --preset asan-ubsan --output-on-failure

Leak detection is disabled because Vulkan loader/driver allocations are global to the process. The GGUF parser fuzzer requires Clang.

API

include/kimodo/kimodo_capi.h is the C API. Model loading checks the motion GGUF and text bundle before inference. Use kimodo_generate_embedding for 4096 F32 values or kimodo_generate for text. Both return the selected model's root translations and local XYZW rotations; query the joint count from the result rather than assuming a fixed skeleton.

Demo

After building the debug preset and downloading the native GGUF bundle:

go run ./demo -addr 0.0.0.0:8094

Open http://localhost:8094. The left sidebar contains the prompt and a persistent history; choosing a previous animation restores its prompt for a new generation. Every successful animation also writes a standalone animation.glb beside its raw streams, for example demo-output/<animation-id>/animation.glb. It contains the selected animated node hierarchy (no mesh), ready to copy into a Three.js project. It is also available from /api/animations/<animation-id>/animation.glb while the demo is running.

Weights

Ready-to-run native GGML weights are published under the Hugging Face LocalAI-io organisation (not GitHub's localai-org). The reusable Llama-3-Kimodo-GGML text encoder is separate from the four redistributable motion repositories, each of which preserves a one-to-one relationship to its NVIDIA upstream:

Download one or repeat --model to install several:

scripts/download_gguf_weights.sh --output "$PWD" \
  --model soma-rp-v1.1 --model g1-rp-v1

The installer verifies each published manifest and SHA-256 hashes. Use --motion-only when supplying a precomputed 4096-float LLM2Vec embedding. SMPL-X RP is deliberately absent from the published-weight installer: its internal-R&D licence prohibits distributing derivative models, so it must be converted locally after the user obtains the upstream checkpoint under its gated terms.

The text bundle includes converted Meta Llama 3 material and retains its separate terms. Review every selected model card before downloading or redistributing.

License

The C++ port and its original tooling are licensed under Apache-2.0; see LICENSE. GGML and the model weights retain their respective licences.

Motion checkpoint Upstream terms Commercial use
Kimodo-SMPLX-RP-v1 NVIDIA Internal Scientific Research and Development Model License No; internal, non-production R&D only; derivative model redistribution is prohibited
SOMA RP/SEED v1.1 NVIDIA Open Model License Permitted by the model licence
G1 RP/SEED v1 NVIDIA Open Model License Permitted by the model licence

The SMPL-X warning is about NVIDIA's trained Kimodo checkpoint, not the mere fact that its output uses an SMPL-X-shaped 22-joint hierarchy. Converting that checkpoint to GGUF is a new runtime representation of the same weights and does not replace its licence. Skeleton names, parent links, and the Apache-2.0 port source do not by themselves make the SOMA or G1 checkpoints non-commercial. The SMPL-X Hugging Face metadata, model card, and access terms identify the internal-R&D licence; treat those restrictive terms as controlling even though an apparently inconsistent LICENSE file has also appeared in that upstream repository.

Regenerating the bundle

This is only needed to reproduce a conversion. The SMPL-X checkpoint and Llama base model are gated. After accepting their Hugging Face licences and authenticating, download the exact revisions and hash manifests with:

nix develop path:. --command hf auth login
scripts/download_weights.sh --output "$PWD/models" --with-text \
  --model smplx-rp-v1 --model soma-rp-v1.1 --model soma-seed-v1.1 \
  --model g1-rp-v1 --model g1-seed-v1

Convert the local LLM2Vec model to the native component bundle with:

nix develop path:. --command scripts/convert_llm2vec_bundle.sh \
  "$PWD/models/llama3-8b-instruct-base" "$PWD/generated/llm2vec-text-bundle"

Validate a prospective release without network access, then explicitly upload it from an account allowed to publish to LocalAI-io:

nix develop path:. --command python scripts/publish_gguf.py --component motion \
  --motion-model soma-rp-v1.1
nix develop path:. --command python scripts/publish_gguf.py --component motion \
  --motion-model soma-rp-v1.1 --upload --confirm-upstream-licences
nix develop path:. --command python scripts/publish_gguf.py --component text \
  --upload --confirm-upstream-licences

kimodo.cpp (localai-org/kimodo.cpp)

Searching Database…

这是什么?这是 NVIDIA Kimodo 文本生成动作模型的 C++/GGML 移植版:你给它一个自然语言提示词,它生成骨骼动画(关节旋转和根部位移)。
这是一个库,还是开箱即跑的应用?它是一个带 C API 的原生 C/C++ 库,外加一个模型安装器 CLI 和一个本地 Web 演示,动画可导出为 GLB 文件。
怎么让它跑起来?拉取固定的 GGML 子模块,用 CMake/Ninja 构建,然后用模型安装器下载一个已发布的 GGML 检查点(重复 --model 可下载多个),之后再运行演示或 API。
构建之前需要安装什么?一个 C++23 编译器、CMake 3.25+、Ninja、带 Hugging Face CLI 的 Python 3;如果想要 Vulkan 加速还需要 Vulkan loader/头文件;Nix 可以可重现地提供这一切。
使用 SMPL-X 模型之前有什么要注意的吗?SMPL-X RP 被有意排除在自动安装器之外,因为 NVIDIA 的内部研发许可禁止再分发衍生模型,所以你必须在接受上游的受限条款后自行转换。此外,通用约束输入、完整的 77 关节 SOMA 展开、带蒙皮网格的 GLB 导出以及量化模型也尚未实现。
它也能在 Windows 和 macOS 上运行吗?README 中的构建和测试说明仅针对 Linux。
它能驱动哪些骨骼?五个检查点覆盖三个骨骼家族:SMPL-X RP(22 个关节)、SOMA RP/SEED(30 关节紧凑控制骨架,在 NVIDIA 的 Python API 中可扩展到 77 个关节)和 G1 RP/SEED(34 个 Unitree G1 机器人关节)。
演示会产出什么?每次成功生成都会在其原始输出流旁边写出一个独立的 animation.glb,其中包含动画化的节点层级(不含网格),可直接放入 Three.js 场景,该文件也会通过演示的 HTTP API 提供。
我可以跳过文本,直接喂给它预先计算好的嵌入向量吗?可以——通过 kimodo_generate_embedding C 函数或安装器的 --motion-only 标志传入预先计算的 4096 个 float 的 LLM2Vec 嵌入,代替原始文本提示词。
模型权重来自哪里?四个可再分发检查点的即用型 GGML 权重托管在 Hugging Face 上 LocalAI-io 组织名下,与可复用的 Llama-3-Kimodo-GGML 文本编码器分开。
Size
0.4 MB
Stars
915
Updated
CommitSep 17
Age
1mo
Commits · 90 Days