Packages
llama_cpp_ex
0.3.0
0.8.36
0.8.35
0.8.34
0.8.33
0.8.32
0.8.31
0.8.28
0.8.27
0.8.26
0.8.25
0.8.24
0.8.23
0.8.22
0.8.21
0.8.20
0.8.19
0.8.18
0.8.17
0.8.16
0.8.15
0.8.14
0.8.13
0.8.12
0.8.11
0.8.10
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.0
0.6.14
0.6.13
0.6.12
0.6.11
0.6.10
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.1
0.6.0
0.5.0
0.4.4
0.4.3
0.4.2
0.4.1
0.3.0
0.2.0
Elixir bindings for llama.cpp — run LLMs locally with Metal, CUDA, Vulkan, or CPU acceleration.
Current section
Files
Jump to
Current section
Files
llama_cpp_ex
mix.exs
mix.exs
defmodule LlamaCppEx.MixProject do
use Mix.Project
@version "0.3.0"
@source_url "https://github.com/nyo16/llama_cpp_ex"
def project do
[
app: :llama_cpp_ex,
version: @version,
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),
compilers: [:elixir_make] ++ Mix.compilers(),
make_env: &make_env/0,
make_clean: ["clean"],
description: description(),
package: package(),
name: "LlamaCppEx",
source_url: @source_url,
homepage_url: @source_url,
docs: docs()
]
end
def application do
[extra_applications: [:logger]]
end
defp deps do
[
{:elixir_make, "~> 0.8", runtime: false},
{:fine, "~> 0.1", runtime: false},
{:telemetry, "~> 1.0"},
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
{:benchee, "~> 1.0", only: :bench, runtime: false}
]
end
defp description do
"Elixir bindings for llama.cpp — run LLMs locally with Metal, CUDA, Vulkan, or CPU acceleration."
end
defp package do
[
name: "llama_cpp_ex",
licenses: ["Apache-2.0"],
links: %{
"GitHub" => @source_url,
"llama.cpp" => "https://github.com/ggml-org/llama.cpp"
},
files: ~w(
lib c_src Makefile mix.exs README.md CHANGELOG.md LICENSE .formatter.exs
)
]
end
defp docs do
[
main: "readme",
extras: [
"README.md",
"CHANGELOG.md",
"LICENSE",
"docs/architecture.md",
"docs/cross-platform-builds.md",
"docs/adr/001-cpp-nif-over-rustler.md",
"docs/adr/002-fine-for-nif-ergonomics.md",
"docs/adr/003-static-linking.md",
"docs/adr/004-streaming-via-enif-send.md",
"docs/adr/005-batching-architecture.md",
"docs/adr/006-continuous-batching.md"
],
groups_for_extras: [
"Architecture Decision Records": ~r/docs\/adr\/.*/
],
groups_for_modules: [
"High-Level API": [LlamaCppEx],
"Core Modules": [
LlamaCppEx.Model,
LlamaCppEx.Context,
LlamaCppEx.Sampler,
LlamaCppEx.Tokenizer,
LlamaCppEx.Chat,
LlamaCppEx.Embedding,
LlamaCppEx.Server
],
Internal: [LlamaCppEx.NIF]
]
]
end
defp make_env do
env = %{"FINE_INCLUDE_DIR" => Fine.include_dir()}
env =
case System.get_env("LLAMA_BACKEND") do
nil -> env
backend -> Map.put(env, "LLAMA_BACKEND", backend)
end
case System.get_env("LLAMA_CMAKE_ARGS") do
nil -> env
args -> Map.put(env, "LLAMA_CMAKE_ARGS", args)
end
end
end