Skip to content

Providers: images and thinking levels for OpenAI-compatible models - #287

Open
vitalNohj wants to merge 2 commits into
TannerMidd:release/0.28.0from
vitalNohj:feat/provider-model-caps
Open

vitalNohj wants to merge 2 commits into
TannerMidd:release/0.28.0from
vitalNohj:feat/provider-model-caps

Conversation

@vitalNohj

Copy link
Copy Markdown
Contributor

The OpenAI-compatible endpoint form sets each model's ids only. Pi already reads input, reasoning, and thinkingLevelMap from models.json, but the form shows none of them, so an endpoint model gets no images ("image omitted") and no thinking levels unless I edit models.json by hand.

What changed

Each chosen model in the form has:

  • Images: a checkbox that writes input: ["text", "image"].
  • Thinking: a button that opens the model's levels. Turning thinking on starts with Low to Max. Each level is a row: the level in the model menu (any of Pi's levels, Off and Minimal too) and the value sent to the endpoint for it, so a level can send another name (High sends hard). Levels can be removed and added; Defaults puts back Low to Max. It writes reasoning and thinkingLevelMap (levels left out are null).
  • Discovery fills both in where the endpoint's list says so: OpenRouter-style architecture.input_modalities / supported_parameters, and Ollama-style capabilities (vision, thinking).

Fields the form does not manage stay as they are, as before. A model's levels come back on Edit as Pi reads them, also for an entry made by hand. Edit also opens when the server is older than the page and sends no images or thinking for its models.

Tests

  • npm run check, npm run lint.
  • test/custom-providers.test.ts, test/providers.test.ts, test/model-providers.test.ts: 21 passed. New cases cover writing and reading back input, reasoning, and thinkingLevelMap, renamed and removed levels, bad input, and discovery from both list styles.
  • By hand on a copy server with a fake endpoint, on desktop and phone sizes: the model menu offered exactly the chosen levels, and a model without Images got text only.

…n thinking levels (add, remove, or send a level under another name); discovery reads them where the list says
…d its models say nothing of images or thinking

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant