FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
FreeNIMAPI/scripts/guided_config.js at main · ForgetMeAI/FreeNIMAPI · GitHub
ForgetMeAI
FreeNIMAPI
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
FreeNIMAPI
/
scripts
/
guided_config.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (15 loc) · 570 Bytes
Breadcrumbs
FreeNIMAPI
/
scripts
/
guided_config.js
Copy path
File metadata and controls
17 lines (15 loc) · 570 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const
loopbackHosts
=
new
Set
(
[
"127.0.0.1"
,
"localhost"
,
"::1"
]
)
;
export
function
guidedLocalKey
(
{
host
,
nvidiaKey
,
explicitLocalKey
}
)
{
if
(
!
explicitLocalKey
&&
!
loopbackHosts
.
has
(
host
)
)
{
throw
new
Error
(
"Guided mode only uses its simple local key on loopback. Set a strong FREENIM_LOCAL_API_KEY before binding to another host."
,
)
;
}
const
localKey
=
explicitLocalKey
||
"freenim-local"
;
if
(
nvidiaKey
===
localKey
)
{
throw
new
Error
(
"FREENIM_LOCAL_API_KEY must be different from NVIDIA_API_KEY."
,
)
;
}
return
localKey
;
}
Back
|
FazBrowse Home
|
New Git URL