DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
docwire::ai::llama::llama_runner Class Reference

This class is intended to load a Llama model with its correct model path and respective configuration and run inference on the prompt supplied along with the model configuration. More...

#include <llama_runner.h>

Inheritance diagram for docwire::ai::llama::llama_runner:
docwire::ai::ai_runner docwire::with_pimpl< llama_runner > docwire::with_pimpl_base

Public Member Functions

 llama_runner (const model_inference_config &config)
 
std::string process (const std::string &input) override
 Synchronously process input and return generated text. More...
 
std::vector< double > embed (const std::string &input) override
 Generate an embedding for the given input. More...
 
virtual void unload () override
 Unload the model and free associated resources. –!Must be thread-safe!– and safe to call concurrently with process()/embed().
 
- Public Member Functions inherited from docwire::ai::ai_runner
virtual ~ai_runner ()=default
 Virtual destructor. More...
 

Additional Inherited Members

- Protected Types inherited from docwire::with_pimpl< llama_runner >
using impl_type = pimpl_impl< llama_runner >
 
- Protected Member Functions inherited from docwire::with_pimpl< llama_runner >
impl_typecreate_impl (Args &&... args)
 
 with_pimpl (Args &&... args)
 
 with_pimpl (with_pimpl< llama_runner > &&other) noexcept
 
 with_pimpl (std::nullptr_t)
 
with_pimploperator= (with_pimpl &&other) noexcept
 
impl_typeimpl ()
 
const impl_typeimpl () const
 

Detailed Description

This class is intended to load a Llama model with its correct model path and respective configuration and run inference on the prompt supplied along with the model configuration.

Definition at line 27 of file llama_runner.h.

Member Function Documentation

◆ embed()

std::vector<double> docwire::ai::llama::llama_runner::embed ( const std::string &  input)
overridevirtual

Generate an embedding for the given input.

Must be thread-safe.

Implements docwire::ai::ai_runner.

◆ process()

std::string docwire::ai::llama::llama_runner::process ( const std::string &  input)
overridevirtual

Synchronously process input and return generated text.

Must be thread-safe.

Implements docwire::ai::ai_runner.


The documentation for this class was generated from the following file: