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
llama_runner.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_AI_LLAMA_RUNNER_H
13 #define DOCWIRE_AI_LLAMA_RUNNER_H
14 
15 #include "ai_runner.h"
16 #include "ai_llama_export.h"
17 #include "model_inference_config.h"
18 #include "pimpl.h"
19 
20 namespace docwire::ai::llama
21 {
27 class DOCWIRE_AI_LLAMA_EXPORT llama_runner : public ai_runner, public with_pimpl<llama_runner>
28 {
29 
30  public:
31  explicit llama_runner(const model_inference_config& config);
32 
33  std::string process(const std::string& input) override;
34 
35  std::vector<double> embed(const std::string& input) override;
36 
37  virtual void unload() override;
38 };
39 
40 } // namespace docwire::ai::llama
41 
42 #endif
Abstract interface for AI model runners.
Definition: ai_runner.h:42
This class is intended to load a Llama model with its correct model path and respective configuration...
Definition: llama_runner.h:28
std::vector< double > embed(const std::string &input) override
Generate an embedding for the given input.
virtual void unload() override
Unload the model and free associated resources. –!Must be thread-safe!– and safe to call concurrently...
std::string process(const std::string &input) override
Synchronously process input and return generated text.