Skip to content

Add Morph Model Router as a routing method #177

Description

@bhaktatejas922

LLMRouter supports 16+ routing models across single-round, multi-round, agentic, and personalized categories. Morph's Model Router is a hosted single-round router worth adding as a baseline: a classifier trained on millions of coding prompts that returns difficulty, ambiguity, and domain in ~50ms, then maps to a model via policy. Useful as a hosted comparison point against the trained KNN/SVM/MLP routers already in the library.

One POST, OpenAI-compatible (/router/multimodel takes allowed_providers + policy, returns a single model name):

import requests
model = requests.post(
    "https://api.morphllm.com/v1/router/multimodel",
    headers={"Authorization": f"Bearer {MORPH_API_KEY}"},
    json={"input": prompt, "allowed_providers": ["openai"], "policy": "balanced"},
).json()["model"]

Docs: https://docs.morphllm.com/sdk/components/router

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions