Category: Technical Notes

  • opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "autoupdate": true,
      "server": {
        "port": 4096
      },
      "provider": {
        "llama-server": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "LLama Server (Local)",
          "options": {
            "baseURL": "http://192.168.1.100:11235/v1",
            "timeout": false,
            "chunkTimeout": 28800000
          },
          "models": {
            "Jackrong/Qwen3.5-4B-Neo-GGUF:Q5_K_M": {
              "name": "Qwen 3.5 Coder Neo (4B Q5)",
              "options": {
                "presence-penalty": 0,
                "repeat-penalty": 1,
                "temp": 0.6,
                "top-k": 20,
                "top-p": 0.95,
                "min-p": 0
              }
            },
            "Jackrong/Qwen3.5-9B-Neo-GGUF:Q5_K_M": {
              "name": "Qwen 3.5 Coder Neo (9B Q5)",
              "options": {
                "presence-penalty": 0.2,
                "repeat-penalty": 1.2,
                "temp": 0.7,
                "top-k": 20,
                "top-p": 0.95,
                "min-p": 0.1
              }
            },
            "Jackrong/Qwopus3.5-4B-v3-GGUF:Q8_0": {
              "name": "Qwopus3.5 v3 (4B Q8)",
              "options": {
                "presence-penalty": 0.2,
                "repeat-penalty": 1.1,
                "temp": 0.7,
                "top-k": 20,
                "top-p": 0.95,
                "min-p": 0.05
              }
            },
            "Jackrong/Qwopus3.5-9B-v3-GGUF:Q5_K_S": {
              "name": "Qwopus3.5 v3 (9B Q5)",
              "options": {
                "presence-penalty": 0,
                "repeat-penalty": 1,
                "temp": 0.6,
                "top-k": 20,
                "top-p": 0.95,
                "min-p": 0
              }
            },
            "Jackrong/Gemopus-4-E4B-it-GGUF:Q8_0": {
              "name": "Gemma 4 (4B Q8)",
              "options": {
                "presence-penalty": 0,
                "repeat-penalty": 1,
                "temp": 0.6,
                "top-k": 20,
                "top-p": 0.95,
                "min-p": 0
              }
            }
          }
        }
      }
    }
    
  • AI Model from Hugging Face to Ollama

    Modelfile Setup Guide

    To import a model from Hugging Face into Ollama for coding, do the following.

    1. Download the model

    $ ollama pull hf.co/Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q8_0
    

    2. Find the correct blob

    Hint: It’s the big one.

    $ ollama show --modelfile hf.co/Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q8_0 \
      | awk '/^FROM/ {print $2}' \
      | xargs -r du -h
    

    3. Create a new Modelfile

    Set the context length to at least 16k or 32k, and add the TEMPLATE to enable tool calling.

    Sources:
    The TEMPLATE is from a GitHub comment.
    The additional Coding parameters for Qwen 3.5 are from hf.co. Parameters for additional uses are also available.

    # Modelfile generated by "ollama show"
    # To build a new Modelfile based on this, replace FROM with:
    # FROM hf.co/Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q8_0
    
    FROM /usr/share/ollama/.ollama/models/blobs/sha256-01ab75e862bf61c2fd20babc55d396181580722b7af76ec4ebfb83224218c723
    
    PARAMETER num_ctx 32768
    PARAMETER temperature 0.6
    PARAMETER top_p 0.95
    PARAMETER top_k 20
    PARAMETER min_p 0.0
    PARAMETER presence_penalty 0.0
    PARAMETER repeat_penalty 1.0
    
    TEMPLATE """{{- if .Suffix }}<|fim_prefix|>{{ .Prompt }}<|fim_suffix|>{{ .Suffix }}<|fim_middle|>
    {{- else -}}
    {{- $lastUserIdx := -1 -}}
    {{- range $idx, $msg := .Messages -}}
    {{- if eq $msg.Role "user" }}{{ $lastUserIdx = $idx }}{{ end -}}
    {{- end }}
    {{- if or .System .Tools }}<|im_start|>system
    {{ if .System }}
    {{ .System }}
    {{- end }}
    {{- if .Tools }}
    
    # Tools
    
    You may call one or more functions to assist with the user query.
    
    You are provided with function signatures within <tools></tools> XML tags:
    <tools>
    {{- range .Tools }}
    {"type": "function", "function": {{ .Function }}}
    {{- end }}
    </tools>
    
    For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
    <tool_call>
    {"name": <function-name>, "arguments": <args-json-object>}
    </tool_call>
    {{- end -}}
    <|im_end|>
    {{ end }}
    {{- range $i, $_ := .Messages }}
    {{- $last := eq (len (slice $.Messages $i)) 1 -}}
    {{- if eq .Role "user" }}<|im_start|>user
    {{ .Content }}
    {{ else if eq .Role "assistant" }}<|im_start|>assistant
    {{- if .Content }}
    {{ .Content }}
    {{- else if .ToolCalls }}
    {{- range .ToolCalls }}
    <tool_call>
    {"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
    </tool_call>
    {{- end }}
    {{- end }}{{ if not $last }}<|im_end|>
    {{ end }}
    {{- else if eq .Role "tool" }}<|im_start|>user
    <tool_response>
    {{ .Content }}
    </tool_response><|im_end|>
    {{ end }}
    {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
    {{ end }}
    {{- end }}
    {{- end }}
    """
    

    4. Create a new model from the Modelfile

    $ ollama create Qwen3.5-Coder-Distilled