Skip to content

[Feature] Auto-discover models for OpenAI-compatible providers #56

Description

@yan-ad

Feature Request

It would be useful if Crabcode could automatically discover available models from custom OpenAI-compatible providers instead of requiring every model to be manually defined in the configuration.

Most OpenAI-compatible APIs expose a standard models endpoint:

GET /v1/models

Crabcode could use this endpoint to automatically populate the available model list when configuring or using an OpenAI-compatible provider.

Motivation

Currently, when using a custom OpenAI-compatible endpoint, models may need to be manually configured.

This becomes inconvenient for providers that expose many models or frequently add/update their available models.

For example, if a provider exposes:

GET https://example.com/v1/models

Crabcode could fetch the models from that endpoint and make them immediately available in /models.

Suggested Behavior

For providers configured as OpenAI-compatible:

  1. Use the configured baseURL and API key.
  2. Request GET /v1/models.
  3. Parse the returned model IDs.
  4. Automatically expose them in Crabcode's model selector (/models).
  5. Resolve model metadata from sources such as models.dev or AI SDK when available.
  6. Allow manually configured models to override discovered models and metadata.

If the endpoint doesn't support /v1/models, Crabcode could simply fall back to the current manually configured model behavior.

Model Metadata

The /v1/models endpoint usually only provides model identifiers and does not expose enough information about the model's limits or capabilities.

After discovering a model, Crabcode could optionally look up additional metadata from models.dev or AI SDK, including:

  • Input token limit
  • Context window size
  • Output token limit
  • Supported modalities
  • Reasoning capability

For example, a discovered model could internally resolve to metadata similar to:

{
  "id": "gpt-6-astra",
  "limit": {
    "input": 1050000,
    "context": 1050000,
    "output": 128000
  },
  "reasoning": true,
  "modalities": {
    "input": ["text", "image"],
    "output": ["text"]
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions