How to use mmproj

#8
by curiouspp8 - opened

Is my understanding correct that if we pass mmproj into ik_llama model should be able to take images as an input? Perhaps opencode issue - tried that, then dropped an image there and ask what is this about and it said - can't read images. Any tips on that?

  1. Grab the mmproj from here (i suggest the bf16 as it is the "original" weights): https://huggingface.co/AesSedai/Kimi-K2.5-GGUF/tree/main
  2. If you use -mmproj for right now I believe it will disable any --spec-type ... stuff
  3. I'm not 100% sure, but you may want to set max-image-tokens to a value lower than the -ub
  4. you can save VRAM by not offloading it with --no-mmproj-offload so it will run on CPU/RAM psure

Here is an example of what to add to your llama-server command assuming you're using -ub 4096 -b 4096

    --mmproj "$mmproj" \
    --image-min-tokens 1024 \
    --image-max-tokens 4096 \
   --no-mmproj-offload \

For opencode you have to configure it in your opencode.json to accept the inputs here is a snippet with the modalities shown:

    "cpu": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "cpu",
      "options": {
        "baseURL": "http://localhost:8088/v1",
        "timeout": 99999999999
      },
      "models": {
        "Kimi-K2.6": {
          "name": "Kimi-K2.6",
          "limit": {
            "context": 196608,
            "output": 131072
          },
          "cost": {
            "input": 5,
            "output": 25
          },
          "temperature": true,
          "reasoning": true,
          "tool_call": true,
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        }
      }
    }

Beyond that, point your opencode at a git clone'd repo of ik_llama.cpp and ask it for more details then let me know how it works! haha

cheers and hope this gets you going!

Sign up or log in to comment