@shitpost.work/omp-shitpost-provider (0.1.1)

Published 2026-10-06 18:25:08 -05:00 by harutohiroki in shitpost.work/omp-shitpost-provider

Installation

@shitpost.work:registry=
npm config set @shitpost.work:registry=
npm install @shitpost.work/[email protected]
"@shitpost.work/omp-shitpost-provider": "0.1.1"

About this package

shitpost.work provider for Oh My Pi

Registers the shitpost.work provider in Oh My Pi (omp) and auto-discovers its models from their /v1/models endpoint.

Why

I (harutohiroki) believe that it is simply idiotic that every consumer harness has to keep their own list of providers and their models with capabilities. If you have ever tried picking a random model in the list only to be hit with the vein bursting annoying "stub not available", you know what I mean.

This extension works on the principle of auto discovery on the provider's endpoint, fetching and mapping available stubs into the harness' model list, no unavailable model error anymore.

The API standard is documented in /llama-router, which also matches shitpost.work /models endpoint.

Features

  • Registers the shitpost.work provider in omp - baseUrl from your config, openai-completions API, API key or OAuth login
  • Auto-discovers models from the endpoint's /v1/models
  • Reads context limits from context_length, max_model_len, meta.n_ctx (defaults to 128000)
  • Reads output limits from max_completion_tokens, top_provider.max_completion_tokens, max_output_tokens (falls back to min(context/4, 32000))
  • Maps llama-router's API addon report: reasoning effort levels, the advertised default effort, a thinking-off variant, supported_parameters, and full pricing
  • Maps architecture.input_modalities and architecture.tokenizer
  • API key via SHITPOST_WORK_API_KEY / LLM_API_KEY env vars or /login shitpost.work
  • /shitpost-refresh command to re-fetch the model list mid-session
  • Retries discovery on session_start if nothing was cached at load

Installation

OMP

omp plugin install @shitpost.work/omp-shitpost-provider

Pi

pi install npm:@shitpost.work/omp-shitpost-provider

Both commands use the Forgejo npm registry. Configure it first if needed:

npm config set @shitpost.work:registry https://git.shitpost.work/api/packages/shitpost.work/npm/

Configuration

The extension reads ~/.omp/agent/models.yml (or models.json) for the provider's baseUrl:

providers:
  shitpost.work:
    baseUrl: http://localhost:11434

No baseUrl -> warning, no provider.

API key, in priority order:

  1. SHITPOST_WORK_API_KEY env var
  2. LLM_API_KEY env var
  3. ~/.omp/agent/auth.json - shitpost.work (or shitpost-work) as a string or { "key": ... } / { "access": ... }

If no key is configured, the provider is registered with OAuth only. /login shitpost.work prompts for the key and stores it in auth.json - 10-year expiry, extended on refresh.

llama-router API addon

llama-router rewrites its /v1/models report through an API addon (src/api_addon.py). This extension maps that report onto omp's model config:

  • reasoning_effort.levels -> thinking.efforts (mode effort), none filtered out
  • reasoning_effort.default -> thinking.defaultLevel, so "no variant" matches the router's advertised default (only used if it's in levels)
  • reasoning_effort.disable -> compat.reasoningDisableMode: none -> none-effort (sends reasoning_effort: "none"), lowest -> lowest-effort, qwen -> qwen-enable-thinking-false (sends chat_template_kwargs: { "enable_thinking": false })
  • supported_parameters -> supportsTools from the presence of tools (defaults to true when the field is absent)
  • pricing -> cost, including cache_read and cache_write (missing -> 0)
  • architecture.input_modalities / modalities -> input modalities (text, or text + image)
  • architecture.tokenizer -> tokenizer
  • context_length / max_output_tokens -> contextWindow / maxTokens (with the fallbacks above)

Models with a reasoning surface also get reasoning: true so omp advertises the capability.

Model name beautification

naming.json holds the knowledge:

  • knownPrefixes: wordslop -> WordSlop, thinkingcap -> ThinkingCap
  • knownModels: glm -> GLM, minimax -> MiniMax
  • knownTags: uncensored, flash, single, instruct, code, moe -> Uncensored, Flash, Single, Instruct, Code, MoE
  • Consecutive numeric segments join into a dotted version: llama-3-1-8b -> Llama 3.1 8B
  • Size suffixes uppercase: 27b -> 27B, 32k -> 32K
  • a3b-style suffixes: a3b -> A3B
  • Letter+digits followed by a numeric segment joins with a dot: kimi-k2-0905-preview -> Kimi K2.0905 Preview
  • Unknown parts get capitalized

Add your own to naming.json; the extension reads it at load.

License

MIT, credit HarutoHiroki if you implement the code in your codebase, would be appreciated.

Dependencies

Development dependencies

ID Version
@oh-my-pi/pi-coding-agent 18.1.19
@types/node ^20.0.0
typescript ^5.0.0

Peer dependencies

ID Version
@oh-my-pi/pi-coding-agent >=16.5.2
Details
npm
2026-10-06 18:25:08 -05:00
5
2026-11-02 15:33:20 -06:00
harutohiroki
MIT
7.1 KiB
Assets (1)
Versions (3) View all
0.2.0 2026-10-07
0.1.1 2026-10-06
0.1.0 2026-10-06