Repository navigation
feat: add Morse preset to LLM specs - #407
Merged
Merged
Conversation
Owner
|
@askmorse thx for the patch! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Adds a Morse preset to the LLM specs, in the same three-file shape as the TeamoRouter preset (#395, commit
762f851) thatCONTRIBUTING.mdpoints to. Morse is an OpenAI-compatible inference API for open-weight models (DeepSeek, GLM, Qwen, Kimi, Gemma and others), including uncensored variants of DeepSeek, GLM, Qwen and Kimi, that keeps no data on any model, so people serving or fine-tuning those models can point a scan at them through one key.agentic_security/routes/_specs.py: aPOST https://inference.trymorse.ai/v1/chat/completionsspec (Bearer$MORSE_API_KEY, modeldeepseek/deepseek-v4.1-flash) appended to_SPECSafter TeamoRouter, and the matching{"name": "Morse", ...}row appended toLLM_CONFIGS, so thezipstays aligned (both lists are 21 long).agentic_security/static/base.js: the same spec and name appended to the UI lists, with the fallback icon like the other recent presets.tests/unit/test_morse_spec.py: asserts the spec parses (method, URL,Bearer $MORSE_API_KEY, model, text modality) and drives one request throughhttpx.MockTransport(patched in forhttpx.AsyncHTTPTransport), checking method, URL and that the prompt goes out as the single user message. No network.Keys come from https://console.trymorse.ai; the model list is public at
GET https://inference.trymorse.ai/v1/models.I'm on the Morse team.
Morse also runs Built with Morse, a revenue share for open-source projects that ship Morse as a provider: terms and sign-up.
More about the Morse inference API.
How it was tested
test_morse_spec.pyandtest_teamorouter_spec.pyunder Python 3.12 againsthttp_spec.pyandroutes/_specs.pyfrom this branch, withconfig.settings_varandcore.app.get_secretsstubbed out (and the one 3.14-styleexcept A, B:line parenthesised in that scratch copy only): 4 passed. CI will run the real thing._SPECSandLLM_CONFIGSare both 21 entries, last pair Morse with its own URL (checked withast).node --check agentic_security/static/base.jspasses;py_compilepasses on both Python files.black --check,flake8andcodespellare clean on the changed Python files (not the fullpre-commit run --all-files).CONTRIBUTING.mdon the diff finds nothing.Checklist
pytestpasses and new behaviour has a test. Tests don't call paid APIs.pre-commit run --all-filesis clean.