Skip to content

[Feature] Define interface for ModelProvider to ease contributing new providers #599

Open
@zpg6

Description

@zpg6

Adding a new provider is a bit scattered across a few files and the steps aren't clear. It should be more interface-driven so that we can scale up adding many models (and lightweight assistants, agents, etc)... here's an example:

interface ModelProvider {
  // Initialize provider with authentication and configuration
  initialize(config: ProviderConfig): Promise<void>;
  
  // Send a chat request and get streamed response
  sendChat(params: ChatRequestParams): Promise<ChatResponse>;
  
  // Fill-in-middle completion (if supported)
  sendFIM?(params: FIMRequestParams): Promise<FIMResponse>;
  
  // List available models (if supported)
  listModels?(): Promise<ModelInfo[]>;
  
  // Abort ongoing requests
  abort(): void;
  
  // Check if a specific capability is supported
  supportsCapability(capability: ProviderCapability): boolean;
}

@andrewpareles: if this is of interest I'd like to work on it :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions