Class: LLM::LlamaCpp
Overview
The LlamaCpp class implements a provider for llama.cpp through the
OpenAI-compatible API provided by the llama-server binary. Similar to
the ollama provider, this provider supports a wide range of models
and is straightforward to run on your own hardware.
Constant Summary
Constants inherited from OpenAI
OpenAI::HOST
Instance Method Summary collapse
Methods inherited from OpenAI
#assistant_role,
#complete, #embed, #models, #server_tools,
#web_search
Methods inherited from Provider
#assistant_role,
#chat, clients, #complete, #developer_role,
#embed, #inspect, #models, #persist!, #respond, #schema, #server_tool,
#server_tools,
#system_role,
#tool_role, #tracer, #tracer=, #user_role, #web_search, #with
Constructor Details
#initialize(host: "localhost", port: 8080, ssl:
false) ⇒ LLM::LlamaCpp
26
27
28
|
# File 'lib/llm/providers/llamacpp.rb', line 26
def initialize(host: "localhost", port: 8080, ssl: false, **)
super
end
|
Instance Method Details
#default_model ⇒ String
Returns the default model for chat completions
77
78
79
|
# File 'lib/llm/providers/llamacpp.rb', line 77
def default_model
"qwen3"
end
|
#name ⇒ Symbol
Returns the provider's name
33
34
35
|
# File 'lib/llm/providers/llamacpp.rb', line 33
def name
:llamacpp
end
|
39
40
41
|
# File 'lib/llm/providers/llamacpp.rb', line 39
def files
raise NotImplementedError
end
|
45
46
47
|
# File 'lib/llm/providers/llamacpp.rb', line 45
def images
raise NotImplementedError
end
|
51
52
53
|
# File 'lib/llm/providers/llamacpp.rb', line 51
def audio
raise NotImplementedError
end
|
#moderations ⇒ Object
57
58
59
|
# File 'lib/llm/providers/llamacpp.rb', line 57
def moderations
raise NotImplementedError
end
|
#responses ⇒ Object
63
64
65
|
# File 'lib/llm/providers/llamacpp.rb', line 63
def responses
raise NotImplementedError
end
|
#vector_stores ⇒ Object
69
70
71
|
# File 'lib/llm/providers/llamacpp.rb', line 69
def vector_stores
raise NotImplementedError
end
|