Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions backend/src/controllers/ollama.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const OLLAMA_BASE_URL = "http://jin.neu.edu:11434";
const OLLAMA_MODEL = "qwen3.6:27b";
// Ollama server + model come from .env, so switching needs no code change:
// OLLAMA_BASE_URL=http://shui.neu.edu:11434
// OLLAMA_MODEL=qwen3.8-careful:latest
const OLLAMA_BASE_URL = (
process.env.OLLAMA_BASE_URL || "http://shui.neu.edu:11434"
).replace(/\/+$/, "");
const OLLAMA_MODEL = process.env.OLLAMA_MODEL || "qwen3.8-careful:latest";

const proxyChat = async (req, res) => {
console.log("🟣 [Ollama] proxyChat hit — model:", OLLAMA_MODEL);
Expand Down
4 changes: 2 additions & 2 deletions src/components/User/Dashboard/DatasetOrganizer/LLMPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const llmProviders: Record<string, LLMProvider> = {
name: "Ollama (NeuroJSON Server)",
baseUrl: "",
models: [
{ id: "qwen3.6:27b", name: "Qwen 3.6 27B" },
{ id: "qwen3.8-careful:latest", name: "Qwen 3.8 Careful" },
// { id: "qwen3-coder-next:latest", name: "Qwen 3 Coder Next" },
// { id: "qwen3-coder-careful:latest", name: "Qwen 3 Coder Careful" },
// { id: "qwen3.5:9b", name: "Qwen 3.5 9B" },
Expand Down Expand Up @@ -1461,7 +1461,7 @@ const LLMPanel: React.FC<LLMPanelProps> = ({

{provider === "ollama" && (
<Typography variant="caption" color="text.secondary" sx={{ mt: -1, mb: 2, display: "block" }}>
Using qwen3.6:27b on NeuroJSON server
Using Qwen 3.8 Careful on NeuroJSON server
</Typography>
)}

Expand Down
13 changes: 10 additions & 3 deletions src/services/ollama.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export const OllamaService = {
// const temperature = getQwenTemperature(model);
const response = await fetch(`${API_URL}/ollama/bidsify`, {
method: "POST",
// Send the login cookie: /ollama/bidsify requires login, and locally the
// API (localhost:5000) is a different origin from the page.
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model,
Expand All @@ -29,19 +32,23 @@ export const OllamaService = {
const data = await response.json();

if (!response.ok) {
throw new Error(data.error || "Failed to call Ollama");
throw new Error(data.error || data.message || "Failed to call Ollama");
}

return data;
},

getTags: async (): Promise<any> => {
const response = await fetch(`${API_URL}/ollama/tags`);
const response = await fetch(`${API_URL}/ollama/tags`, {
credentials: "include",
});

const data = await response.json();

if (!response.ok) {
throw new Error(data.error || "Failed to fetch Ollama models");
throw new Error(
data.error || data.message || "Failed to fetch Ollama models"
);
}

return data;
Expand Down
Loading