langchain.js
    Preparing search index...
    • Attempts to infer the model provider based on the given model name.

      Parameters

      • modelName: string

        The name of the model to infer the provider for.

      Returns undefined | string

      The inferred model provider name, or undefined if unable to infer.

      _inferModelProvider("gpt-4"); // returns "openai"
      _inferModelProvider("claude-2"); // returns "anthropic"
      _inferModelProvider("unknown-model"); // returns undefined