#1339·GenieX

Feature request: Support caller-provided input embeddings for LLM generation

Author: hobbitlv1Created Aug 14, 2026Updated Sep 23, 2026

Is your feature request related to a problem? Please describe.

GenieX currently supports LLM generation from UTF-8 text or pre-tokenized input_ids, but it does not expose an API for providing continuous input embeddings directly to the LLM.

This prevents integrating arbitrary external modality encoders with GenieX, for example:

external encoder -> projector -> [n_tokens, n_embd] float embeddings -> GenieX LLM

Upstream llama.cpp already supports continuous embedding input through llama_batch.embd, but the GenieX llama_cpp plugin currently exposes only text/token input.

This request is different from #1149 ("Support embedding models"). #1149 concerns models that output embeddings for use cases such as RAG. This request concerns providing embeddings as input to a generative LLM.

Describe the solution you'd like

Please expose a supported API for caller-provided continuous embeddings, initially for the llama_cpp backend.

At minimum, it should allow the caller to provide:

a contiguous float embedding tensor; the number of embedding tokens; the embedding dimension; validation that the embedding dimension matches the loaded model; embedding prefill followed by normal autoregressive generation.

Ideally, the API would also support mixing token/text input with external embedding segments, for example:

text prefix + projected external embeddings + text suffix -> LLM generation

I do not have a strong preference for the exact public API design. It could be an extension of geniex_LlmGenerateInput, a dedicated prefill API, or a generic ordered input-segment API.

The important functionality is to allow caller-provided [n_tokens, n_embd] float embeddings to reach the llama.cpp inference path using llama_batch.embd.

Backends that do not support this initially could return GENIEX_ERROR_COMMON_PARAM_NOT_SUPPORTED.

Describe alternatives you've considered

Converting non-text data to text or numerical strings. This increases context usage and can lose information. Quantizing continuous data into custom discrete tokens. This introduces an additional information bottleneck and requires vocabulary/token integration. Maintaining a custom GenieX fork that exposes llama_batch.embd. This appears technically feasible, but requires continuously rebasing the modification as GenieX evolves. Using the VLM/mmproj interface. This is designed around supported vision/audio architectures and does not provide a generic interface for arbitrary external encoders/projectors.

Additional context

Upstream llama.cpp already provides the underlying continuous-embedding input mechanism through llama_batch.embd. The requested feature would expose this capability through GenieX without requiring GenieX to implement or know anything about the external encoder.

A generic API could enable custom vision, audio, time-series, sensor, scientific, and other modality encoders to use GenieX as the generative LLM backend.

My use case is connecting a custom time-series/sensor encoder and projector to a generative LLM, but the proposed API would be generic and applicable to any external modality encoder.

Thanks!