Greasy Fork is available in English.

GitHub Copilot - Unhide MiniMax Models

Injects MiniMax M2.5 models into GitHub Copilot model picker

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         GitHub Copilot - Unhide MiniMax Models
// @namespace    creos
// @version      1.3
// @description  Injects MiniMax M2.5 models into GitHub Copilot model picker
// @match        https://github.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  const script = document.createElement('script');
  script.textContent = `
(function () {
  const MINIMAX_MODELS = [
    {
      "id": "minimax-m2p5-fw",
      "name": "MiniMax M2.5",
      "object": "model",
      "vendor": "Fireworks",
      "version": "minimax-m2p5-fw",
      "preview": false,
      "model_picker_enabled": true,
      "model_picker_category": "powerful",
      "is_chat_default": false,
      "is_chat_fallback": false,
      "policy": { "state": "enabled", "terms": "" },
      "supported_endpoints": ["/chat/completions"],
      "capabilities": {
        "family": "minimax-m2p5-fw",
        "object": "model_capabilities",
        "type": "chat",
        "tokenizer": "o200k_base",
        "limits": {
          "max_context_window_tokens": 196608,
          "max_output_tokens": 32000,
          "max_prompt_tokens": 164000
        },
        "supports": {
          "streaming": true,
          "tool_calls": true,
          "parallel_tool_calls": true,
          "structured_outputs": true,
          "reasoning_effort": ["low", "medium", "high"]
        }
      },
      "billing": { "is_premium": false, "multiplier": 1 }
    },
    {
      "id": "minimax-m2p5-cb",
      "name": "MiniMax M2.5 (Fast)",
      "object": "model",
      "vendor": "Cerebras",
      "version": "minimax-m2p5-cb",
      "preview": false,
      "model_picker_enabled": true,
      "model_picker_category": "powerful",
      "is_chat_default": false,
      "is_chat_fallback": false,
      "policy": { "state": "enabled", "terms": "" },
      "supported_endpoints": ["/chat/completions"],
      "capabilities": {
        "family": "minimax-m2p5-cb",
        "object": "model_capabilities",
        "type": "chat",
        "tokenizer": "o200k_base",
        "limits": {
          "max_context_window_tokens": 196608,
          "max_output_tokens": 32000,
          "max_prompt_tokens": 164000
        },
        "supports": {
          "streaming": true,
          "tool_calls": true,
          "parallel_tool_calls": true,
          "structured_outputs": true,
          "reasoning_effort": ["low", "medium", "high"]
        }
      },
      "billing": { "is_premium": false, "multiplier": 1 }
    }
  ];

  function injectOrPatch(json) {
    const list = json?.data ?? (Array.isArray(json) ? json : null);
    if (!list) return null;

    // Patch existing MiniMax entries, or inject if missing
    const existingIds = new Set(list.map(m => m.id));
    const patched = list.map(m =>
      m.id?.includes('minimax') || m.id?.includes('m2p5')
        ? { ...m, model_picker_enabled: true, preview: false }
        : m
    );

    MINIMAX_MODELS.forEach(m => {
      if (!existingIds.has(m.id)) {
        console.log('[MiniMax Unhide] Injecting:', m.name);
        patched.push(m);
      }
    });

    return Array.isArray(json) ? patched : { ...json, data: patched };
  }

  const MODELS_URL = 'api.individual.githubcopilot.com/models';

  const _fetch = window.fetch;
  window.fetch = async function (...args) {
    const url = (typeof args[0] === 'string' ? args[0] : args[0]?.url) ?? '';
    const res = await _fetch.apply(this, args);

    if (url.includes(MODELS_URL)) {
      console.log('[MiniMax Unhide] Intercepted models API');
      try {
        const json = await res.clone().json();
        const result = injectOrPatch(json);
        if (result) {
          console.log('[MiniMax Unhide] Injected MiniMax models successfully');
          return new Response(JSON.stringify(result), {
            status: res.status,
            statusText: res.statusText,
            headers: res.headers,
          });
        }
      } catch (e) {
        console.error('[MiniMax Unhide] Error:', e);
      }
    }
    return res;
  };

  console.log('[MiniMax Unhide] v1.3 ready — watching for models API call');
})();
  `;

  (document.head || document.documentElement).appendChild(script);
  script.remove();
})();