Skip to content

Class Orion::VlmInferenceEngine

ClassList > Orion > VlmInferenceEngine

  • #include <VlmInferenceEngine.hpp>

Inherits the following classes: VlmInferenceEngineComponentBase

Public Functions

Type Name
VlmInferenceEngine (const char * compName)
~VlmInferenceEngine ()

Private Attributes

Type Name
llama_context * m_ctx
MissionMode m_currentMode
U32 m_inferenceFailures
llama_model * m_model
mtmd_context * m_mtmd
llama_sampler * m_sampler
U32 m_totalInferences

Private Functions

Type Name
void LOAD_MODEL_cmdHandler (FwOpcodeType opCode, U32 cmdSeq) override
void UNLOAD_MODEL_cmdHandler (FwOpcodeType opCode, U32 cmdSeq) override
void freeModel ()
Frees all llama.cpp state. Safe to call when already unloaded.
void inferenceRequestIn_handler (FwIndexType portNum, Fw::Buffer & buffer, F64 lat, F64 lon) override
bool loadModel ()
void modeChangeIn_handler (FwIndexType portNum, const Orion::MissionMode & mode) override
Mode change handler: stores the current mission mode.
bool runInference (const Fw::Buffer & buffer, F64 lat, F64 lon, Orion::TriagePriority & verdict, char * reason, FwSizeType reasonLen)

Private Static Functions

Type Name
void parseVerdictJson (const char * json, Orion::TriagePriority & verdict, char * reason, FwSizeType reasonLen)
Parses {"category": "HIGH"|"MEDIUM"|"LOW", "reason": "..."} from raw text.
const char * verdictToStr (const Orion::TriagePriority & v)

Public Functions Documentation

function VlmInferenceEngine

explicit Orion::VlmInferenceEngine::VlmInferenceEngine (
    const char * compName
) 

function ~VlmInferenceEngine

Orion::VlmInferenceEngine::~VlmInferenceEngine () 

Private Attributes Documentation

variable m_ctx

llama_context* Orion::VlmInferenceEngine::m_ctx;

variable m_currentMode

MissionMode Orion::VlmInferenceEngine::m_currentMode;

variable m_inferenceFailures

U32 Orion::VlmInferenceEngine::m_inferenceFailures;

variable m_model

llama_model* Orion::VlmInferenceEngine::m_model;

variable m_mtmd

mtmd_context* Orion::VlmInferenceEngine::m_mtmd;

variable m_sampler

llama_sampler* Orion::VlmInferenceEngine::m_sampler;

variable m_totalInferences

U32 Orion::VlmInferenceEngine::m_totalInferences;

Private Functions Documentation

function LOAD_MODEL_cmdHandler

void Orion::VlmInferenceEngine::LOAD_MODEL_cmdHandler (
    FwOpcodeType opCode,
    U32 cmdSeq
) override

function UNLOAD_MODEL_cmdHandler

void Orion::VlmInferenceEngine::UNLOAD_MODEL_cmdHandler (
    FwOpcodeType opCode,
    U32 cmdSeq
) override

function freeModel

Frees all llama.cpp state. Safe to call when already unloaded.

void Orion::VlmInferenceEngine::freeModel () 


function inferenceRequestIn_handler

void Orion::VlmInferenceEngine::inferenceRequestIn_handler (
    FwIndexType portNum,
    Fw::Buffer & buffer,
    F64 lat,
    F64 lon
) override

function loadModel

bool Orion::VlmInferenceEngine::loadModel () 

Loads the GGUF model and vision encoder. Returns true on success. Idempotent if already loaded.


function modeChangeIn_handler

Mode change handler: stores the current mission mode.

void Orion::VlmInferenceEngine::modeChangeIn_handler (
    FwIndexType portNum,
    const Orion::MissionMode & mode
) override


function runInference

bool Orion::VlmInferenceEngine::runInference (
    const Fw::Buffer & buffer,
    F64 lat,
    F64 lon,
    Orion::TriagePriority & verdict,
    char * reason,
    FwSizeType reasonLen
) 

Runs the full llama.cpp forward pass for one frame. On success, fills verdict and reason and returns true. On failure, returns false (caller must return buffer to pool).


Private Static Functions Documentation

function parseVerdictJson

Parses {"category": "HIGH"|"MEDIUM"|"LOW", "reason": "..."} from raw text.

static void Orion::VlmInferenceEngine::parseVerdictJson (
    const char * json,
    Orion::TriagePriority & verdict,
    char * reason,
    FwSizeType reasonLen
) 


function verdictToStr

static const char * Orion::VlmInferenceEngine::verdictToStr (
    const Orion::TriagePriority & v
) 


The documentation for this class was generated from the following file flight_segment/orion/Orion/Components/VlmInferenceEngine/VlmInferenceEngine.hpp