Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/llm/llms/Modelsell.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { LLMOptions } from "../../index.js";

import OpenAI from "./OpenAI.js";

class Modelsell extends OpenAI {
static providerName = "modelsell";
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://modelsell.com/v1/",
useLegacyCompletionsEndpoint: false,
};
}

export default Modelsell;
46 changes: 46 additions & 0 deletions core/llm/llms/Modelsell.vitest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { describe, expect, test, vi } from "vitest";

import Modelsell from "./Modelsell.js";
import { LLMClasses } from "./index.js";

describe("Modelsell", () => {
test("registers the provider with the Modelsell API base", () => {
expect(Modelsell.providerName).toBe("modelsell");
expect(Modelsell.defaultOptions).toMatchObject({
apiBase: "https://modelsell.com/v1/",
useLegacyCompletionsEndpoint: false,
});
expect(LLMClasses).toContain(Modelsell);
});

test("discovers model IDs from the Modelsell models endpoint", async () => {
const modelsell = new Modelsell({
apiKey: "test-api-key",
model: "",
});
const mockFetch = vi.fn().mockResolvedValue(
new Response(
JSON.stringify({
data: [{ id: "provider/model-a" }, { id: "model-b" }],
}),
{ headers: { "Content-Type": "application/json" } },
),
);
(modelsell as any).fetch = mockFetch;

await expect(modelsell.listModels()).resolves.toEqual([
"provider/model-a",
"model-b",
]);
expect(mockFetch).toHaveBeenCalledTimes(1);

const [url, options] = mockFetch.mock.calls[0];
expect(url.toString()).toBe("https://modelsell.com/v1/models");
expect(options).toMatchObject({
method: "GET",
headers: {
Authorization: "Bearer test-api-key",
},
});
});
});
2 changes: 2 additions & 0 deletions core/llm/llms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import LMStudio from "./LMStudio";
import Mistral from "./Mistral";
import Mimo from "./Mimo";
import MiniMax from "./MiniMax";
import Modelsell from "./Modelsell";
import MockLLM from "./Mock";
import Moonshot from "./Moonshot";
import Msty from "./Msty";
Expand Down Expand Up @@ -95,6 +96,7 @@ export const LLMClasses = [
Mistral,
Mimo,
MiniMax,
Modelsell,
Bedrock,
BedrockImport,
SageMaker,
Expand Down
55 changes: 55 additions & 0 deletions docs/customize/model-providers/more/modelsell.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: "Modelsell"
description: "Configure Modelsell with Continue through its OpenAI-compatible Chat Completions API and dynamic model discovery."
---

Modelsell provides a unified OpenAI-compatible endpoint for using multiple AI model providers in Continue.

- **API base:** `https://modelsell.com/v1`
- **API keys:** [modelsell.com/console/token](https://modelsell.com/console/token)
- **API documentation:** [modelsell.com/docs/api-reference](https://modelsell.com/docs/api-reference)

## Discover available models

Modelsell's model catalog is dynamic. Fetch the model IDs available to your API key from `GET /v1/models` rather than relying on a static list:

```bash
curl https://modelsell.com/v1/models \
-H "Authorization: Bearer $MODELSELL_API_KEY"
```

Use an `id` from the response as the `model` value in your Continue configuration.

## Configuration

<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1

models:
- name: Modelsell
provider: modelsell
model: <MODEL_ID_FROM_GET_V1_MODELS>
apiKey: ${{ secrets.MODELSELL_API_KEY }}
```
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "Modelsell",
"provider": "modelsell",
"model": "<MODEL_ID_FROM_GET_V1_MODELS>",
"apiKey": "<YOUR_MODELSELL_API_KEY>"
}
]
}
```
</Tab>
</Tabs>

The initial integration uses Modelsell's OpenAI-compatible Chat Completions endpoint. It does not maintain a hardcoded model catalog in Continue.
1 change: 1 addition & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"customize/model-providers/more/llamastack",
"customize/model-providers/more/mimo",
"customize/model-providers/more/mistral",
"customize/model-providers/more/modelsell",
"customize/model-providers/more/moonshot",
"customize/model-providers/more/nous",
"customize/model-providers/more/nvidia",
Expand Down
Loading