UNPKG

infomaniak-ai-provider

Version:

> the project is under active development, for now only text and embedding models are supported.

1 lines 13.5 kB
{"version":3,"sources":["../../src/infomaniak-models.ts","../../src/infomaniak-models-data.json","../../src/client/index.ts"],"sourcesContent":["// Generated types for Infomaniak AI Models\n// Last updated: 2025-08-15T09:46:17.385Z\n// Do not change this file, it will be regenerated automatically\n\nexport type ModelType = 'stt' | 'llm' | 'image' | 'embedding'\n\nexport type InfoStatus = 'ready' | 'coming_soon' | (string & {})\n\n// Model ID unions by type\nexport type InfomaniakSTTModelId\n = | 'whisper'\n | 'whisperV2'\n | (string & {})\n\nexport type InfomaniakChatModelId\n = | 'llama3'\n | 'granite'\n | 'reasoning'\n | 'mistral24b'\n | 'mistral3'\n | 'qwen3'\n | 'gemma3n'\n | (string & {})\n\nexport type InfomaniakImageModelId\n = | 'photomaker'\n | 'flux'\n | (string & {})\n\nexport type InfomaniakEmbeddingModelId\n = | 'bge_multilingual_gemma2'\n | 'mini_lm_l12_v2'\n | (string & {})\n\n// All model IDs union\nexport type InfomaniakModelId\n = | InfomaniakSTTModelId\n | InfomaniakChatModelId\n | InfomaniakImageModelId\n | InfomaniakEmbeddingModelId\n\nexport interface InfomaniakModel {\n description: string\n documentation_link: string\n id: number\n info_status: InfoStatus\n last_updated_at: string\n logo_url: string\n max_token_input: number | null\n name: string\n type: ModelType\n version: string\n}\n\nexport type InfomaniakModels = InfomaniakModel[]\n\n// Model name constants for easy access\nexport const MODEL_NAMES = {\n WHISPER: 'whisper' as const,\n LLAMA3: 'llama3' as const,\n PHOTOMAKER: 'photomaker' as const,\n WHISPERV2: 'whisperV2' as const,\n FLUX: 'flux' as const,\n GRANITE: 'granite' as const,\n BGE_MULTILINGUAL_GEMMA2: 'bge_multilingual_gemma2' as const,\n MINI_LM_L12_V2: 'mini_lm_l12_v2' as const,\n REASONING: 'reasoning' as const,\n MISTRAL24B: 'mistral24b' as const,\n MISTRAL3: 'mistral3' as const,\n QWEN3: 'qwen3' as const,\n GEMMA3N: 'gemma3n' as const,\n} as const\n\n// Helper functions\nexport function getModelsByType<T extends ModelType>(models: InfomaniakModels, type: T): InfomaniakModel[] {\n return models.filter(model => model.type === type)\n}\n\nexport function getReadyModels(models: InfomaniakModels): InfomaniakModels {\n return models.filter(model => model.info_status === 'ready')\n}\n\nexport function getTranscriptionModels(models: InfomaniakModels): InfomaniakModels {\n return getModelsByType(models, 'stt')\n}\n\nexport function getChatModels(models: InfomaniakModels): InfomaniakModels {\n return getModelsByType(models, 'llm')\n}\n\nexport function getImageModels(models: InfomaniakModels): InfomaniakModels {\n return getModelsByType(models, 'image')\n}\n\nexport function getEmbeddingModels(models: InfomaniakModels): InfomaniakModels {\n return getModelsByType(models, 'embedding')\n}\n","[\n {\n \"id\": 2,\n \"name\": \"whisper\",\n \"type\": \"stt\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/audio/transcriptions\",\n \"description\": \"Whisper V3\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/whisper.svg\",\n \"last_updated_at\": \"2024-07-01\",\n \"max_token_input\": null,\n \"version\": \"3.0\"\n },\n {\n \"id\": 6,\n \"name\": \"llama3\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"Llama 3.3\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/llama3.svg\",\n \"last_updated_at\": \"2024-07-01\",\n \"max_token_input\": 100000,\n \"version\": \"0.1\"\n },\n {\n \"id\": 8,\n \"name\": \"photomaker\",\n \"type\": \"image\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/images/generations/photo_maker\",\n \"description\": \"Photomaker V2\",\n \"info_status\": \"coming_soon\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/photomaker.svg\",\n \"last_updated_at\": \"2024-07-15\",\n \"max_token_input\": null,\n \"version\": \"2.0\"\n },\n {\n \"id\": 9,\n \"name\": \"whisperV2\",\n \"type\": \"stt\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/audio/transcriptions\",\n \"description\": \"Whisper V2\",\n \"info_status\": \"coming_soon\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/whisper.svg\",\n \"last_updated_at\": \"2024-07-01\",\n \"max_token_input\": null,\n \"version\": \"2.0\"\n },\n {\n \"id\": 10,\n \"name\": \"flux\",\n \"type\": \"image\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/images/generations\",\n \"description\": \"Flux schnell\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/flux.svg\",\n \"last_updated_at\": \"2024-10-01\",\n \"max_token_input\": null,\n \"version\": \"0.1\"\n },\n {\n \"id\": 11,\n \"name\": \"granite\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"granite-3.1-8b\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/granite.svg\",\n \"last_updated_at\": \"2024-12-04\",\n \"max_token_input\": 128000,\n \"version\": \"3.1\"\n },\n {\n \"id\": 12,\n \"name\": \"bge_multilingual_gemma2\",\n \"type\": \"embedding\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/v1/embeddings\",\n \"description\": \"Bge Multilingual Gemma2\",\n \"info_status\": \"coming_soon\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/bge.svg\",\n \"last_updated_at\": \"2024-12-04\",\n \"max_token_input\": 8000,\n \"version\": \"1.0\"\n },\n {\n \"id\": 13,\n \"name\": \"mini_lm_l12_v2\",\n \"type\": \"embedding\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/v1/embeddings\",\n \"description\": \"All MiniLM L12 v2\",\n \"info_status\": \"coming_soon\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/minilm.svg\",\n \"last_updated_at\": \"2024-12-04\",\n \"max_token_input\": 128,\n \"version\": \"2.0\"\n },\n {\n \"id\": 14,\n \"name\": \"reasoning\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"DeepSeek-R1-distilled-qwen-32B\",\n \"info_status\": \"coming_soon\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/deepseek.svg\",\n \"last_updated_at\": \"2025-01-27\",\n \"max_token_input\": 128000,\n \"version\": \"1.0\"\n },\n {\n \"id\": 15,\n \"name\": \"mistral24b\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"Mistral-Small-24B-Instruct-2501\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/mixtral.svg\",\n \"last_updated_at\": \"2025-03-11\",\n \"max_token_input\": 32000,\n \"version\": \"1.0\"\n },\n {\n \"id\": 16,\n \"name\": \"mistral3\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"Mistral-Small-3.2-24B-Instruct-2506\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/mixtral.svg\",\n \"last_updated_at\": \"2025-07-03\",\n \"max_token_input\": 128000,\n \"version\": \"3.2\"\n },\n {\n \"id\": 17,\n \"name\": \"qwen3\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"Qwen3-235B-A22B-Instruct-2507\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/qwen.svg\",\n \"last_updated_at\": \"2025-07-30\",\n \"max_token_input\": 262144,\n \"version\": \"3\"\n },\n {\n \"id\": 18,\n \"name\": \"gemma3n\",\n \"type\": \"llm\",\n \"documentation_link\": \"https://developer.infomaniak.com/docs/api/post/1/ai/%7Bproduct_id%7D/openai/chat/completions\",\n \"description\": \"Gemma-3n-E4B-it\",\n \"info_status\": \"ready\",\n \"logo_url\": \"https://storage4.infomaniak.com/ai-tools/public/logos/gemma.svg\",\n \"last_updated_at\": \"2025-07-30\",\n \"max_token_input\": 32000,\n \"version\": \"3\"\n }\n]\n","import type { InfomaniakModel as InfomaniakApiModel } from '../infomaniak-models'\nimport { getChatModels, getEmbeddingModels, getImageModels, getTranscriptionModels } from '../infomaniak-models'\nimport modelData from '../infomaniak-models-data.json'\n\ninterface InfomaniakModel {\n name: string\n type: string\n id: string\n version: string\n maxTokenInput: number | null\n lastUpdatedAt: string\n status: string\n}\n\nconst _models = modelData as InfomaniakApiModel[]\n\nexport function useInfomaniakModels() {\n function toClientModel(model: InfomaniakApiModel): InfomaniakModel {\n return {\n name: model.description,\n type: model.type,\n id: model.name,\n version: model.version,\n maxTokenInput: model.max_token_input,\n lastUpdatedAt: model.last_updated_at,\n status: model.info_status,\n }\n }\n\n return {\n chatModels: getChatModels(_models).map(toClientModel),\n embeddingModels: getEmbeddingModels(_models).map(toClientModel),\n imageModels: getImageModels(_models).map(toClientModel),\n transcriptionModels: getTranscriptionModels(_models).map(toClientModel),\n models: _models.map(toClientModel),\n }\n}\n\nexport type { InfomaniakModel }\n"],"mappings":";AA0EO,SAAS,gBAAqC,QAA0B,MAA4B;AACzG,SAAO,OAAO,OAAO,WAAS,MAAM,SAAS,IAAI;AACnD;AAM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