Spaces:
Paused
Paused
Download node_modules/@huggingface/tasks/src/inference-providers.ts from ken-q/opencode-home: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/spaces/ken-q/opencode-home/resolve/main/node_modules/%40huggingface/tasks/src/inference-providers.ts
- Command line
-
hf download hf://spaces/ken-q/opencode-home/node_modules/@huggingface/tasks/src/inference-providers.ts
-
curl -L -o inference-providers.ts https://huggingface.co/spaces/ken-q/opencode-home/resolve/main/node_modules/%40huggingface/tasks/src/inference-providers.ts
819 Bytes
| /// This list is for illustration purposes only. | |
| /// in the `tasks` sub-package, we do not need actual strong typing of the inference providers. | |
| const INFERENCE_PROVIDERS = [ | |
| "cerebras", | |
| "cohere", | |
| "deepinfra", | |
| "fal-ai", | |
| "fireworks-ai", | |
| "hf-inference", | |
| "ovhcloud", | |
| "replicate", | |
| "together", | |
| ] as const; | |
| export type SnippetInferenceProvider = (typeof INFERENCE_PROVIDERS)[number] | string; | |
| export const HF_HUB_INFERENCE_PROXY_TEMPLATE = `https://router.huggingface.co/{{PROVIDER}}`; | |
| /** | |
| * URL to set as baseUrl in the OpenAI SDK. | |
| * | |
| * TODO(Expose this from InferenceClient in the future?) | |
| */ | |
| export function openAIbaseUrl(provider: SnippetInferenceProvider): string { | |
| const url = HF_HUB_INFERENCE_PROXY_TEMPLATE.replace("{{PROVIDER}}", provider); | |
| return provider === "hf-inference" ? `${url}/v1` : url; | |
| } | |