npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-ollama-toolcall-proxy

v0.2.8

Published

OpenCode plugin that converts raw tool-call markup from local Ollama models into standard OpenAI tool_calls, plus line-ending normalization for file edits.

Readme

OpenCode Ollama Tool-Call Proxy Plugin

An OpenCode plugin that does two things:

  1. Tool-call conversion: intercepts chat-completion responses from a local Ollama server and rewrites raw tool-call markup into standard OpenAI tool_calls chunks. This lets models that do not expose native Ollama tool support still work as agentic coding models inside OpenCode.
  2. Line-ending normalization: normalizes LF/CRLF line endings on write, edit, and multiedit tool arguments, and on files after edits, using .editorconfig or the OPENCODE_LINE_ENDINGS environment variable. Platform default: CRLF on Windows, LF on Linux/macOS.

Supported model families

| Family | Example Ollama tags | Raw markup handled | |--------|---------------------|--------------------| | Qwen 2.5 / Qwen 2.5-Coder | qwen2.5-coder, qwen2.5 | <tools>, <tool_call>, raw JSON object/array | | Qwen 3.5 / Qwen 3-Coder | qwen3.5, qwen3-coder | <tool_call>{...}</tool_call> and <function=...><parameter=...> XML | | Ornith 1.0 | ornith-9b, ornith-35b | same as Qwen 3.5 (routed to Qwen converter) | | Gemma 4 | gemma4 | <|tool_call>call:name{...}<tool_call|>, <start_function_call>...<end_function_call> | | Mistral / Ministral | mistral, mistral-nemo, ministral, ministral-3 | [TOOL_CALLS] JSON array and <name>[ARGS]{...} | | Llama 3.x / OpenCoder | llama3.1, llama3.2, llama3.3, opencoder | raw JSON object/array, <|python_tag>...<|eom_id|> | | Phi-4 / Phi-4 Tools | phi4-mini, phi4-tools | {"name":..., "parameters":...}, functools[...] | | DeepSeek R1 / V3 | deepseek-r1, deepseek-v3 | <|tool▁call▁begin|> tags, fenced JSON, raw JSON, strips <think> | | Yi-Coder | yi-coder | raw JSON / JSON array, code fences | | GLM-4 / ChatGLM | glm4, chatglm3 | [TOOL_REQUEST] {...} [END_TOOL_REQUEST], legacy <tool_call> XML | | Laguna XS 2.1 | laguna-xs-2.1 | [tool=name<Prop ... />], [tool=name<arg_key>k</arg_key><arg_value>v</arg_value>] |

Installation

From npm (recommended)

npm install -g opencode-ollama-toolcall-proxy

Then add the package name to your OpenCode config:

{
  "plugin": ["opencode-ollama-toolcall-proxy"]
}

Restart OpenCode. The plugin is loaded automatically.

From a local checkout

git clone https://github.com/YOUR_USER/opencode-ollama-toolcall-proxy.git
npm install
npm run build

Reference the built entry point with an absolute file:// URL:

{
  "plugin": ["file:///C:/absolute/path/to/opencode-ollama-toolcall-proxy/dist/index.js"]
}

Usage

  1. Make sure Ollama is running.
  2. Configure your model in ~/.config/opencode/opencode.json with "tools": true:
{
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "options": { "baseURL": "http://localhost:11434/v1" },
      "models": {
        "qwen2.5-coder:14b": {
          "name": "Qwen2.5 Coder 14B",
          "tools": true,
          "thinking": false
        }
      }
    }
  }
}
  1. Start OpenCode. When the model emits raw tool-call text, the plugin converts it to proper tool_calls before the AI SDK sees the response.

Line-ending configuration

The plugin normalizes line endings on file writes/edits in this priority order:

  1. OPENCODE_LINE_ENDINGS environment variable (lf or crlf)
  2. .editorconfig end_of_line setting (walks up the directory tree)
  3. Platform default: crlf on Windows, lf on Linux/macOS

Example .editorconfig:

root = true

[*]
end_of_line = crlf

[*.sh]
end_of_line = lf

Development

# type check
npm run typecheck

# run tests
npm test

# build a single ESM bundle for publishing
npm run build

Publishing

  1. Pick a unique npm package name and update name in package.json.
  2. Log in to npm: npm login.
  3. Publish: npm publish.

The prepublishOnly script automatically builds dist/index.js before the package is uploaded.

License

MIT