From 7258222e52434204400b04aff0be3851da671196 Mon Sep 17 00:00:00 2001 From: Guilherme Soubihe Date: Thu, 22 Jan 2026 17:32:56 -0300 Subject: [PATCH] feat(inference): Add Latitude as inference provider Latitude provides fast, affordable LLM inference on dedicated GPU infrastructure. Supported tasks: - conversational (chat completions) - text-generation (completions) Features: - OpenAI-compatible API - Tool calling / function calling - Structured output (JSON mode) - Vision / multimodal inputs - Streaming with TTFT tracking Provider details: - Organization: https://huggingface.co/latitude-sh - API Base: https://api.lsh.ai - Pricing: https://api.lsh.ai/pricing --- .../inference/src/lib/getProviderHelper.ts | 5 ++++ packages/inference/src/providers/consts.ts | 1 + packages/inference/src/providers/latitude.ts | 30 +++++++++++++++++++ packages/inference/src/types.ts | 2 ++ 4 files changed, 38 insertions(+) create mode 100644 packages/inference/src/providers/latitude.ts diff --git a/packages/inference/src/lib/getProviderHelper.ts b/packages/inference/src/lib/getProviderHelper.ts index 28e0eb2ad0..89f45f0e57 100644 --- a/packages/inference/src/lib/getProviderHelper.ts +++ b/packages/inference/src/lib/getProviderHelper.ts @@ -9,6 +9,7 @@ import * as Fireworks from "../providers/fireworks-ai.js"; import * as Groq from "../providers/groq.js"; import * as HFInference from "../providers/hf-inference.js"; import * as Hyperbolic from "../providers/hyperbolic.js"; +import * as Latitude from "../providers/latitude.js"; import * as Nebius from "../providers/nebius.js"; import * as Novita from "../providers/novita.js"; import * as Nscale from "../providers/nscale.js"; @@ -132,6 +133,10 @@ export const PROVIDERS: Record Latitude model ID here: + * + * https://huggingface.co/api/partners/latitude-sh/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 Latitude 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 Latitude, please open an issue on the present repo + * and we will tag Latitude team members. + * + * Thanks! + */ + +import { BaseConversationalTask, BaseTextGenerationTask } from "./providerHelper.js"; + +export class LatitudeConversationalTask extends BaseConversationalTask { + constructor() { + super("latitude-sh", "https://api.lsh.ai"); + } +} + +export class LatitudeTextGenerationTask extends BaseTextGenerationTask { + constructor() { + super("latitude-sh", "https://api.lsh.ai"); + } +} diff --git a/packages/inference/src/types.ts b/packages/inference/src/types.ts index 1d41ce8c96..5924db32a7 100644 --- a/packages/inference/src/types.ts +++ b/packages/inference/src/types.ts @@ -56,6 +56,7 @@ export const INFERENCE_PROVIDERS = [ "groq", "hf-inference", "hyperbolic", + "latitude-sh", "nebius", "novita", "nscale", @@ -93,6 +94,7 @@ export const PROVIDERS_HUB_ORGS: Record = { groq: "groq", "hf-inference": "hf-inference", hyperbolic: "Hyperbolic", + "latitude-sh": "latitude-sh", nebius: "nebius", novita: "novita", nscale: "nscale",