Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
231cc878
Unverified
Commit
231cc878
authored
Nov 17, 2025
by
Eva H
Committed by
GitHub
Nov 17, 2025
Browse files
app/ui: fix to point ollama client to ui backend in dev mode (#13079)
parent
aa676b31
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
app/ui/app/src/api.ts
app/ui/app/src/api.ts
+1
-2
app/ui/app/src/lib/config.ts
app/ui/app/src/lib/config.ts
+10
-0
app/ui/app/src/lib/ollama-client.ts
app/ui/app/src/lib/ollama-client.ts
+2
-1
No files found.
app/ui/app/src/api.ts
View file @
231cc878
...
@@ -15,6 +15,7 @@ import {
...
@@ -15,6 +15,7 @@ import {
import
{
parseJsonlFromResponse
}
from
"
./util/jsonl-parsing
"
;
import
{
parseJsonlFromResponse
}
from
"
./util/jsonl-parsing
"
;
import
{
ollamaClient
as
ollama
}
from
"
./lib/ollama-client
"
;
import
{
ollamaClient
as
ollama
}
from
"
./lib/ollama-client
"
;
import
type
{
ModelResponse
}
from
"
ollama/browser
"
;
import
type
{
ModelResponse
}
from
"
ollama/browser
"
;
import
{
API_BASE
}
from
"
./lib/config
"
;
// Extend Model class with utility methods
// Extend Model class with utility methods
declare
module
"
@/gotypes
"
{
declare
module
"
@/gotypes
"
{
...
@@ -27,8 +28,6 @@ Model.prototype.isCloud = function (): boolean {
...
@@ -27,8 +28,6 @@ Model.prototype.isCloud = function (): boolean {
return
this
.
model
.
endsWith
(
"
cloud
"
);
return
this
.
model
.
endsWith
(
"
cloud
"
);
};
};
const
API_BASE
=
import
.
meta
.
env
.
DEV
?
"
http://127.0.0.1:3001
"
:
""
;
// Helper function to convert Uint8Array to base64
// Helper function to convert Uint8Array to base64
function
uint8ArrayToBase64
(
uint8Array
:
Uint8Array
):
string
{
function
uint8ArrayToBase64
(
uint8Array
:
Uint8Array
):
string
{
const
chunkSize
=
0x8000
;
// 32KB chunks to avoid stack overflow
const
chunkSize
=
0x8000
;
// 32KB chunks to avoid stack overflow
...
...
app/ui/app/src/lib/config.ts
0 → 100644
View file @
231cc878
// API configuration
const
DEV_API_URL
=
"
http://127.0.0.1:3001
"
;
// Base URL for fetch API calls (can be relative in production)
export
const
API_BASE
=
import
.
meta
.
env
.
DEV
?
DEV_API_URL
:
""
;
// Full host URL for Ollama client (needs full origin in production)
export
const
OLLAMA_HOST
=
import
.
meta
.
env
.
DEV
?
DEV_API_URL
:
window
.
location
.
origin
;
app/ui/app/src/lib/ollama-client.ts
View file @
231cc878
import
{
Ollama
}
from
"
ollama/browser
"
;
import
{
Ollama
}
from
"
ollama/browser
"
;
import
{
OLLAMA_HOST
}
from
"
./config
"
;
let
_ollamaClient
:
Ollama
|
null
=
null
;
let
_ollamaClient
:
Ollama
|
null
=
null
;
...
@@ -6,7 +7,7 @@ export const ollamaClient = new Proxy({} as Ollama, {
...
@@ -6,7 +7,7 @@ export const ollamaClient = new Proxy({} as Ollama, {
get
(
_target
,
prop
)
{
get
(
_target
,
prop
)
{
if
(
!
_ollamaClient
)
{
if
(
!
_ollamaClient
)
{
_ollamaClient
=
new
Ollama
({
_ollamaClient
=
new
Ollama
({
host
:
window
.
location
.
origin
,
host
:
OLLAMA_HOST
,
});
});
}
}
const
value
=
_ollamaClient
[
prop
as
keyof
Ollama
];
const
value
=
_ollamaClient
[
prop
as
keyof
Ollama
];
...
...
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