|
ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
|
Namespaces | |
| namespace | detail |
| namespace | nfc |
Classes | |
| struct | ChatFormat |
| struct | ChatPrompt |
| struct | ChatReply |
| struct | ChatSetup |
| class | ChatTokenizer |
| class | ChatTokenizerOf |
| struct | ChatVocab |
| struct | Conversation |
| class | QwenNfcTokenizer |
| class | ReplyBuilder |
| class | ReplyStream |
| struct | RequestError |
| struct | ScoreItem |
| struct | ScoreModel |
| class | SpmTokenizer |
Typedefs | |
| using | ChatDecode = std::function< std::string(const std::vector< int > &)> |
Enumerations | |
| enum class | Utf8Part { whole , ill_formed , cut } |
| using ember::ChatDecode = typedef std::function<std::string(const std::vector<int>&)> |
Definition at line 30 of file chat_reply.h.
|
strong |
| Enumerator | |
|---|---|
| whole | |
| ill_formed | |
| cut | |
Definition at line 26 of file utf8_text.h.
| ChatPrompt ember::build_chat_prompt | ( | const ChatFormat & | f, |
| const Conversation & | c, | ||
| int | max_new, | ||
| int | ctx, | ||
| Count | count | ||
| ) |
Definition at line 449 of file chat_request.h.
References build_general_prompt(), c, j, out, and ember::ChatPrompt::prompt.
Referenced by bpe_build_prompt().
| ChatPrompt ember::build_general_prompt | ( | const ChatFormat & | f, |
| const Conversation & | c, | ||
| int | max_new, | ||
| int | ctx, | ||
| Count | count | ||
| ) |
Definition at line 411 of file chat_request.h.
References c, microtorch::chat::exchanges(), j, k, out, p, ember::ChatPrompt::prompt, microtorch::chat::render(), and microtorch::chat::render_pieces().
Referenced by build_chat_prompt().
|
inline |
Definition at line 210 of file chat_request.h.
References c, chat_conversation_tools(), ember::detail::history_content(), ember::detail::history_pair(), j, ember::detail::refuse_tool_members_v1(), ember::detail::refuse_tools_v1(), ember::detail::thinking_field(), and ember::detail::tool_turns().
Referenced by main().
|
inline |
Definition at line 146 of file chat_request.h.
References c, ember::Conversation::general, ember::detail::history_content(), ember::detail::history_pair(), j, ember::detail::push_system(), ember::detail::thinking_field(), ember::detail::tool_definitions(), and ember::detail::tool_turn_message().
Referenced by chat_conversation().
Definition at line 13 of file chat_gguf.h.
References j, microtorch::bpe::read_gguf_tokenizer(), str, and v.
Referenced by tinyllama::TinyLlamaSession::TinyLlamaSession().
|
inline |
Definition at line 269 of file chat_tokenizer.h.
References id, j, text, and tok.
Referenced by make_chat_setup().
|
inline |
Definition at line 22 of file determinism.h.
Referenced by attention_cuda_optimized(), attention_devpos_cuda(), deterministic_cublas_env(), TinyLlamaModel::initialize_gpu_and_rope(), main(), and rmsnorm_vector_cuda_optimized().
|
inline |
Definition at line 32 of file determinism.h.
References deterministic(), and j.
Referenced by TinyLlamaModel::initialize_gpu_and_rope().
Definition at line 153 of file utf8_text.h.
References j, and utf8_valid_json().
Referenced by json_out().
Definition at line 239 of file chat_tokenizer.h.
References j, and microtorch::chat::kV1Specials.
|
inline |
Definition at line 24 of file state_tokens.h.
Referenced by tinyllama::TinyLlamaSession::bpe_prompt_ids().
Definition at line 279 of file chat_tokenizer.h.
References microtorch::chat::check_control_tokens(), control_ids_check(), j, ember::ChatFormat::of(), microtorch::chat::resolve(), token_id(), and v.
Referenced by tinyllama::TinyLlamaSession::TinyLlamaSession().
Definition at line 275 of file chat_request.h.
Referenced by openai_conversation(), and openai_conversation_tools().
|
inline |
Definition at line 353 of file chat_request.h.
References body, c, j, openai_content(), openai_conversation_tools(), ember::detail::openai_thinking(), ember::detail::refuse_tool_members_v1(), ember::detail::refuse_tools_v1(), and ember::detail::tool_turns().
Referenced by main().
|
inline |
Definition at line 305 of file chat_request.h.
References body, c, ember::Conversation::general, j, openai_content(), ember::detail::openai_thinking(), ember::detail::push_system(), ember::detail::tool_definitions(), and ember::detail::tool_turn_message().
Referenced by openai_conversation().
|
inline |
Definition at line 31 of file parallel_for.h.
Referenced by attention_batch_cpu(), attention_bias_batch_cpu(), attention_relkv_batch_cpu(), attention_rows_batch_cpu(), attention_window_batch_cpu(), matmul_f32_f32_batch_cpu(), matmul_rows_f32_batch_cpu(), and matvec_f32_f32_vector_cpu().
|
inline |
Definition at line 92 of file score.h.
References body, j, n, out, ember::ScoreItem::prompt, and score_state_ids_error().
Referenced by main().
|
inline |
Definition at line 45 of file chat_reply.h.
References c, j, p, microtorch::chat::parse_reply(), strip_reply_ws(), and utf8_valid().
Referenced by bpe_run(), and ember::ReplyBuilder::finish().
|
inline |
|
inline |
|
inline |
Definition at line 58 of file score.h.
Referenced by parse_score_body().
|
inline |
Definition at line 41 of file chat_tokenizer.h.
Referenced by make_chat_setup(), and ember::ChatFormat::of().
| Json ember::tool_calls_json | ( | const std::vector< chat::ToolCall > & | calls | ) |
Definition at line 29 of file utf8_text.h.
References c, cut, ill_formed, j, n, and whole.
Referenced by utf8_settled(), and utf8_valid().
Definition at line 95 of file utf8_text.h.
References cut, j, n, and utf8_part().
Referenced by ember::ReplyStream::next().
|
inline |
Definition at line 74 of file utf8_text.h.
References j, n, out, utf8_part(), and whole.
Referenced by bpe_run(), tinyllama::TinyLlamaSession::generate(), main(), ember::ReplyStream::next(), PYBIND11_MODULE(), reply_of(), and utf8_valid_json().
Definition at line 135 of file utf8_text.h.
References a, j, utf8_valid(), and utf8_valid_json().
Referenced by dump_valid(), and utf8_valid_json().