v0.2.1 model names config-driven
This commit is contained in:
@@ -3,9 +3,10 @@ import { configFile } from '../file-models/config.json'
|
||||
|
||||
const { InputSpec, Value } = sdk
|
||||
|
||||
// Optional Gemma/Ollama endpoint for the operator-hardware analysis
|
||||
// fallback. Counterpart to setParakeetUrl — Parakeet handles transcribe
|
||||
// overflow, this handles analyze overflow.
|
||||
// Operator's Gemma (or any OpenAI-compatible chat-completions) endpoint
|
||||
// + which model to request. Both fields live-reload so the operator
|
||||
// can pull a different Gemma SKU on Ollama and update the model name
|
||||
// here without restarting the relay.
|
||||
const inputSpec = InputSpec.of({
|
||||
relay_gemma_base_url: Value.text({
|
||||
name: 'Gemma Base URL',
|
||||
@@ -22,6 +23,15 @@ const inputSpec = InputSpec.of({
|
||||
},
|
||||
],
|
||||
}),
|
||||
relay_gemma_model: Value.text({
|
||||
name: 'Gemma Model Name',
|
||||
description:
|
||||
'The model identifier sent in upstream chat-completions requests. Match whatever name your Ollama / vLLM / llama.cpp deployment exposes (run `ollama list` to see what you have pulled). Example: gemma3:27b, gemma2:9b, llama3.1:70b',
|
||||
required: true,
|
||||
default: 'gemma3:27b',
|
||||
minLength: 1,
|
||||
maxLength: 128,
|
||||
}),
|
||||
})
|
||||
|
||||
export const setGemmaUrl = sdk.Action.withInput(
|
||||
@@ -30,7 +40,7 @@ export const setGemmaUrl = sdk.Action.withInput(
|
||||
async ({ effects }) => ({
|
||||
name: 'Set Gemma URL',
|
||||
description:
|
||||
'Optional. Where the relay forwards analysis requests once a user exceeds their monthly Gemini cap. Leave empty to disable the fallback.',
|
||||
'Optional. Where the relay forwards analysis requests once a user exceeds their monthly Gemini cap. Leave URL empty to disable the fallback.',
|
||||
warning: null,
|
||||
allowedStatuses: 'any',
|
||||
group: null,
|
||||
@@ -43,12 +53,14 @@ export const setGemmaUrl = sdk.Action.withInput(
|
||||
const config = await configFile.read().once()
|
||||
return {
|
||||
relay_gemma_base_url: config?.relay_gemma_base_url || '',
|
||||
relay_gemma_model: config?.relay_gemma_model || 'gemma3:27b',
|
||||
}
|
||||
},
|
||||
|
||||
async ({ effects, input }) => {
|
||||
await configFile.merge(effects, {
|
||||
relay_gemma_base_url: (input.relay_gemma_base_url || '').trim(),
|
||||
relay_gemma_model: (input.relay_gemma_model || 'gemma3:27b').trim(),
|
||||
})
|
||||
return null
|
||||
},
|
||||
|
||||
@@ -3,13 +3,9 @@ import { configFile } from '../file-models/config.json'
|
||||
|
||||
const { InputSpec, Value } = sdk
|
||||
|
||||
// Optional Parakeet endpoint for the operator-hardware fallback path.
|
||||
// When a Pro/Max user exceeds their Gemini monthly cap, the relay
|
||||
// routes transcribe requests here instead. Empty disables the fallback
|
||||
// — over-cap users get 402.
|
||||
//
|
||||
// In a typical setup this points at the operator's NVIDIA Spark or
|
||||
// similar local GPU box running the NeMo / Parakeet HTTP wrapper.
|
||||
// Operator's Parakeet endpoint + which model to request. Both fields
|
||||
// live-reload — change them via this action and the next relay request
|
||||
// picks up the new values without a daemon restart.
|
||||
const inputSpec = InputSpec.of({
|
||||
relay_parakeet_base_url: Value.text({
|
||||
name: 'Parakeet Base URL',
|
||||
@@ -26,6 +22,15 @@ const inputSpec = InputSpec.of({
|
||||
},
|
||||
],
|
||||
}),
|
||||
relay_parakeet_model: Value.text({
|
||||
name: 'Parakeet Model Name',
|
||||
description:
|
||||
'The model identifier sent in upstream requests (the "model" field in the OpenAI Whisper API body). Match whatever name your Parakeet wrapper expects. Default: parakeet-tdt-0.6b-v3',
|
||||
required: true,
|
||||
default: 'parakeet-tdt-0.6b-v3',
|
||||
minLength: 1,
|
||||
maxLength: 128,
|
||||
}),
|
||||
})
|
||||
|
||||
export const setParakeetUrl = sdk.Action.withInput(
|
||||
@@ -34,7 +39,7 @@ export const setParakeetUrl = sdk.Action.withInput(
|
||||
async ({ effects }) => ({
|
||||
name: 'Set Parakeet URL',
|
||||
description:
|
||||
"Optional. Where the relay forwards transcription requests once a user exceeds their monthly Gemini cap. Leave empty to disable the operator-hardware fallback.",
|
||||
"Optional. Where the relay forwards transcription requests once a user exceeds their monthly Gemini cap. Leave URL empty to disable the operator-hardware fallback.",
|
||||
warning: null,
|
||||
allowedStatuses: 'any',
|
||||
group: null,
|
||||
@@ -47,12 +52,16 @@ export const setParakeetUrl = sdk.Action.withInput(
|
||||
const config = await configFile.read().once()
|
||||
return {
|
||||
relay_parakeet_base_url: config?.relay_parakeet_base_url || '',
|
||||
relay_parakeet_model:
|
||||
config?.relay_parakeet_model || 'parakeet-tdt-0.6b-v3',
|
||||
}
|
||||
},
|
||||
|
||||
async ({ effects, input }) => {
|
||||
await configFile.merge(effects, {
|
||||
relay_parakeet_base_url: (input.relay_parakeet_base_url || '').trim(),
|
||||
relay_parakeet_model:
|
||||
(input.relay_parakeet_model || 'parakeet-tdt-0.6b-v3').trim(),
|
||||
})
|
||||
return null
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user