omp packages

pi-refuseless0.1.2

Refuseless provider for the Pi coding agent: uncensored DeepSeek, GLM, Kimi and MiniMax models with a live model catalog.

GitHub Actions Published 1 day ago MIT ~585 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-refuseless

Refuseless provider for the Pi coding agent: DeepSeek V4.1, GLM 5.3, Kimi K3.1 and MiniMax M3.1, including abliterated variants, over an OpenAI-compatible API.

Startup never waits on the network: a catalog snapshot ships with the package, so /model is populated immediately and offline. Pi refreshes providers in the background afterwards, swapping in GET /v1/models and persisting it for the next start, so new models and price changes still show up without a package update.

Install

pi install npm:pi-refuseless

or straight from source:

pi install git:github.com/kylinholmes/pi-refuseless

Then set a key, either way works:

export REFUSELESS_API_KEY=abl_...

or store it once and let Pi keep it:

pi auth login refuseless --api-key   # reads the key without echoing; or /login refuseless inside Pi

Restart Pi or run /reload, then pick a model with /model.

For agents

The install, authentication, verification, and repair procedure lives in a skill that ships with this package:

skills/refuseless-setup/SKILL.md

Installing the package makes it available to Pi automatically, by name: /skill:refuseless-setup. It covers both routes (this package, or a hand-written models.json), the three checks that decide whether the setup actually works, and the gateway's own error text as a lookup table — the 400 messages about reasoning_effort and max_tokens name their own fix.

Skip the extension and the skill still applies: the models.json section below is the same configuration, written out.

Models

The gateway currently serves DeepSeek V4.1 Flash (plain and abliterated), GLM 5.3 and GLM 5.3 Flash (abliterated), Kimi K3.1 Pro (plain and abliterated), and MiniMax M3.1 Flash. All are 1M context and vision-capable except GLM 5.3 Abliterated, which is text only. See the gateway's own /v1/models for the live list, or run pi --list-models after installing.

What the provider reports

Per model, taken from upstream metadata:

Upstream field Pi model field
vision input: ["text", "image"] or ["text"]
pricing.* cost (discounted price wins over regular)
context_length contextWindow
reasoning_efforts reasoning + thinkingLevelMap

Names are derived from model ids. maxTokens is not published upstream, so it comes from the vendor's own models.json reference per id, and an id the shipped catalog does not know falls back to 65536.

Effort levels differ per model: DeepSeek accepts off, the others start at low. The gateway rejects minimal, medium, and xhigh with a 400, so the catalog maps all three to null and never sends them. A level mapped to null is not offered by /thinking at all, and a saved level a model does not offer clamps upward to the next one it does (medium to high, xhigh to max).

Without the extension: models.json

Pi can reach Refuseless without this package. Add it to ~/.pi/agent/models.json and /model reloads the file. This is also the way to point Pi at any other OpenAI-compatible endpoint at the same time: every key under providers is independent, and $NAME / ${NAME} in apiKey or headers is read from the environment, a leading !command is executed.

{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "refuseless": {
      "name": "Refuseless",
      "baseUrl": "https://api.refuseless.com/v1",
      "api": "openai-completions",
      "apiKey": "$REFUSELESS_API_KEY",
      "models": [
        {
          "id": "deepseek-v4.1-flash-fast",
          "name": "DeepSeek V4.1 Flash 1017",
          "reasoning": true,
          "input": ["text", "image"],
          "cost": { "input": 0.01, "output": 0.08, "cacheRead": 0.002, "cacheWrite": 0 },
          "contextWindow": 1048576,
          "maxTokens": 262144,
          "thinkingLevelMap": { "off": "off", "minimal": null, "low": "low", "medium": null, "high": "high", "max": "max" }
        },
        {
          "id": "glm-5.3-abliterated",
          "name": "GLM 5.3 Abliterated",
          "reasoning": true,
          "input": ["text"],
          "cost": { "input": 1, "output": 2, "cacheRead": 0.15, "cacheWrite": 0 },
          "contextWindow": 1048576,
          "maxTokens": 131072,
          "thinkingLevelMap": { "off": null, "minimal": null, "low": "low", "medium": null, "high": "high", "max": "max" }
        }
      ]
    }
  }
}

The shape above is the minimum that behaves correctly; the omissions that bite are quiet:

  • input defaults to ["text"], so a vision model silently loses images. Set it per model.
  • cost is all-zero unless given, and then /usage reports nothing. Values are USD per million tokens.
  • medium must be null (DeepSeek: also minimal, xhigh): the gateway answers 400 reasoning_effort must be one of off, low, high, or max. off: null on models that cannot disable reasoning, which answer 400 This model does not allow reasoning off. Pi then hides the level instead of sending it.
  • maxTokens is not in GET /v1/models; the values here are the vendor's published per-model limits, and an unknown model falls back to 65536. The gateway rejects the field above 1,000,000, and since maxTokens shares the window with the prompt, a very large value fails once the prompt grows.
  • compat is not needed: max_completion_tokens, store: false, stream_options, and prompt_cache_key are all accepted. Add "compat": { "maxTokensField": "max_tokens", "supportsStore": false } only if the gateway starts rejecting them.

The trade-off versus installing the package: this file is static. It does not refresh from /v1/models, so new models and price changes have to be edited in by hand, and none of the upstream metadata mapping above happens for you. baseUrl alone is enough to route an existing provider through the gateway; providers.<id>.models is what adds models Pi does not already know.

Balance

The provider does not ship a balance display. pi-usage-balances covers it with a declarative query:

{
  "version": 1,
  "accounts": [
    {
      "id": "refuseless",
      "provider": "refuseless",
      "request": {
        "url": "https://api.refuseless.com/v1/credits",
        "method": "GET",
        "usePiAuth": true,
        "headers": { "Authorization": "Bearer ${token}" }
      },
      "response": {
        "metrics": [
          {
            "kind": "balance",
            "label": "balance",
            "remaining": { "path": "available" },
            "unit": { "value": "USD" }
          }
        ]
      }
    }
  ]
}

Put that in ~/.pi/agent/pi-usage.json, then /usage on.

Caveats

  • Refuseless is a third-party gateway, not a first-party API vendor. It is not part of Pi's built-in catalog, and Pi's own /models page remains the authoritative list of supported providers.
  • A network failure never empties /model: the bundled snapshot, or the last persisted catalog, stays in use. A refresh is skipped for four hours after a successful check unless it is forced.
  • Model ids, prices and the /v1/models shape are the gateway's own; this package makes no promises about them.
  • Abliterated models have no upstream price guarantee and can regress after a model update.

Development

npm install --ignore-scripts
npm run typecheck    # tsc --noEmit, strict
npm run lint         # oxlint

pi -e .              # load the package from source for one run
pi --list-models -e .

index.ts holds the whole package. There is no build step: Pi loads TypeScript directly, so the published tarball ships source.

License

MIT