@shitpost.work/omp-shitpost-provider (0.1.0)
Installation
@shitpost.work:registry=npm config set @shitpost.work:registry=npm install @shitpost.work/[email protected]"@shitpost.work/omp-shitpost-provider": "0.1.0"About this package
NOT READY FOR PUBLIC RELEASE
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.workprovider in omp - baseUrl from your config,openai-completionsAPI, 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 tomin(context/4, 32000)) - Maps llama-router's API addon report: reasoning effort levels, the advertised default effort, a thinking-off variant,
supported_parameters, and fullpricing - Maps
architecture.input_modalitiesandarchitecture.tokenizer - API key via
SHITPOST_WORK_API_KEY/LLM_API_KEYenv vars or/login shitpost.work /shitpost-refreshcommand to re-fetch the model list mid-session- Retries discovery on
session_startif 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:
SHITPOST_WORK_API_KEYenv varLLM_API_KEYenv var~/.omp/agent/auth.json-shitpost.work(orshitpost-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(modeeffort),nonefiltered outreasoning_effort.default->thinking.defaultLevel, so "no variant" matches the router's advertised default (only used if it's inlevels)reasoning_effort.disable->compat.reasoningDisableMode:none->none-effort(sendsreasoning_effort: "none"),lowest->lowest-effort,qwen->qwen-enable-thinking-false(sendschat_template_kwargs: { "enable_thinking": false })supported_parameters->supportsToolsfrom the presence oftools(defaults to true when the field is absent)pricing->cost, includingcache_readandcache_write(missing -> 0)architecture.input_modalities/modalities-> input modalities (text, ortext+image)architecture.tokenizer->tokenizercontext_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->ThinkingCapknownModels:glm->GLM,minimax->MiniMaxknownTags: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 |