Instructions to use Felipe97/llama-cpp-compiled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Felipe97/llama-cpp-compiled with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: llama cli -hf Felipe97/llama-cpp-compiled
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: llama cli -hf Felipe97/llama-cpp-compiled
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Felipe97/llama-cpp-compiled # Run inference directly in the terminal: ./build/bin/llama cli -hf Felipe97/llama-cpp-compiled
Use Docker
docker model run hf.co/Felipe97/llama-cpp-compiled
- Llama new
- LM Studio
- Jan
- Ollama
How to use Felipe97/llama-cpp-compiled with Ollama:
ollama run hf.co/Felipe97/llama-cpp-compiled
- Unsloth Desktop
- Docker Model Runner
How to use Felipe97/llama-cpp-compiled with Docker Model Runner:
docker model run hf.co/Felipe97/llama-cpp-compiled
- Lemonade
How to use Felipe97/llama-cpp-compiled with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Felipe97/llama-cpp-compiled
Run and chat with the model
lemonade run user.llama-cpp-compiled-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Download common/parsers/functionary-v3-2.cpp from Felipe97/llama-cpp-compiled: direct link, hf CLI and curl.
- Browser
- Download file 4.33 kB
-
https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/common/parsers/functionary-v3-2.cpp
- Command line
-
hf download hf://Felipe97/llama-cpp-compiled/common/parsers/functionary-v3-2.cpp
-
curl -L -o functionary-v3-2.cpp https://huggingface.co/Felipe97/llama-cpp-compiled/resolve/main/common/parsers/functionary-v3-2.cpp
4.33 kB
| // Functionary v3.2 - uses recipient-based format: >>>recipient\n{content} | |
| common_chat_params common_chat_params_init_functionary_v3_2(const common_chat_template & tmpl, | |
| const autoparser::generation_params & inputs) { | |
| common_chat_params data; | |
| data.prompt = common_chat_template_direct_apply_impl(tmpl, inputs); | |
| data.generation_prompt = common_chat_template_generation_prompt_impl(tmpl, inputs); | |
| data.format = COMMON_CHAT_FORMAT_PEG_NATIVE; | |
| data.preserved_tokens = { | |
| ">>>all", | |
| }; | |
| auto has_tools = inputs.tools.is_array() && !inputs.tools.empty(); | |
| auto include_grammar = has_tools && inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_NONE; | |
| if (inputs.has_continuation()) { | |
| const auto & msg = inputs.continue_msg; | |
| data.generation_prompt = "<|start_header_id|>assistant<|end_header_id|>\n\n>>>all\n" + msg.render_content(); | |
| data.prompt += data.generation_prompt; | |
| } | |
| auto parser = build_chat_peg_parser([&](common_chat_peg_builder & p) { | |
| // Functionary v3.2 format: | |
| // - Normal content: >>>all\n{content} | |
| // - Tool calls: >>>function_name\n{json_args} | |
| // Generation prompt ends with ">>>" so model outputs recipient immediately | |
| // Build content parser for >>>all\n{content} | |
| // When tools are present, content stops before the next ">>>" (tool call) | |
| // When no tools, content goes until end | |
| auto content_until_tool = p.literal("all\n") + p.content(p.until(">>>")); | |
| auto content_until_end = p.literal("all\n") + p.content(p.rest()); | |
| auto generation_prompt = p.literal("<|start_header_id|>assistant<|end_header_id|>\n\n>>>"); | |
| // If no tools or tool_choice is NONE, just parse content | |
| if (!has_tools || inputs.tool_choice == COMMON_CHAT_TOOL_CHOICE_NONE) { | |
| // When no tools, just match the prefix and capture everything after | |
| return generation_prompt + content_until_end + p.end(); | |
| } | |
| // Build tool call parsers for each available function | |
| auto tool_choice = p.choice(); | |
| foreach_function(inputs.tools, [&](const json & tool) { | |
| const auto & function = tool.at("function"); | |
| std::string name = function.at("name"); | |
| const auto schema = common_chat_tool_parameters(function); | |
| // Tool format: >>>function_name\n{json_args} | |
| auto tool_parser = p.tool( | |
| p.tool_open(p.tool_name(p.literal(name)) + p.literal("\n")) + | |
| p.tool_args(p.schema(p.json(), "tool-" + name + "-schema", schema)) | |
| ); | |
| tool_choice |= p.rule("tool-" + name, tool_parser); | |
| }); | |
| auto content_only = content_until_end; | |
| auto tools_only = p.trigger_rule("tools", p.one_or_more(tool_choice)); | |
| auto content_and_tools = content_until_tool + tools_only; | |
| auto ret = p.eps(); | |
| if (inputs.tool_choice == COMMON_CHAT_TOOL_CHOICE_REQUIRED) { | |
| if (inputs.parallel_tool_calls) { | |
| ret = p.choice({ content_and_tools, tools_only }) + p.end(); | |
| } else { | |
| ret = p.choice({ content_until_tool + tool_choice, tools_only }) + p.end(); | |
| } | |
| } else if (inputs.parallel_tool_calls) { | |
| ret = p.choice({ content_and_tools, content_only, tools_only }) + p.end(); | |
| } else { | |
| auto content_and_tool = content_until_tool + tool_choice; | |
| ret = p.choice({ content_and_tool, content_only, tool_choice }) + p.end(); | |
| } | |
| return generation_prompt + ret; | |
| }); | |
| data.parser = parser.save(); | |
| if (include_grammar) { | |
| data.grammar_lazy = inputs.tool_choice == COMMON_CHAT_TOOL_CHOICE_AUTO; | |
| data.grammar = build_grammar([&](const common_grammar_builder & builder) { | |
| parser.build_grammar(builder, data.grammar_lazy); | |
| }); | |
| // Grammar trigger for when the model starts outputting a tool call | |
| // (after the initial ">>>" in the generation prompt but recipient other than "all") | |
| data.grammar_triggers = { | |
| { COMMON_GRAMMAR_TRIGGER_TYPE_PATTERN, ">>>(?!all)" } | |
| }; | |
| } | |
| return data; | |
| } | |