add aws claude haiku (#310)
# PR Checklist - [x] Did you check if it works normally in all models? *ignore this when it dosen't uses models* - [x] Did you check if it works normally in all of web, local and node hosted versions? if it dosen't, did you blocked it in those versions? - [x] Did you added a type def? # Description  
This commit is contained in:
@@ -186,6 +186,7 @@
|
|||||||
<OptionInput value="claude-instant-v1.1-100k">claude-instant-v1.1-100k</OptionInput>
|
<OptionInput value="claude-instant-v1.1-100k">claude-instant-v1.1-100k</OptionInput>
|
||||||
<OptionInput value="claude-3-opus-20240229">claude-3-opus-20240229</OptionInput>
|
<OptionInput value="claude-3-opus-20240229">claude-3-opus-20240229</OptionInput>
|
||||||
<OptionInput value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</OptionInput>
|
<OptionInput value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</OptionInput>
|
||||||
|
<!-- <OptionInput value="claude-3-haiku-202403079">claude-3-haiku-20240307</OptionInput> -->
|
||||||
<OptionInput value="custom">Custom</OptionInput>
|
<OptionInput value="custom">Custom</OptionInput>
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
{#if $DataBase.proxyRequestModel === 'custom'}
|
{#if $DataBase.proxyRequestModel === 'custom'}
|
||||||
|
|||||||
@@ -1514,18 +1514,24 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
|
|
||||||
const AMZ_HOST = "bedrock-runtime.%REGION%.amazonaws.com";
|
const AMZ_HOST = "bedrock-runtime.%REGION%.amazonaws.com";
|
||||||
const host = AMZ_HOST.replace("%REGION%", region);
|
const host = AMZ_HOST.replace("%REGION%", region);
|
||||||
const stream = false
|
const stream = false; // todo?
|
||||||
const CLAUDE_3_COMPAT_MODEL = "anthropic.claude-3-sonnet-20240229-v1:0";
|
|
||||||
|
|
||||||
// AWS currently only supports one v3 model.
|
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html
|
||||||
const awsModel = CLAUDE_3_COMPAT_MODEL;
|
const modelIDs = [
|
||||||
|
"anthropic.claude-v2",
|
||||||
|
"anthropic.claude-v2:1",
|
||||||
|
"anthropic.claude-3-haiku-20240307-v1:0",
|
||||||
|
"anthropic.claude-3-sonnet-20240229-v1:0",
|
||||||
|
];
|
||||||
|
|
||||||
|
const awsModel = raiModel.includes("haiku") ? modelIDs[2] : modelIDs[3];
|
||||||
const url = `https://${host}/model/${awsModel}/invoke${stream ? "-with-response-stream" : ""}`
|
const url = `https://${host}/model/${awsModel}/invoke${stream ? "-with-response-stream" : ""}`
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
messages : claudeChat,
|
messages : claudeChat,
|
||||||
system: systemPrompt.trim(),
|
system: systemPrompt.trim(),
|
||||||
max_tokens: maxTokens,
|
max_tokens: maxTokens,
|
||||||
// stop_sequences: ["user:", "assistant:", "system:"],
|
// stop_sequences: null,
|
||||||
temperature: temperature,
|
temperature: temperature,
|
||||||
top_p: db.top_p,
|
top_p: db.top_p,
|
||||||
top_k: db.top_k,
|
top_k: db.top_k,
|
||||||
|
|||||||
Reference in New Issue
Block a user