Merge pull request #2537 from ctwardy/patch-1

Clarify "deployments" in azure.md & s/azure/openai.
This commit is contained in:
Nate Sesti 2024-10-31 12:27:37 -07:00 • committed by GitHub
commit 51c9cedd61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 111 additions and 65 deletions

View file

@ -0,0 +1,9 @@
## 0.8.55 - 2024-10-25
### Added
* Web context provider
* Cerebras inference provider
* Automatic descriptions for previous chats
* Discord context provider
* Improved full screen UI
### Changed
* Easier way to accept/reject/re-prompt after cmd/ctrl+I

View file

@ -1,4 +0,0 @@
project: extensions/vscode
kind: Added
body: Web context provider
time: 2024-10-14T23:15:51.670444-07:00

View file

@ -1,4 +0,0 @@
project: extensions/vscode
kind: Added
body: Cerebras inference provider
time: 2024-10-14T23:16:22.754491-07:00

View file

@ -1,4 +0,0 @@
project: extensions/vscode
kind: Added
body: Automatic descriptions for previous chats
time: 2024-10-14T23:16:39.451261-07:00

View file

@ -1,4 +0,0 @@
project: extensions/vscode
kind: Added
body: Discord context provider
time: 2024-10-14T23:16:57.089953-07:00

View file

@ -1,4 +0,0 @@
project: extensions/vscode
kind: Added
body: Improved full screen UI
time: 2024-10-14T23:17:14.574917-07:00

View file

@ -1,4 +0,0 @@
project: extensions/vscode
kind: Changed
body: Easier way to accept/reject/re-prompt after cmd/ctrl+I
time: 2024-10-14T23:17:38.086964-07:00

View file

@ -49,7 +49,7 @@ declare global {
apiBase?: string;
cacheBehavior?: CacheBehavior;
engine?: string;
deployment?: string;
apiVersion?: string;
apiType?: string;
region?: string;
@ -322,7 +322,7 @@ declare global {
accountId?: string;
// Azure options
engine?: string;
deployment?: string;
apiVersion?: string;
apiType?: string;
@ -773,7 +773,7 @@ declare global {
apiBase?: string;
apiKey?: string;
model?: string;
engine?: string;
deployment?: string;
apiType?: string;
apiVersion?: string;
requestOptions?: RequestOptions;

View file

@ -87,7 +87,7 @@ const embeddingsProviderSchema = z.object({
apiBase: z.string().optional(),
apiKey: z.string().optional(),
model: z.string().optional(),
engine: z.string().optional(),
deployment: z.string().optional(),
apiType: z.string().optional(),
apiVersion: z.string().optional(),
requestOptions: z

6
core/index.d.ts vendored
View file

@ -72,7 +72,7 @@ export interface ILLM extends LLMOptions {
apiBase?: string;
cacheBehavior?: CacheBehavior;
engine?: string;
deployment?: string;
apiVersion?: string;
apiType?: string;
region?: string;
@ -351,7 +351,7 @@ export interface LLMOptions {
accountId?: string;
// Azure options
engine?: string;
deployment?: string;
apiVersion?: string;
apiType?: string;
@ -836,7 +836,7 @@ export interface EmbedOptions {
apiBase?: string;
apiKey?: string;
model?: string;
engine?: string;
deployment?: string;
apiType?: string;
apiVersion?: string;
requestOptions?: RequestOptions;

View file

@ -27,7 +27,7 @@ class OpenAIEmbeddingsProvider extends BaseEmbeddingsProvider {
if (this.options.apiType === "azure") {
return new URL(
`openai/deployments/${this.options.engine}/embeddings?api-version=${this.options.apiVersion}`,
`openai/deployments/${this.options.deployment}/embeddings?api-version=${this.options.apiVersion}`,
this.options.apiBase,
);
}

View file

@ -1,5 +1,5 @@
import { ChatMessage, LLMOptions, ModelProvider } from "..";
import { BaseLLM } from ".";
import { ChatMessage, LLMOptions, ModelProvider } from "..";
class DummyLLM extends BaseLLM {
static providerName: ModelProvider = "openai";
@ -48,7 +48,7 @@ describe("BaseLLM", () => {
aiGatewaySlug: "testSlug",
apiBase: "https://api.example.com",
accountId: "testAccountId",
engine: "davinci",
deployment: "davinci",
apiVersion: "v1",
apiType: "public",
region: "us",
@ -71,7 +71,7 @@ describe("BaseLLM", () => {
expect(instance.aiGatewaySlug).toBe("testSlug");
expect(instance.apiBase).toBe("https://api.example.com/");
expect(instance.accountId).toBe("testAccountId");
expect(instance.engine).toBe("davinci");
expect(instance.deployment).toBe("davinci");
expect(instance.apiVersion).toBe("v1");
expect(instance.apiType).toBe("public");
expect(instance.region).toBe("us");

View file

@ -106,7 +106,7 @@ export abstract class BaseLLM implements ILLM {
cacheBehavior?: CacheBehavior;
capabilities?: ModelCapability;
engine?: string;
deployment?: string;
apiVersion?: string;
apiType?: string;
region?: string;
@ -190,7 +190,7 @@ export abstract class BaseLLM implements ILLM {
this.accountId = options.accountId;
this.capabilities = options.capabilities;
this.engine = options.engine;
this.deployment = options.deployment;
this.apiVersion = options.apiVersion;
this.apiType = options.apiType;
this.region = options.region;

View file

@ -11,7 +11,7 @@ class Azure extends OpenAI {
constructor(options: LLMOptions) {
super(options);
this.engine = options.model;
this.deployment = options.deployment ?? options.model;
}
}

View file

@ -166,7 +166,7 @@ class OpenAI extends BaseLLM {
) {
if (this.apiType === "azure") {
return new URL(
`openai/deployments/${this.engine}/${endpoint}?api-version=${this.apiVersion}`,
`openai/deployments/${this.deployment}/${endpoint}?api-version=${this.apiVersion}`,
this.apiBase,
);
}

View file

@ -0,0 +1,54 @@
---
title: NVIDIA
---
:::info
[View the docs](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog) to learn how to get an API key.
:::
## Chat model
We recommend configuring **Nemotron-4-340B-Instruct** as your chat model.
```json title="config.json"
{
"models": [
{
"title": "Nemotron-4-340B-Instruct",
"provider": "nvidia",
"model": "nvidia-nemotron-4-340b-instruct",
"apiKey": "[API_KEY]"
}
]
}
```
## Autocomplete model
NVIDIA currently does not offer any autocomplete models.
[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers.
## Embeddings model
We recommend configuring **NVIDIA Retrieval QA Mistral 7B** as your embeddings model.
```json title="config.json"
{
"embeddingsProvider": [
{
"provider": "nvidia",
"model": "nvidia/nv-embedqa-mistral-7b-v2",
"apiKey": "[API_KEY]"
}
]
}
```
## Reranking model
NVIDIA currently does not offer any reranking models.
[Click here](../../model-types/reranking.md) to see a list of reranking model providers.

View file

@ -18,13 +18,13 @@ We recommend configuring **GPT-4o** as your chat model.
```json title="config.json"
"models": [{
"title": "GPT-4o",
"provider": "azure",
"provider": "openai", // As of Oct 15, "azure" isn't recognized
"apiType": "azure", // Needed to construct Azure-style URL
"model": "gpt-4o",
"apiBase": "<YOUR_DEPLOYMENT_BASE>",
"engine": "<YOUR_ENGINE>",
"apiVersion": "<YOUR_API_VERSION>",
"apiType": "azure",
"apiKey": "<MY_API_KEY>"
"deployment": "<YOUR_DEPLOYMENT_NAME>", // Your deployment, eg "gpt4o-beta"
"apiVersion": "<YOUR_API_VERSION>", // Typically a date like "2024-06-01"
"apiKey": "<MY_API_KEY>" // If you use subscription key, try using Azure gateway to rename it apiKey
}]
```
@ -72,20 +72,27 @@ You need to apply for access to the Azure OpenAI service. Response times are typ
## General model configuration
Azure OpenAI requires a handful of additional parameters to be configured, such as a model engine and API version.
Azure OpenAI requires a handful of additional parameters to be configured, such as a deployment name and API version.
To find this information in _Azure AI Studio_, first select the model that you would like to connect. Then visit _Endpoint_ > _Target URI_.
For example, a Target URI of `<https://just-an-example.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2023-03-15-preview>` would map to the following:
For example, a Target URI of:
````````````
https://just-an-example.openai.azure.com/openai/deployments/gpt-4o-july/chat/completions?api-version=2023-03-15-preview
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``````````` ******************
````````````
would map to the following:
```json
{
"title": "GPT-4o Azure",
"model": "gpt-4o",
"provider": "azure",
"apiBase": "https://just-an-example.openai.azure.com",
"provider": "openai",
"apiType": "azure",
"engine": "gpt-4o",
"apiBase": "https://just-an-example.openai.azure.com",
"deployment": "gpt-4o-july",
"apiVersion": "2023-03-15-preview",
"apiKey": "<MY_API_KEY>"
}

View file

@ -5,7 +5,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
Pre-release Changes
## 0.8.55 - 2024-10-25
### Added
* Web context provider
* Cerebras inference provider
@ -15,6 +15,10 @@ Pre-release Changes
### Changed
* Easier way to accept/reject/re-prompt after cmd/ctrl+I
## 0.8.54 - 2024-10-15
### Fixed
* Hotfix: throttle transformers.js embeddings provider
## 0.8.53 - 2024-10-11
### Added
* Improved loading/accept/reject UI for apply

View file

@ -414,9 +414,9 @@
"description": "Azure OpenAI API version (e.g. 2023-07-01-preview)",
"type": "string"
},
"engine": {
"title": "Engine",
"description": "Azure OpenAI engine",
"deployment": {
"title": "Deployment",
"description": "Azure OpenAI deployment",
"type": "string"
},
"capabilities": {
@ -539,7 +539,7 @@
},
"then": {
"properties": {
"engine": {
"deployment": {
"type": "string"
},
"apiType": {
@ -1301,11 +1301,7 @@
]
},
"then": {
"required": [
"engine",
"apiVersion",
"apiBase"
]
"required": ["deployment", "apiBase"]
}
},
{

View file

@ -1,10 +1,10 @@
import { ModelProvider } from "core";
import { HTMLInputTypeAttribute } from "react";
import { ModelProviderTags } from "../../../components/modelSelection/utils";
import { FREE_TRIAL_LIMIT_REQUESTS } from "../../../util/freeTrial";
import { completionParamsInputs } from "./completionParamsInputs";
import type { ModelPackage } from "./models";
import { models } from "./models";
import { ModelProviderTags } from "../../../components/modelSelection/utils";
export interface InputDescriptor {
inputType: HTMLInputTypeAttribute;
@ -132,7 +132,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
packages: [models.gpt4o],
params: {
apiKey: "",
engine: "",
deployment: "",
apiBase: "",
apiVersion: "",
apiType: "azure",
@ -147,9 +147,9 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
},
{
inputType: "text",
key: "engine",
label: "Engine",
placeholder: "Enter the engine name",
key: "deployment",
label: "Deployment",
placeholder: "Enter the deployment name",
required: true,
},
{ ...apiBaseInput, required: true },

View file

@ -112,7 +112,7 @@ export const embeddingsProviderSchema = z.object({
apiBase: z.string().optional(),
apiKey: z.string().optional(),
model: z.string().optional(),
engine: z.string().optional(),
deployment: z.string().optional(),
apiType: z.string().optional(),
apiVersion: z.string().optional(),
requestOptions: requestOptionsSchema.optional(),