Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
8e072ebb
Commit
8e072ebb
authored
Mar 17, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix VulkanBackend to accept original_backend parameter
parent
059999f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
vulkan.py
codai/backends/vulkan.py
+25
-2
No files found.
codai/backends/vulkan.py
View file @
8e072ebb
...
@@ -8,11 +8,20 @@ from codai.backends.base import ModelBackend
...
@@ -8,11 +8,20 @@ from codai.backends.base import ModelBackend
class
VulkanBackend
(
ModelBackend
):
class
VulkanBackend
(
ModelBackend
):
"""Backend for Vulkan GPU inference using llama.cpp."""
"""Backend for Vulkan GPU inference using llama.cpp."""
def
__init__
(
self
):
def
__init__
(
self
,
original_backend
:
str
=
None
):
self
.
model
=
None
self
.
model
=
None
self
.
model_name
=
None
self
.
model_name
=
None
self
.
device
=
None
self
.
device
=
None
self
.
n_gpu_layers
=
-
1
self
.
n_ctx
=
2048
self
.
verbose
=
True
self
.
main_gpu
=
0
self
.
chat_template
=
None
self
.
hf_tokenizer
=
None
self
.
force_cuda
=
original_backend
in
(
"nvidia"
,
"cuda"
)
if
self
.
force_cuda
:
print
(
"DEBUG: GGUF model will use CUDA backend (forced by --backend nvidia)"
)
def
load_model
(
self
,
model_name
:
str
,
**
kwargs
)
->
None
:
def
load_model
(
self
,
model_name
:
str
,
**
kwargs
)
->
None
:
"""Load the model."""
"""Load the model."""
pass
pass
...
@@ -23,6 +32,20 @@ class VulkanBackend(ModelBackend):
...
@@ -23,6 +32,20 @@ class VulkanBackend(ModelBackend):
"""Generate text non-streaming."""
"""Generate text non-streaming."""
pass
pass
def
generate_chat
(
self
,
messages
:
List
[
Dict
],
max_tokens
:
Optional
[
int
]
=
None
,
temperature
:
float
=
0.7
,
top_p
:
float
=
1.0
,
stop
:
Optional
[
List
[
str
]]
=
None
,
tools
:
Optional
[
List
]
=
None
,
response_format
:
Optional
[
Dict
]
=
None
)
->
str
:
"""Generate chat completion non-streaming."""
pass
async
def
generate_chat_stream
(
self
,
messages
:
List
[
Dict
],
max_tokens
:
Optional
[
int
]
=
None
,
temperature
:
float
=
0.7
,
top_p
:
float
=
1.0
,
stop
:
Optional
[
List
[
str
]]
=
None
,
tools
:
Optional
[
List
]
=
None
,
response_format
:
Optional
[
Dict
]
=
None
):
"""Generate chat completion streaming."""
pass
def
generate_stream
(
self
,
prompt
:
str
,
max_tokens
:
Optional
[
int
]
=
None
,
def
generate_stream
(
self
,
prompt
:
str
,
max_tokens
:
Optional
[
int
]
=
None
,
temperature
:
float
=
0.7
,
top_p
:
float
=
1.0
,
temperature
:
float
=
0.7
,
top_p
:
float
=
1.0
,
stop
:
Optional
[
list
]
=
None
):
stop
:
Optional
[
list
]
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment