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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use a small Node.js base image
FROM node:20-alpine
FROM node:24-alpine

# Add OCI labels for better container management
LABEL org.opencontainers.image.title="Lynkr" \
Expand Down
36 changes: 21 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@azure/openai": "^2.0.0",
"better-sqlite3": "^9.4.0",
"better-sqlite3": "^12.6.2",
"compression": "^1.7.4",
"diff": "^5.2.0",
"dotenv": "^16.4.5",
Expand Down
16 changes: 13 additions & 3 deletions src/clients/databricks.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ async function invokeOllama(body) {
throw new Error("Ollama endpoint is not configured.");
}

const { convertAnthropicToolsToOllama } = require("./ollama-utils");
const { convertAnthropicToolsToOllama, checkOllamaToolSupport } = require("./ollama-utils");

const endpoint = `${config.ollama.endpoint}/api/chat`;
const headers = { "Content-Type": "application/json" };
Expand Down Expand Up @@ -325,8 +325,18 @@ async function invokeOllama(body) {
logger.info({}, "Tool injection disabled for Ollama (INJECT_TOOLS_OLLAMA=false)");
}

// Add tools if present (for tool-capable models)
if (Array.isArray(toolsToSend) && toolsToSend.length > 0) {
// Check if model supports tools
const supportsTools = await checkOllamaToolSupport(config.ollama.model);

if (!supportsTools) {
logger.warn({
model: config.ollama.model,
toolCount: toolsToSend?.length || 0
}, "Model does not support tool calling - stripping tools from request");
}

// Add tools if present AND model supports them
if (supportsTools && Array.isArray(toolsToSend) && toolsToSend.length > 0) {
ollamaBody.tools = convertAnthropicToolsToOllama(toolsToSend);
logger.info({
toolCount: toolsToSend.length,
Expand Down
Loading
Loading