Skip to content

Commit

Permalink
Make compile
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c committed Feb 7, 2025
1 parent 31cf25c commit 179c84d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 42 deletions.
1 change: 1 addition & 0 deletions packages/inference/src/providers/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const HARDCODED_MODEL_ID_MAPPING: Record<InferenceProvider, Record<ModelI
"fal-ai": {},
"fireworks-ai": {},
"hf-inference": {},
hyperbolic: {},
nebius: {},
replicate: {},
sambanova: {},
Expand Down
56 changes: 14 additions & 42 deletions packages/inference/src/providers/hyperbolic.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,18 @@
import type { ProviderMapping } from "./types";

export const HYPERBOLIC_API_BASE_URL = "https://api.hyperbolic.xyz";

type HyperbolicId = string;

/**
* https://docs.together.ai/reference/models-1
* See the registered mapping of HF model ID => Hyperbolic model ID here:
*
* https://huggingface.co/api/partners/hyperbolic/models
*
* This is a publicly available mapping.
*
* If you want to try to run inference for a new model locally before it's registered on huggingface.co,
* you can add it to the dictionary "HARDCODED_MODEL_ID_MAPPING" in consts.ts, for dev purposes.
*
* - If you work at Hyperbolic and want to update this mapping, please use the model mapping API we provide on huggingface.co
* - If you're a community member and want to add a new supported HF model to Hyperbolic, please open an issue on the present repo
* and we will tag Hyperbolic team members.
*
* Thanks!
*/
export const HYPERBOLIC_SUPPORTED_MODEL_IDS: ProviderMapping<HyperbolicId> = {
"text-to-image": {
"black-forest-labs/FLUX.1-dev": "black-forest-labs/FLUX.1-dev",
"stabilityai/stable-diffusion-xl-base-1.0": "SDXL1.0-base",
"stable-diffusion-v1-5/stable-diffusion-v1-5": "stable-diffusion-v1-5/stable-diffusion-v1-5",
"segmind/SSD-1B": "segmind/SSD-1B",
"stabilityai/stable-diffusion-2": "stabilityai/stable-diffusion-2",
"stabilityai/sdxl-turbo": "stabilityai/sdxl-turbo",
},
"image-text-to-text": {
"Qwen/Qwen2-VL-72B-Instruct": "Qwen/Qwen2-VL-72B-Instruct",
"mistralai/Pixtral-12B-2409": "mistralai/Pixtral-12B-2409",
"Qwen/Qwen2-VL-7B-Instruct": "Qwen/Qwen2-VL-7B-Instruct",
},
"text-generation": {
"meta-llama/Llama-3.1-405B-BASE-BF16": "meta-llama/Llama-3.1-405B-BASE-BF16",
"meta-llama/Llama-3.1-405B-BASE-FP8": "meta-llama/Llama-3.1-405B-BASE-FP8",
"Qwen/Qwen2.5-72B-Instruct": "Qwen/Qwen2.5-72B-Instruct-BF16",
},
"text-to-audio": {
"myshell-ai/MeloTTS-English-v3": "myshell-ai/MeloTTS-English-v3",
},
conversational: {
"deepseek-ai/DeepSeek-R1": "deepseek-ai/DeepSeek-R1",
"deepseek-ai/DeepSeek-R1-Zero": "deepseek-ai/DeepSeek-R1-Zero",
"deepseek-ai/DeepSeek-V3": "deepseek-ai/DeepSeek-V3",
"meta-llama/Llama-3.2-3B-Instruct": "meta-llama/Llama-3.2-3B-Instruct",
"meta-llama/Llama-3.3-70B-Instruct": "meta-llama/Llama-3.3-70B-Instruct",
"meta-llama/Llama-3.1-70B-Instruct": "meta-llama/Llama-3.1-70B-Instruct-BF16",
"meta-llama/Meta-Llama-3-70B-Instruct": "meta-llama/Llama-3-70b-BF16",
"meta-llama/Llama-3.1-8B-Instruct": "meta-llama/Llama-3.1-8B-Instruct-BF16",
"NousResearch/Hermes-3-Llama-3.1-70B": "NousResearch/Hermes-3-Llama-3.1-70B-BF16",
"Qwen/Qwen2.5-72B-Instruct": "Qwen/Qwen2.5-72B-Instruct-BF16",
"Qwen/Qwen2.5-Coder-32B-Instruct": "Qwen/Qwen2.5-Coder-32B-Instruct-BF16",
"Qwen/QwQ-32B-Preview": "Qwen/QwQ-32B-Preview-BF16",
},
};
7 changes: 7 additions & 0 deletions packages/inference/test/HfInference.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,13 @@ describe.concurrent("HfInference", () => {
() => {
const client = new HfInference(env.HF_HYPERBOLIC_KEY);

HARDCODED_MODEL_ID_MAPPING.hyperbolic = {
"meta-llama/Llama-3.2-3B-Instruct": "meta-llama/Llama-3.2-3B-Instruct",
"meta-llama/Llama-3.3-70B-Instruct": "meta-llama/Llama-3.3-70B-Instruct",
"stabilityai/stable-diffusion-2": "stabilityai/stable-diffusion-2",
"meta-llama/Llama-3.1-405B-BASE-FP8": "meta-llama/Llama-3.1-405B-BASE-FP8",
};

it("chatCompletion - hyperbolic", async () => {
const res = await client.chatCompletion({
model: "meta-llama/Llama-3.2-3B-Instruct",
Expand Down

0 comments on commit 179c84d

Please sign in to comment.