From 03598ea26ddd7c1e576aef0c12c005d68890a6f4 Mon Sep 17 00:00:00 2001 From: Mark Espinoza Date: Wed, 8 Oct 2025 09:23:06 -0500 Subject: [PATCH] fix: LLM Provider - Ask Sage: Updated Model list, updated docs and fixed drop down menu option (#8102) * feat: enhance AskSage with new request handling and token management * feat: update provider options and add new Ask Sage models * feat: update Ask Sage model configurations and remove deprecated API Base URL input * feat: update package versions and add @anthropic-ai/sdk dependency * feat: update model titles and modify API base URL handling in provider configuration * feat: update Ask Sage documentation and add to navigation * Update gui/src/pages/AddNewModel/configs/providers.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- core/llm/llms/Asksage.ts | 381 ++++++++++++---- .../model-providers/more/asksage.mdx | 123 +++-- docs/docs.json | 1 + extensions/vscode/package-lock.json | 5 +- gui/package-lock.json | 3 +- gui/src/pages/AddNewModel/configs/models.ts | 422 +++++++++++++++--- .../pages/AddNewModel/configs/providers.ts | 55 ++- 7 files changed, 786 insertions(+), 204 deletions(-) diff --git a/core/llm/llms/Asksage.ts b/core/llm/llms/Asksage.ts index 988c57ac6..93d2016c3 100644 --- a/core/llm/llms/Asksage.ts +++ b/core/llm/llms/Asksage.ts @@ -1,3 +1,4 @@ +import FormData from "form-data"; import { ChatMessage, CompletionOptions, @@ -6,48 +7,169 @@ import { } from "../../index.js"; import { BaseLLM } from "../index.js"; +// Extended options for AskSage +interface AskSageCompletionOptions extends CompletionOptions { + mode?: "chat" | "deep_agent"; + limitReferences?: 0 | 1; + persona?: number; + systemPrompt?: string; + askSageTools?: AskSageTool[]; + enabledMcpTools?: string[]; + toolsToExecute?: string[]; + askSageToolChoice?: ToolChoice; + reasoningEffort?: "low" | "medium" | "high"; + deepAgentId?: number; + streaming?: boolean; + file?: unknown; +} + +const DEFAULT_API_URL = "https://api.asksage.ai/server"; +const DEFAULT_USER_API_URL = "https://api.asksage.ai/user"; +const TOKEN_TTL = 3600000; // 1 hour in milliseconds + +interface AskSageTool { + type: string; + function: { + name: string; + description?: string; + parameters?: Record; + }; +} + +type ToolChoice = + | "auto" + | "none" + | { type: "function"; function: { name: string } }; + +interface AskSageRequestArgs { + model?: string; + temperature?: number; + mode?: "chat" | "deep_agent"; + message?: string | { user: string; message: string }[]; + live?: 0 | 1 | 2; + dataset?: string | string[]; + limit_references?: 0 | 1; + persona?: number; + system_prompt?: string; + tools?: AskSageTool[]; + enabled_mcp_tools?: string[]; + tools_to_execute?: string[]; + tool_choice?: ToolChoice; + reasoning_effort?: "low" | "medium" | "high"; + deep_agent_id?: number; + streaming?: boolean; + file?: unknown; +} + +interface AskSageResponse { + text?: string; + answer?: string; + message?: string; + status?: number | string; + response?: unknown; + choices?: Array<{ + message?: { + content?: string; + }; + }>; +} + +interface TokenResponse { + status: number | string; + response: { + access_token: string; + }; +} + class Asksage extends BaseLLM { static providerName = "askSage"; static defaultOptions: Partial = { - apiBase: "https://api.asksage.ai/server/", + apiBase: DEFAULT_API_URL, model: "gpt-4o", }; - private static modelConversion: { [key: string]: string } = { - "gpt-4o-gov": "gpt-4o-gov", // Works - "gpt-4o-mini-gov": "gpt-4o-mini-gov", - "gpt4-gov": "gpt4-gov", // Works - "gpt-gov": "gpt-gov", // Works - "gpt-4o": "gpt-4o", // Works - "gpt-4o-mini": "gpt-4o-mini", // Works - gpt4: "gpt4", // Works - "gpt4-32k": "gpt4-32k", - "gpt-o1": "gpt-o1", // Works - "gpt-o1-mini": "gpt-o1-mini", // Works - "gpt-o3-mini": "gpt-o3-mini", // Stub - "gpt-3.5-turbo": "gpt35-16k", // Works - "aws-bedrock-claude-35-sonnet-gov": "aws-bedrock-claude-35-sonnet-gov", // Works - "claude-3-5-sonnet-latest": "claude-35-sonnet", // Works - "claude-3-opus-20240229": "claude-3-opus", // Works - "claude-3-sonnet-20240229": "claude-3-sonnet", // Works - "grok-beta": "xai-grok", - "groq-llama33": "groq-llama33", - "groq-70b": "groq-70b", - "mistral-large-latest": "mistral-large", // Works - "llama3-70b": "llma3", // Works - "gemini-1.5-pro-latest": "google-gemini-pro", // Works - }; + private sessionTokenPromise: Promise | null = null; + private tokenTimestamp: number = 0; + private email?: string; + private userApiUrl: string; constructor(options: LLMOptions) { super(options); this.apiVersion = options.apiVersion ?? "v1.2.4"; + this.email = process.env.ASKSAGE_EMAIL; + this.userApiUrl = process.env.ASKSAGE_USER_API_URL || DEFAULT_USER_API_URL; } - protected _convertModelName(model: string): string { - console.log("Converting model:", model); - const convertedModel = Asksage.modelConversion[model] ?? model; - console.log("Converted model:", convertedModel); - return convertedModel; + private async getSessionToken(): Promise { + if (!this.apiKey) { + throw new Error( + "AskSage adapter: missing ASKSAGE_API_KEY. Provide it in your environment variables or .env file.", + ); + } + + // If no email, use API key directly + if (!this.email || this.email.length === 0) { + return this.apiKey; + } + + const url = this.userApiUrl.replace(/\/$/, "") + "/get-token-with-api-key"; + const res = await this.fetch(url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email: this.email, api_key: this.apiKey }), + }); + + const data = (await res.json()) as TokenResponse; + if (parseInt(String(data.status)) !== 200) { + throw new Error("Error getting access token: " + JSON.stringify(data)); + } + return data.response.access_token; + } + + private async getToken(): Promise { + // Check if token needs refresh + if ( + !this.sessionTokenPromise || + Date.now() - this.tokenTimestamp > TOKEN_TTL + ) { + this.sessionTokenPromise = this.getSessionToken(); + this.tokenTimestamp = Date.now(); + } + return this.sessionTokenPromise; + } + + private isFileLike(val: unknown): boolean { + return ( + val !== null && + val !== undefined && + ((typeof File !== "undefined" && val instanceof File) || + (typeof Buffer !== "undefined" && val instanceof Buffer) || + (typeof val === "object" && + ("path" in val || "name" in val || "type" in val))) + ); + } + + private toFormData(args: AskSageRequestArgs): FormData { + const form = new FormData(); + + for (const [key, value] of Object.entries(args)) { + if (value === undefined || value === null) continue; + + if (key === "file" && value) { + if (Buffer.isBuffer(value)) { + form.append("file", value, "file"); + } else if (typeof value === "string") { + form.append("file", value); + } else { + form.append("file", value as Buffer); + } + } else if (Array.isArray(value) || typeof value === "object") { + form.append(key, JSON.stringify(value)); + } else { + form.append(key, String(value)); + } + } + return form; } protected _convertMessage(message: ChatMessage) { @@ -63,43 +185,63 @@ class Asksage extends BaseLLM { }; } - protected _convertArgs(options: any, messages: ChatMessage[]) { - let formattedMessage: any; + protected _convertArgs( + options: AskSageCompletionOptions, + messages: ChatMessage[], + ): AskSageRequestArgs { + let formattedMessage: string | { user: string; message: string }[]; if (messages.length === 1) { - formattedMessage = messages[0].content; + formattedMessage = messages[0].content as string; } else { formattedMessage = messages.map(this._convertMessage); } - const args: any = { + const args: AskSageRequestArgs = { message: formattedMessage, - persona: options.persona ?? "default", - dataset: options.dataset ?? "none", - limit_references: options.limitReferences ?? 0, + model: options.model, temperature: options.temperature ?? 0.0, - live: options.live ?? 0, - model: this._convertModelName(options.model), + mode: "chat", // Always use chat mode + limit_references: 0, // Always use 0 + persona: options.persona as number | undefined, system_prompt: options.systemPrompt ?? + process.env.ASKSAGE_SYSTEM_PROMPT ?? "You are an expert software developer. You give helpful and concise responses.", - tools: options.tools, - tool_choice: options.toolChoice, + tools: options.askSageTools, + // enabled_mcp_tools: options.enabledMcpTools as string[] | undefined, + // tools_to_execute: options.toolsToExecute as string[] | undefined, + tool_choice: options.askSageToolChoice, + reasoning_effort: options.reasoningEffort as + | "low" + | "medium" + | "high" + | undefined, + deep_agent_id: options.deepAgentId as number | undefined, + streaming: options.streaming as boolean | undefined, + file: options.file, }; + // Remove undefined values Object.keys(args).forEach( - (key) => args[key] === undefined && delete args[key], + (key) => + args[key as keyof AskSageRequestArgs] === undefined && + delete args[key as keyof AskSageRequestArgs], ); return args; } - protected _getHeaders() { + protected async _getHeaders( + hasFile: boolean = false, + ): Promise> { + const token = await this.getToken(); const headers: Record = { - "Content-Type": "application/json", + accept: "application/json", + "x-access-tokens": token, }; - if (this.apiKey) { - headers["x-access-tokens"] = this.apiKey; + if (!hasFile) { + headers["Content-Type"] = "application/json"; } return headers; @@ -125,21 +267,66 @@ class Asksage extends BaseLLM { } const messages: ChatMessage[] = [{ role: "user", content: prompt }]; - const args = this._convertArgs(options, messages); + const hasFile = this.isFileLike(args.file); + const endpoint = hasFile ? "query_with_file" : "query"; - const response = await this.fetch(this._getEndpoint("query"), { - method: "POST", - headers: this._getHeaders(), - body: JSON.stringify(args), - }); + try { + let response; + if (hasFile) { + const form = this.toFormData(args); + const headers = await this._getHeaders(true); + response = await this.fetch(this._getEndpoint(endpoint), { + method: "POST", + headers: { + ...headers, + ...form.getHeaders(), + }, + body: form as unknown as BodyInit, + signal, + }); + } else { + const headers = await this._getHeaders(false); + response = await this.fetch(this._getEndpoint(endpoint), { + method: "POST", + headers, + body: JSON.stringify(args), + signal, + }); + } - if (response.status === 499) { - return ""; // Aborted by user + if (response.status === 499) { + return ""; // Aborted by user + } + + if (!response.ok) { + const errText = await response.text(); + + // Clear token cache on 401 + if (response.status === 401) { + this.sessionTokenPromise = null; + this.tokenTimestamp = 0; + } + + throw new Error( + `AskSage API error: ${response.status} ${response.statusText}: ${errText}`, + ); + } + + const data = (await response.json()) as AskSageResponse; + return ( + data.text || + data.answer || + data.message || + data.choices?.[0]?.message?.content || + "" + ); + } catch (error) { + if (error instanceof Error) { + throw new Error(`AskSage client error: ${error.message}`); + } + throw error; } - - const data = await response.json(); - return data.message; } protected async *_streamComplete( @@ -157,30 +344,74 @@ class Asksage extends BaseLLM { options: CompletionOptions, ): AsyncGenerator { const args = this._convertArgs(options, messages); + const hasFile = this.isFileLike(args.file); + const endpoint = hasFile ? "query_with_file" : "query"; - const response = await this.fetch(this._getEndpoint("query"), { - method: "POST", - headers: this._getHeaders(), - body: JSON.stringify(args), - signal, - }); + try { + let response; + if (hasFile) { + const form = this.toFormData(args); + const headers = await this._getHeaders(true); + response = await this.fetch(this._getEndpoint(endpoint), { + method: "POST", + headers: { + ...headers, + ...form.getHeaders(), + }, + body: form as unknown as BodyInit, + signal, + }); + } else { + const headers = await this._getHeaders(false); + response = await this.fetch(this._getEndpoint(endpoint), { + method: "POST", + headers, + body: JSON.stringify(args), + signal, + }); + } - if (response.status === 499) { - return; // Aborted by user + if (response.status === 499) { + return; // Aborted by user + } + + if (!response.ok) { + const errText = await response.text(); + + // Clear token cache on 401 + if (response.status === 401) { + this.sessionTokenPromise = null; + this.tokenTimestamp = 0; + } + + throw new Error( + `AskSage API error: ${response.status} ${response.statusText}: ${errText}`, + ); + } + + const data = (await response.json()) as AskSageResponse; + + const assistantMessage: ChatMessage = { + role: "assistant", + content: + data.text || + data.answer || + data.message || + data.choices?.[0]?.message?.content || + "", + }; + + yield assistantMessage; + } catch (error) { + if (error instanceof Error) { + throw new Error(`AskSage client error: ${error.message}`); + } + throw error; } - - const data = await response.json(); - - const assistantMessage: ChatMessage = { - role: "assistant", - content: data.message, - }; - - yield assistantMessage; } async listModels(): Promise { - return Object.keys(Asksage.modelConversion); + return []; } } diff --git a/docs/customize/model-providers/more/asksage.mdx b/docs/customize/model-providers/more/asksage.mdx index 03ad0e3ca..c7dd81391 100644 --- a/docs/customize/model-providers/more/asksage.mdx +++ b/docs/customize/model-providers/more/asksage.mdx @@ -1,18 +1,34 @@ --- -title: "AskSage" -description: "Configure AskSage with Continue to access a wide range of models including government-compliant versions of GPT and Claude models, supporting chat and edit functionalities" +title: "Ask Sage" +slug: ../asksage --- + + **Discover Ask Sage models [here](https://hub.continue.dev/?q=Ask%20Sage)** + + - To get an Ask Sage API key login to the Ask Sage platform (If you don't have - an account, you can create one [here](https://chat.asksage.ai/)) and follow - the instructions in the Ask Sage Docs: [Ask Sage API - Key](https://docs.asksage.ai/docs/api-documentation/api-documentation.html) + You can get an API key from the [Ask Sage](https://www.asksage.ai/). -## Configuration -To use the Ask Sage models, you can use the following +## Overview + +Ask Sage provides secure, government-compliant access to LLMs. This guide explains how to set up and configure Ask Sage models, including support for DoD certificates. + +## 1. Prerequisites + +- **Ask Sage Account:** + Sign up or log in at [Ask Sage Platform](https://chat.asksage.ai/). + +- **API Key:** + Follow the [API Key Documentation](https://docs.asksage.ai/docs/api-documentation/api-documentation.html) to generate your key. + + +## 2. Configuration + +Add your Ask Sage model to your Continue configuration file. + @@ -42,53 +58,66 @@ To use the Ask Sage models, you can use the following -The `apiBase` will be listed on the Ask Sage platform when you generate an `API key`. You will see context as shown below: +## 3. Using DoD Certificates -> Server API for query/training etc.: -> -> - Documentation: https://app.swaggerhub.com/apis-docs/NICOLASCHAILLAN_1/server_ask-sage_api/1.0 -> - URL for this API is: https://api.asksage.ai/server/ +For secure environments, specify your DoD CA bundle path: -## Usage -Currently, the setup for the models provided by Ask Sage is to support the following two functionalities provided by Continue.Dev: + + + ```yaml title="config.yaml" + models: + - name: GPT-4 gov + provider: askSage + model: gpt4-gov + apiBase: https://api.asksage.ai/server/ + apiKey: + requestOptions: + caBundlePath: /path/to/dod/certificates + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "GPT-4 gov", + "provider": "askSage", + "model": "gpt4-gov", + "apiBase": "https://api.asksage.ai/server/", + "apiKey": "", + "requestOptions": { + "caBundlePath": "/path/to/dod/certificates" + } + } + ] + } + ``` + + -- `Chat` to understand and iterate on code in the sidebar -- `Edit` to modify code without leaving your current file +Replace `/path/to/dod/certificates` with your actual CA bundle file path. -More models, functionalities and documentation will be added in the future for Ask Sage Integration. +--- -> We recommend to utilize the `OpenAI` or `Anthropic` models for the best performance and results for the `Chat` and `Edit` functionalities. +## 4. Final Steps -## Ask Sage Documentation +- Save your configuration file. +- Restart Continue to apply changes. -Ask Sage documentation is not available with Continue.Dev, so if you have any questions or need help with Ask Sage type `@ask` and select the `Ask Sage` option in the chat. Then procced to ask your question about Ask Sage. +Your Ask Sage model will now be available in Continue. -## Current Models From Ask Sage Supported +## 5. Usage -The current Models available provided by Ask Sage are: +Supported features: + +- **Chat:** Interact and iterate on code in the sidebar. +- **Edit:** Modify code in place. + +## 6. Support + +- Refer to [Ask Sage Docs](https://docs.asksage.ai/docs/api-documentation/api-documentation.html) for more details. +- Email the Ask Sage support team for assistance at support@asksage.ai. + +--- -| Index | Model | Added | -| ----- | --------------------- | ----- | -| 1 | GPT-4 Gov | ✅ | -| 2 | GPT-4o Gov | ✅ | -| 3 | GPT-4o-mini Gov | ✅ | -| 4 | GPT-3.5-Turbo Gov | ✅ | -| 5 | GPT-4o | ✅ | -| 6 | GPT-4o-mini | ✅ | -| 7 | GPT-4 | ✅ | -| 8 | GPT-4-32K | ✅ | -| 9 | GPT-o1 | ✅ | -| 10 | GPT-o1-mini | ✅ | -| 10 | GPT-o3-mini | ✅ | -| 11 | GPT-3.5-turbo | ✅ | -| 12 | Claude 3.5 Sonnet Gov | ✅ | -| 13 | Claude 3 Opus | ✅ | -| 14 | Claude 3 Sonet | ✅ | -| 15 | Claude 3.5 Sonnet | ✅ | -| 16 | Grok (xAI) | ✅ | -| 17 | Groq Llama 3.3 | ✅ | -| 18 | Groq 70B | ✅ | -| 19 | Gemini Pro | ✅ | -| 20 | llama 3 | ✅ | -| 21 | Mistral Large | ✅ | diff --git a/docs/docs.json b/docs/docs.json index 04e9b809b..27282b5d7 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -135,6 +135,7 @@ { "group": "More Providers", "pages": [ + "customize/model-providers/more/asksage", "customize/model-providers/more/deepseek", "customize/model-providers/more/deepinfra", "customize/model-providers/more/groq", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index eaa07b5a0..47283ebf1 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.3.12", + "version": "1.3.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.3.12", + "version": "1.3.15", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "file:../../packages/config-types", @@ -100,6 +100,7 @@ "version": "1.1.0", "license": "Apache-2.0", "dependencies": { + "@anthropic-ai/sdk": "^0.62.0", "@aws-sdk/client-bedrock-runtime": "^3.779.0", "@aws-sdk/client-sagemaker-runtime": "^3.777.0", "@aws-sdk/credential-providers": "^3.778.0", diff --git a/gui/package-lock.json b/gui/package-lock.json index 962b06471..1796d1ab7 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -116,6 +116,7 @@ "version": "1.1.0", "license": "Apache-2.0", "dependencies": { + "@anthropic-ai/sdk": "^0.62.0", "@aws-sdk/client-bedrock-runtime": "^3.779.0", "@aws-sdk/client-sagemaker-runtime": "^3.777.0", "@aws-sdk/credential-providers": "^3.778.0", @@ -235,7 +236,7 @@ }, "../packages/config-yaml": { "name": "@continuedev/config-yaml", - "version": "1.14.0", + "version": "1.23.0", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 76151a274..aaa8092f7 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -514,7 +514,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["groq", "askSage"], + providerOptions: ["groq"], isOpenSource: false, }, llama318bChat: { @@ -841,7 +841,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 32000, }, icon: "mistral.png", - providerOptions: ["mistral", "askSage"], + providerOptions: ["mistral"], isOpenSource: false, }, mistralNemo: { @@ -1114,7 +1114,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 128_000, title: "GPT-4o", }, - providerOptions: ["openai", "askSage"], + providerOptions: ["openai"], icon: "openai.png", isOpenSource: false, }, @@ -1125,9 +1125,10 @@ export const models: { [key: string]: ModelPackage } = { params: { model: "gpt-4o-mini", contextLength: 128_000, + title: "GPT-4o mini", }, - providerOptions: ["openai", "askSage"], + providerOptions: ["openai"], icon: "openai.png", isOpenSource: false, }, @@ -1140,7 +1141,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8096, title: "GPT-3.5-Turbo", }, - providerOptions: ["openai", "askSage"], + providerOptions: ["openai"], icon: "openai.png", isOpenSource: false, }, @@ -1154,7 +1155,7 @@ export const models: { [key: string]: ModelPackage } = { title: "Claude 4 Sonnet", apiKey: "", }, - providerOptions: ["anthropic", "askSage"], + providerOptions: ["anthropic"], icon: "anthropic.png", isOpenSource: false, }, @@ -1167,7 +1168,7 @@ export const models: { [key: string]: ModelPackage } = { title: "Claude 4.1 Opus", apiKey: "", }, - providerOptions: ["anthropic", "askSage"], + providerOptions: ["anthropic"], icon: "anthropic.png", isOpenSource: false, }, @@ -1331,135 +1332,382 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["vertexai"], isOpenSource: false, }, + // OpenAI Models via Ask Sage + asksagegpt4o: { + title: "GPT-4o*", + description: + "An even faster version of GPT-4 with stronger multi-modal capabilities.", + params: { + model: "gpt-4o", + contextLength: 128_000, + maxTokens: 16_384, + title: "GPT-4o*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksagegpt4omini: { + title: "GPT-4o Mini*", + description: + "A model at less than half the price of gpt-3.5-turbo, but near gpt-4 in capabilities.", + params: { + model: "gpt-4o-mini", + contextLength: 128_000, + maxTokens: 16_384, + title: "GPT-4o mini*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, asksagegpt4gov: { - title: "GPT-4 gov", + title: "GPT-4 gov*", description: "U.S. Government. Most capable model today - which is similar to GPT-4 but approved for use by the U.S. Government.", params: { model: "gpt4-gov", contextLength: 128_000, - title: "GPT-4 gov", + maxTokens: 4096, + title: "GPT-4 gov*", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, asksagegpt4ogov: { - title: "GPT-4o gov", + title: "GPT-4o gov*", description: "U.S. Government. Most capable model today - which is similar to GPT-4o but approved for use by the U.S. Government.", params: { model: "gpt-4o-gov", contextLength: 128_000, - title: "GPT-4o-gov", + maxTokens: 4096, + title: "GPT-4o-gov*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksagegpt35: { + title: "GPT-3.5*", + description: "Azure OpenAI GPT 3.5 Model.", + params: { + model: "gpt", + contextLength: 4096, + title: "GPT-3.5*", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, asksagegpt35gov: { - title: "GPT-3.5-Turbo gov", + title: "GPT-3.5 gov*", description: "U.S. Government. Inexpensive and good ROI.", params: { model: "gpt-gov", - contextLength: 8096, - title: "GPT-3.5-Turbo gov", + contextLength: 16834, + maxTokens: 4096, + title: "GPT-3.5 gov*", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, asksagegpt4ominigov: { - title: "GPT-4o-mini gov", - description: - "U.S. Government. Latest OpenAI GPT 4o-mini model. More inexpensive than GPT4. Capable of ingesting and analyzing images (JPG, PNG, GIF (20MB files max)). 16,384 token response max.", + title: "GPT-4o-mini gov*", + description: "OpenAI GPT 4o-mini model.", params: { model: "gpt-4o-mini-gov", contextLength: 128_000, - title: "GPT-4o-mini gov", + maxTokens: 16_384, + title: "GPT-4o-mini gov*", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, asksagegpt4: { - title: "GPT-4", + title: "GPT-4*", description: "GPT4 is about 5X more expensive than Ask Sage tokens and 50X more expensive than GPT3.5", params: { model: "gpt4", contextLength: 8_192, - title: "GPT-4", - }, - providerOptions: ["openai"], - icon: "openai.png", - isOpenSource: false, - }, - asksagegpt432: { - title: "GPT-4-32k", - description: - "The GPT-4-32k model is a variant of the GPT-4 model developed by OpenAI. It is designed to handle a larger context window, capable of processing up to 32,768 tokens, which makes it suitable for scenarios that require extensive information integration and data analysis", - params: { - model: "gpt4-32k", - contextLength: 32_768, - title: "GPT-4-32k", + title: "GPT-4*", + apiKey: "", }, providerOptions: ["openai"], icon: "openai.png", isOpenSource: false, }, asksagegpto1: { - title: "GPT-o1", + title: "GPT-o1*", description: "Latest OpenAI GPT-o1 model. More inexpensive than GPT4. Capable of ingesting and analyzing images (JPG, PNG, GIF (20MB files max)).", params: { model: "gpt-o1", contextLength: 128_000, - title: "GPT-o1", + maxTokens: 32_768, + title: "GPT-o1*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, // stopped here + }, + asksagegpt41: { + title: "GPT-4.1*", + description: "Azure OpenAI GPT 4.1 model.", + params: { + model: "gpt-4.1", + contextLength: 1_000_000, + maxTokens: 32_768, + title: "GPT-4.1*", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, - asksagegpto1mini: { - title: "GPT-o1-mini", - description: - "Latest OpenAI GPT-o1-mini model. More inexpensive than GPT-o1. Capable of ingesting and analyzing images (JPG, PNG, GIF (20MB files max)). 16,384 token response max.", + asksagegpt41mini: { + title: "GPT-4.1 mini*", + description: "Azure OpenAI GPT 4.1 mini model.", params: { - model: "gpt-o1-mini", - contextLength: 128_000, - title: "GPT-o1-mini", + model: "gpt-4.1-mini", + contextLength: 1_000_000, + maxTokens: 32_768, + title: "GPT-4.1 mini*", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, - asksagegpto3mini: { - title: "GPT-o3-mini", - description: - "o3-mini can outperform o1 in coding and other reasoning tasks, and is 93% cheaper and has lower latency. It supports function calling, Structured Outputs, streaming, and developer messages. o3-mini comes with a larger context window of 200,000 tokens and a max output of 100,000 tokens", + asksagegpt41nano: { + title: "GPT-4.1 nano*", + description: "Azure OpenAI GPT 4.1 nano model.", params: { - model: "gpt-o3-mini", + model: "gpt-4.1-nano", + contextLength: 1_000_000, + maxTokens: 32_768, + title: "GPT-4.1 nano*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksagegpt5: { + title: "GPT-5*", + description: "OpenAI's GPT-5 model", + params: { + model: "gpt-5", + contextLength: 272_000, + maxTokens: 128_000, + title: "GPT-5*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksagegpt5nano: { + title: "GPT-5-nano*", + description: "OpenAI's GPT-5-nano model", + params: { + model: "gpt-5-nano", + contextLength: 272_000, + maxTokens: 128_000, + title: "GPT-5-nano*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksagegpt5mini: { + title: "GPT-5-mini*", + description: "OpenAI's GPT-5-mini model", + params: { + model: "gpt-5-mini", + contextLength: 272_000, + maxTokens: 128_000, + title: "GPT-5-mini*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksagegpto3: { + title: "GPT-o3", + description: "Azure OpenAI GPT o3 model.", + params: { + model: "gpt-o3", contextLength: 200_000, - title: "GPT-o3-mini", + maxTokens: 100_000, + title: "GPT-o3", + apiKey: "", }, providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, - asksageclaude35gov: { - title: "Claude 3.5 Sonnet gov", + asksagegpt04mini: { + title: "GPT-o4-mini", + description: "Azure OpenAI GPT o4-mini model.", + params: { + model: "gpt-o4-mini", + contextLength: 200_000, + maxTokens: 100_000, + title: "GPT-o4-mini", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "openai.png", + isOpenSource: false, + }, + asksageclaude35Sonnet: { + title: "Claude 3.5 Sonnet", description: "Anthropic's most intelligent model, but much less expensive than Claude 3 Opus", params: { - model: "aws-bedrock-claude-35-sonnet-gov", + model: "claude-35-sonnet", contextLength: 200_000, - title: "Claude 3.5 Sonnet gov", + title: "Claude 3.5 Sonnet", + apiKey: "", }, providerOptions: ["askSage"], icon: "anthropic.png", isOpenSource: false, }, + asksageclaude37sonnet: { + title: "Claude 3.7 Sonnet", + description: "Anthropic's 3.7 model.", + params: { + model: "claude-37-sonnet", + contextLength: 200_000, + title: "Claude 3.7 Sonnet", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude37sonnetgov: { + title: "Claude 3.7 Sonnet gov*", + description: "Anthropic's 3.7 Sonnet model.", + params: { + model: "aws-bedrock-claude-37-sonnet-gov", + contextLength: 200_000, + title: "Claude 3.7 Sonnet gov*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude35gov: { + title: "Claude 3.5 Sonnet gov*", + description: "Anthropic's 3.5 Sonnet model.", + params: { + model: "aws-bedrock-claude-35-sonnet-gov", + contextLength: 200_000, + title: "Claude 3.5 Sonnet gov*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude4s: { + title: "Claude 4 Sonnet", + description: "Anthropic's Claude 4 Sonnet", + params: { + model: "claude-4-sonnet", + contextLength: 200_000, + title: "Claude 4 Sonnet", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude4o: { + title: "Claude 4 Opus", + description: "Anthropic's Claude 4 Opus", + params: { + model: "claude-4-opus", + contextLength: 200_000, + title: "Claude 4 Opus", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude4sonnet: { + title: "Claude 4 Sonnet*", + description: + "Anthropic's most powerful model, designed for complex, reasoning-heavy tasks like agentic search, coding, and writing.", + params: { + model: "google-claude-4-sonnet", + contextLength: 200_000, + title: "Claude 4 Sonnet*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude45sonnet: { + title: "Claude 4.5 Sonnet*", + description: + "Anthropic's most powerful model, designed for complex, reasoning-heavy tasks like agentic search, coding, and writing.", + params: { + model: "google-claude-45-sonnet", + contextLength: 200_000, + title: "Claude 4.5 Sonnet*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude41opus: { + title: "Claude 4.1 Opus*", + description: "Claude 4.1 Opus", + params: { + model: "google-claude-4-opus", + contextLength: 200_000, + title: "Claude 4.1 Opus*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksagenovalite: { + title: "Nova Lite*", + description: "AWS Gov Nova Lite model.", + params: { + model: "aws-bedrock-nova-lite-gov", + contextLength: 300_000, + title: "Nova Lite*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "aws.png", + isOpenSource: false, + }, asksagegroqllama33: { title: "Llama 3.3", description: "Llama-3.3 is a large language model customized by Groq.", @@ -1467,7 +1715,9 @@ export const models: { [key: string]: ModelPackage } = { title: "Llama 3.3", model: "groq-llama33", contextLength: 128_000, + apiKey: "", }, + providerOptions: ["askSage"], icon: "groq.png", isOpenSource: true, }, @@ -1478,10 +1728,66 @@ export const models: { [key: string]: ModelPackage } = { title: "Groq-70B", model: "groq-70b", contextLength: 8_192, + apiKey: "", }, + providerOptions: ["askSage"], icon: "groq.png", isOpenSource: true, }, + asksagegemini20Flash: { + title: "Gemini 2.0 Flash*", + description: + "Google's powerful workhorse model with low latency and enhanced performance.", + params: { + title: "Gemini 2.0 Flash*", + model: "google-gemini-20-flash", + contextLength: 1_000_000, + apiKey: "", + }, + icon: "gemini.png", + providerOptions: ["askSage"], + isOpenSource: false, + }, + asksagegemini25Pro: { + title: "Gemini 2.5 Pro*", + description: "Google's Gemini 2.5 Pro model", + params: { + title: "Gemini 2.5 Pro*", + model: "google-gemini-2.5-pro", + contextLength: 1_000_000, + apiKey: "", + }, + icon: "gemini.png", + providerOptions: ["askSage"], + isOpenSource: false, + }, + asksagegemini25flash: { + title: "Gemini 2.5 Flash*", + description: "Google's Gemini 2.5 Flash model", + params: { + title: "Gemini 2.5 Flash*", + model: "google-gemini-2.5-flash", + contextLength: 1_000_000, + apiKey: "", + }, + icon: "gemini.png", + providerOptions: ["askSage"], + isOpenSource: false, + }, + asksagegrok4: { + title: "Grok 4", + description: + "xAI's latest and greatest flagship model, offering strong performance in natural language, math and reasoning.", + params: { + title: "Grok 4", + model: "xai-grok", + contextLength: 256_000, + apiKey: "", + }, + icon: "xAI.png", + providerOptions: ["askSage"], + isOpenSource: false, + }, Qwen2Coder: { title: "Qwen 2.5 Coder 7b", description: @@ -1531,7 +1837,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 256000, }, icon: "xAI.png", - providerOptions: ["xAI", "askSage"], + providerOptions: ["xAI"], isOpenSource: false, }, grok4FastReasoning: { @@ -1544,7 +1850,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 2_000_000, }, icon: "xAI.png", - providerOptions: ["xAI", "askSage"], + providerOptions: ["xAI"], isOpenSource: false, }, grok4FastNonReasoning: { @@ -1557,7 +1863,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 2_000_000, }, icon: "xAI.png", - providerOptions: ["xAI", "askSage"], + providerOptions: ["xAI"], isOpenSource: false, }, grok4: { @@ -1571,7 +1877,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 256_000, }, icon: "xAI.png", - providerOptions: ["xAI", "askSage"], + providerOptions: ["xAI"], isOpenSource: false, }, grok3: { @@ -1585,7 +1891,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 131_072, }, icon: "xAI.png", - providerOptions: ["xAI", "askSage"], + providerOptions: ["xAI"], isOpenSource: false, }, grok3Mini: { @@ -1599,7 +1905,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 131_072, }, icon: "xAI.png", - providerOptions: ["xAI", "askSage"], + providerOptions: ["xAI"], isOpenSource: false, }, gemma2_2b: { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 280eb0ae9..88e091ce7 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -942,7 +942,6 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo ...completionParamsInputsConfigs, ], }, - askSage: { title: "Ask Sage", provider: "askSage", @@ -953,7 +952,7 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo tags: [ModelProviderTags.RequiresApiKey], params: { apiKey: "", - apiBase: "https://api.asksage.ai/server/", // Default base URL + apiBase: "https://api.asksage.ai/server/", }, collectInputFor: [ { @@ -967,32 +966,46 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo inputType: "text", key: "apiBase", label: "API Base URL", - placeholder: "Enter the API Base URL", + placeholder: "Enter your Ask Sage API base URL", required: true, + defaultValue: "https://api.asksage.ai/server/", }, ...completionParamsInputsConfigs, ], packages: [ - models.asksagegpt4ogov, - models.asksagegpt4ominigov, - models.asksagegpt4gov, - models.asksagegpt35gov, - models.gpt4o, - models.gpt4omini, - models.asksagegpt4, - models.asksagegpt432, - models.asksagegpto1, - models.asksagegpto1mini, - models.gpt35turbo, + models.asksageclaude45sonnet, + models.asksageclaude4sonnet, + models.asksageclaude41opus, + models.asksagegpt5, + models.asksagegpt5nano, + models.asksagegpt5mini, + models.asksagegemini20Flash, + models.asksagegemini25Pro, + models.asksagegemini25flash, models.asksageclaude35gov, - models.claude35Sonnet, - models.claude3Opus, - models.claude3Sonnet, - models.grokBeta, - models.asksagegroqllama33, + models.asksageclaude37sonnetgov, + models.asksagegpt4o, + models.asksagegpt4omini, + models.asksagegpt4gov, + models.asksagegpt4ogov, + models.asksagegpt35, + models.asksagegpt35gov, + models.asksagegpt4ominigov, + models.asksagegpt4, + models.asksagegpto1, + models.asksagegpt41, + models.asksagegpt41mini, + models.asksagegpt41nano, + models.asksagegpto3, + models.asksagegpt04mini, + models.asksagenovalite, models.asksagegroq70b, - models.mistralLarge, - models.llama370bChat, + models.asksagegroqllama33, + models.asksagegrok4, + models.asksageclaude35Sonnet, + models.asksageclaude37sonnet, + models.asksageclaude4s, + models.asksageclaude4o, ], apiKeyUrl: "https://chat.asksage.ai/", },