Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Feature Request: Easier way to override model capabilities in openAICompatible plugin #3948

@zuencap

Description

@zuencap

Currently, to override the default capabilities (like constrained: 'all') for a model using the openAICompatible plugin, one must implement a custom resolver that manually defines the model using defineCompatOpenAIModel and compatOaiModelRef.

This is verbose and inconvenient, especially when just trying to enable a capability that the model supports but isn't enabled by default in the generic model info (e.g. native structured output for Fireworks AI).

It would be much better if:

  1. openAICompatible plugin accepted a capabilities or modelInfo override in its configuration.
  2. Or if ai.generate respected the info property passed in modelRef at runtime (currently resolveModel ignores it).

Example of current workaround:

openAICompatible({
  name: 'fireworks',
  apiKey: process.env.FIREWORKS_API_KEY,
  baseURL: '...',
  resolver: async (client, actionType, actionName) => {
    if (actionType === 'model') {
      return defineCompatOpenAIModel({
        name: actionName,
        client,
        modelRef: compatOaiModelRef({
          name: actionName,
          info: {
            supports: {
              multiturn: true,
              media: true,
              tools: true,
              toolChoice: true,
              systemRole: true,
              constrained: 'all', // <--- The goal
            },
          },
        }),
      });
    }
    return undefined;
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions