Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
8c5a30db
Unverified
Commit
8c5a30db
authored
9 months ago
by
Timothy Carambat
Committed by
GitHub
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Support dynamic context length - VoyageAI (#1489)
parent
a256db13
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/pages/GeneralSettings/LLMPreference/index.jsx
+5
-4
5 additions, 4 deletions
frontend/src/pages/GeneralSettings/LLMPreference/index.jsx
server/utils/EmbeddingEngines/voyageAi/index.js
+16
-1
16 additions, 1 deletion
server/utils/EmbeddingEngines/voyageAi/index.js
with
21 additions
and
5 deletions
frontend/src/pages/GeneralSettings/LLMPreference/index.jsx
+
5
−
4
View file @
8c5a30db
...
...
@@ -394,16 +394,17 @@ export default function GeneralLLMPreference() {
>
<
div
className
=
"flex gap-x-4 items-center"
>
<
img
src
=
{
selectedLLMObject
.
logo
}
alt
=
{
`
${
selectedLLMObject
.
name
}
logo`
}
src
=
{
selectedLLMObject
?
.
logo
||
AnythingLLMIcon
}
alt
=
{
`
${
selectedLLMObject
?
.
name
}
logo`
}
className
=
"w-10 h-10 rounded-md"
/>
<
div
className
=
"flex flex-col text-left"
>
<
div
className
=
"text-sm font-semibold text-white"
>
{
selectedLLMObject
.
name
}
{
selectedLLMObject
?
.
name
||
"
None selected
"
}
</
div
>
<
div
className
=
"mt-1 text-xs text-[#D2D5DB]"
>
{
selectedLLMObject
.
description
}
{
selectedLLMObject
?.
description
||
"
You need to select an LLM
"
}
</
div
>
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
server/utils/EmbeddingEngines/voyageAi/index.js
+
16
−
1
View file @
8c5a30db
...
...
@@ -15,7 +15,22 @@ class VoyageAiEmbedder {
// Limit of how many strings we can process in a single pass to stay with resource or network limits
this
.
batchSize
=
128
;
// Voyage AI's limit per request is 128 https://docs.voyageai.com/docs/rate-limits#use-larger-batches
this
.
embeddingMaxChunkLength
=
4000
;
// https://docs.voyageai.com/docs/embeddings - assume a token is roughly 4 letters with some padding
this
.
embeddingMaxChunkLength
=
this
.
#getMaxEmbeddingLength
();
}
// https://docs.voyageai.com/docs/embeddings
#getMaxEmbeddingLength
()
{
switch
(
this
.
model
)
{
case
"
voyage-large-2-instruct
"
:
case
"
voyage-law-2
"
:
case
"
voyage-code-2
"
:
case
"
voyage-large-2
"
:
return
16
_000
;
case
"
voyage-2
"
:
return
4
_000
;
default
:
return
4
_000
;
}
}
async
embedTextInput
(
textInput
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment