Skip to content

feat: Skip provider prefixing in model names if model already contains a slash '/' #255

Description

@worldwidehigh

Feature Title

Skip auto-prefixing on models with existing slashes

Describe the feature

Currently, when configuring an OpenAI-compatible provider (e.g., EDGEQUAKE_LLM_PROVIDER=openai), the backend automatically prepends the provider name to the model string (e.g., transforming gpt-4o-mini into openai/gpt-4o-mini).

We propose adding a simple check in the model factory:
If the configured model name already contains a slash / (for example, openai/gpt-4o-mini or deepinfra/minimax-m2.5), EdgeQuake should skip prepending the provider name and pass the model string exactly as configured by the user.

A potential fix in factory.rs could look like this:

let final_model_name = if model_name.contains('/') {
    model_name.to_string()
} else {
    format!("{}/{}", provider_name, model_name)
};

Motivation

When routing API requests through intermediate AI Gateways, Routers, or Proxies (such as Requesty, Portkey, or custom corporate proxies) that utilize the standard OpenAI-compatible client under the hood but require the standard provider/model format, the current auto-prefixing logic results in a double-prefixed string (e.g. converting openai/gpt-4o-mini into openai/openai/gpt-4o-mini).

This causes the upstream router to reject the request with Invalid model, expected: "provider/model" errors.

Allowing explicit model naming by bypassing the auto-prefixer when a slash is already present would make EdgeQuake highly compatible with any custom AI routers and third-party API gateways out of the box, without breaking backwards compatibility.

Alternatives considered

  1. Using the openrouter provider as a workaround: While this works for the LLM because it doesn't auto-prepend, it currently disables/mocks embedding endpoints or causes warning loops, making it an unstable hack for fully production-ready RAG setups.
  2. Patching the source files (factory.rs, openai.rs) locally: This is possible but maintaining a custom fork diverges from upstream. A native solution is highly beneficial for the community.

Additional context

This issue was discovered while setting up a local EdgeQuake pipeline routed through an EU-compliant Requesty gateway. Once the double-prefixing issue was bypassed, the Rust backend worked flawlessly and yielded incredible performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions