scripts/raycast/update-ai-providers (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/usr/bin/env fish
# tell raycast which models are available in lm studio
set --local lms_base_url http://localhost:1234
set --local lms_models_path /api/v0/models
set --local lms_openai_path /v1/
xh $lms_base_url$lms_models_path | fx .data '?.type != "embeddings"' 'map(m => ({
id: m.id, name: m.id, context: m.max_context_length,
abilities: {
tools: { supported: m.capabilities?.includes("tool_use") || false },
temperature: { supported: true },
system_message: { supported: true },
vision: { supported: m.type == "vlm" },
}
}))' "x => ({
providers: [{
id: 'lm-studio',
name: 'LM Studio',
base_url: '$lms_base_url$lms_openai_path',
models: x
}]
})" YAML.stringify >~/.config/raycast/ai/providers.yaml
|