Skip to content

feat: add Morpheus (mor.org) as LLM provider#360

Open
Bougey wants to merge 1 commit intobrowseros-ai:mainfrom
Bougey:feat/add-morpheus-provider
Open

feat: add Morpheus (mor.org) as LLM provider#360
Bougey wants to merge 1 commit intobrowseros-ai:mainfrom
Bougey:feat/add-morpheus-provider

Conversation

@Bougey
Copy link

@Bougey Bougey commented Feb 25, 2026

Summary

Adds Morpheus decentralized AI compute as a provider option in BrowserOS. Morpheus exposes an OpenAI-compatible API at api.mor.org with 30+ models including GLM-5, Kimi K2.5, Hermes 3 Llama 3.1 405B, Qwen3-235B, DeepSeek R1, and Llama 4 Maverick.

Changes (7 files, +48 lines)

  • packages/shared/src/schemas/llm.ts — Added MORPHEUS: 'morpheus' to LLM_PROVIDERS constant and LLMProviderSchema Zod enum
  • apps/server/src/agent/tool-loop/provider-factory.ts — Added createMorpheusFactory using @ai-sdk/openai-compatible
  • apps/server/src/lib/clients/llm/provider.ts — Added createMorpheusModel using @ai-sdk/openai-compatible
  • apps/agent/lib/llm-providers/types.ts — Added 'morpheus' to ProviderType union
  • apps/agent/lib/llm-providers/providerTemplates.ts — Added Morpheus template, dropdown option, and default base URL (https://api.mor.org/api/v1)
  • apps/agent/entrypoints/app/ai-settings/models.ts — Added Morpheus model list to ModelsData and MODELS_DATA
  • apps/agent/entrypoints/app/ai-settings/NewProviderDialog.tsx — Added 'morpheus' to Zod validation enum

Morpheus Details

  • API Base URL: https://api.mor.org/api/v1
  • Auth: Bearer token via API key from app.mor.org
  • Protocol: OpenAI-compatible (/chat/completions)
  • Default model: glm-5
  • Docs: apidocs.mor.org
  • Note: Most models also support :web variants (e.g., glm-5:web) for internet-enabled search

Implementation Pattern

Follows the same pattern as existing providers (Ollama, LM Studio) that use @ai-sdk/openai-compatible. The default base URL is https://api.mor.org/api/v1, with API key required.

Test plan

  • Verify Morpheus appears in provider type dropdown
  • Verify default base URL auto-fills when Morpheus is selected
  • Verify model dropdown shows available Morpheus models
  • Verify "custom" model option still works for unlisted models
  • Test connection with a valid Morpheus API key
  • Verify existing providers are unaffected

🤖 Generated with Claude Code

Add Morpheus decentralized AI compute as a provider option. Morpheus
exposes an OpenAI-compatible API at api.mor.org with 30+ models.

Changes across 7 files:
- packages/shared: Add 'morpheus' to LLM_PROVIDERS and Zod schema
- apps/server: Add Morpheus factory in both provider-factory.ts and
  provider.ts using @ai-sdk/openai-compatible
- apps/agent: Add Morpheus to ProviderType union, provider templates,
  dropdown options, default base URL, model list, and form validation

Default model: glm-5. API key from https://app.mor.org.
Most models also support :web variants for internet search.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement.

To sign the CLA, please add a comment to this PR with the following text:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once. After signing, this check will pass automatically.


Troubleshooting
  • Already signed but still failing? Comment recheck to trigger a re-verification.
  • Signed with a different email? Make sure your commit email matches your GitHub account email, or add your commit email to your GitHub account.
- - - I have read the CLA Document and I hereby sign the CLA - - - **Brian Bourgerie** seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please [add the email address used for this commit to your account](https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user).
You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR adds Morpheus as a new LLM provider option, following the established pattern for OpenAI-compatible providers. The implementation is clean and consistent across all 7 modified files.

  • Added morpheus to shared schemas (LLM_PROVIDERS constant and Zod validation)
  • Implemented server-side provider factories in both provider-factory.ts and provider.ts using @ai-sdk/openai-compatible
  • Updated frontend configuration with provider templates, model list (6 models), and form validation
  • Default configuration: base URL https://api.mor.org/api/v1, default model glm-5, context window 131072
  • API key requirement is properly enforced via validation in both server and client

The implementation correctly mirrors the pattern used for similar providers like Ollama and LM Studio, with appropriate API key validation.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward, follows existing patterns precisely, and makes no changes to core logic. All modifications are additive (adding a new provider option) with no breaking changes. The pattern is well-established and tested through similar providers like Ollama and LM Studio.
  • No files require special attention

Important Files Changed

Filename Overview
packages/shared/src/schemas/llm.ts Added MORPHEUS: 'morpheus' to constants and Zod schema - straightforward addition following existing pattern
apps/server/src/agent/tool-loop/provider-factory.ts Added createMorpheusFactory using @ai-sdk/openai-compatible - correctly requires apiKey and sets default baseURL
apps/server/src/lib/clients/llm/provider.ts Added createMorpheusModel mirroring factory implementation - consistent with existing provider pattern
apps/agent/lib/llm-providers/providerTemplates.ts Added Morpheus template with proper configuration, dropdown option, and default base URL
apps/agent/entrypoints/app/ai-settings/models.ts Added Morpheus model list with 6 models, all with 131072 context length

Last reviewed commit: 6cc80d3

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