@aeye/models 0.4.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReplicateScrape.md +290 -290
- package/aeye-models.md +278 -272
- package/dist/scripts/codegen.js +48 -48
- package/dist/scripts/scrapers/openrouter.js +2 -2
- package/dist/scripts/scrapers/replicate.js +140 -140
- package/package.json +78 -78
- package/scripts/codegen.ts +133 -133
- package/scripts/patch-modelinfo.ts +139 -139
- package/scripts/scrape.ts +190 -190
- package/scripts/scrapers/__tests__/aws.test.ts +86 -86
- package/scripts/scrapers/aws.ts +276 -276
- package/scripts/scrapers/docs.ts +101 -101
- package/scripts/scrapers/extract.md +270 -270
- package/scripts/scrapers/openai.ts +252 -252
- package/scripts/scrapers/openrouter.ts +131 -131
- package/scripts/scrapers/replicate.ts +1144 -1144
- package/scripts/tsconfig.json +25 -25
- package/src/index.ts +12 -12
- package/src/models/aws.ts +2569 -2569
- package/src/models/openai.ts +2764 -2764
- package/src/models/openrouter.ts +19708 -19708
- package/src/models/replicate.ts +9101 -9101
- package/src/strict-support.ts +134 -134
- package/src/transformers/index.ts +25 -25
- package/src/transformers/replicate/abiruyt-text-extract-ocr.ts +31 -31
- package/src/transformers/replicate/adidoes-whisperx-video-transcribe.ts +36 -36
- package/src/transformers/replicate/adirik-e5-mistral-7b-instruct.ts +39 -39
- package/src/transformers/replicate/adirik-kosmos-g.ts +47 -47
- package/src/transformers/replicate/adirik-owlvit-base-patch32.ts +34 -34
- package/src/transformers/replicate/adirik-realvisxl-v3-0-turbo.ts +84 -84
- package/src/transformers/replicate/adirik-styletts2.ts +41 -41
- package/src/transformers/replicate/adirik-udop-large.ts +22 -22
- package/src/transformers/replicate/afiaka87-tortoise-tts.ts +30 -30
- package/src/transformers/replicate/ai-forever-kandinsky-2-2.ts +53 -53
- package/src/transformers/replicate/ai-forever-kandinsky-2.ts +61 -61
- package/src/transformers/replicate/alexgenovese-upscaler.ts +28 -28
- package/src/transformers/replicate/andreasjansson-blip-2.ts +37 -37
- package/src/transformers/replicate/andreasjansson-clip-features.ts +31 -31
- package/src/transformers/replicate/andreasjansson-llama-2-13b-embeddings.ts +32 -32
- package/src/transformers/replicate/andreasjansson-musicgen-looper.ts +68 -68
- package/src/transformers/replicate/anthropic-claude-3-5-sonnet.ts +70 -70
- package/src/transformers/replicate/anthropic-claude-3-7-sonnet.ts +63 -63
- package/src/transformers/replicate/anthropic-claude-4-sonnet.ts +77 -77
- package/src/transformers/replicate/arielreplicate-deoldify_image.ts +29 -29
- package/src/transformers/replicate/awerks-neon-tts.ts +27 -27
- package/src/transformers/replicate/awilliamson10-meta-nougat.ts +25 -25
- package/src/transformers/replicate/beautyyuyanli-multilingual-e5-large.ts +30 -30
- package/src/transformers/replicate/black-forest-labs-flux-1-1-pro-ultra.ts +46 -46
- package/src/transformers/replicate/black-forest-labs-flux-1-1-pro.ts +61 -61
- package/src/transformers/replicate/black-forest-labs-flux-2-dev.ts +73 -73
- package/src/transformers/replicate/black-forest-labs-flux-2-flex.ts +50 -50
- package/src/transformers/replicate/black-forest-labs-flux-2-pro.ts +66 -66
- package/src/transformers/replicate/black-forest-labs-flux-canny-dev.ts +50 -50
- package/src/transformers/replicate/black-forest-labs-flux-canny-pro.ts +46 -46
- package/src/transformers/replicate/black-forest-labs-flux-depth-dev.ts +39 -39
- package/src/transformers/replicate/black-forest-labs-flux-depth-pro.ts +34 -34
- package/src/transformers/replicate/black-forest-labs-flux-dev-lora.ts +63 -63
- package/src/transformers/replicate/black-forest-labs-flux-dev.ts +54 -54
- package/src/transformers/replicate/black-forest-labs-flux-fill-dev.ts +43 -43
- package/src/transformers/replicate/black-forest-labs-flux-fill-pro.ts +41 -41
- package/src/transformers/replicate/black-forest-labs-flux-kontext-dev.ts +36 -36
- package/src/transformers/replicate/black-forest-labs-flux-kontext-max.ts +45 -45
- package/src/transformers/replicate/black-forest-labs-flux-kontext-pro.ts +45 -45
- package/src/transformers/replicate/black-forest-labs-flux-pro-finetuned.ts +69 -69
- package/src/transformers/replicate/black-forest-labs-flux-pro-trainer.ts +39 -39
- package/src/transformers/replicate/black-forest-labs-flux-pro.ts +77 -77
- package/src/transformers/replicate/black-forest-labs-flux-redux-dev.ts +46 -46
- package/src/transformers/replicate/black-forest-labs-flux-redux-schnell.ts +39 -39
- package/src/transformers/replicate/black-forest-labs-flux-schnell.ts +40 -40
- package/src/transformers/replicate/bria-eraser.ts +35 -35
- package/src/transformers/replicate/bria-expand-image.ts +40 -40
- package/src/transformers/replicate/bria-fibo.ts +45 -45
- package/src/transformers/replicate/bria-generate-background.ts +41 -41
- package/src/transformers/replicate/bria-genfill.ts +48 -48
- package/src/transformers/replicate/bria-image-3-2.ts +33 -33
- package/src/transformers/replicate/bria-increase-resolution.ts +32 -32
- package/src/transformers/replicate/bytedance-bagel.ts +74 -74
- package/src/transformers/replicate/bytedance-dolphin.ts +36 -36
- package/src/transformers/replicate/bytedance-flux-pulid.ts +82 -82
- package/src/transformers/replicate/bytedance-pulid.ts +78 -78
- package/src/transformers/replicate/bytedance-sdxl-lightning-4step.ts +55 -55
- package/src/transformers/replicate/bytedance-seededit-3-0.ts +31 -31
- package/src/transformers/replicate/bytedance-seedream-3.ts +52 -52
- package/src/transformers/replicate/bytedance-seedream-4.ts +59 -59
- package/src/transformers/replicate/camenduru-metavoice.ts +28 -28
- package/src/transformers/replicate/center-for-curriculum-redesign-bge_1-5_query_embeddings.ts +35 -35
- package/src/transformers/replicate/chenxwh-openvoice.ts +40 -40
- package/src/transformers/replicate/chigozienri-mediapipe-face.ts +31 -31
- package/src/transformers/replicate/cjwbw-bigcolor.ts +42 -42
- package/src/transformers/replicate/cjwbw-canary-1b.ts +22 -22
- package/src/transformers/replicate/cjwbw-cogvlm.ts +35 -35
- package/src/transformers/replicate/cjwbw-docentr.ts +37 -37
- package/src/transformers/replicate/cjwbw-face-align-cog.ts +35 -35
- package/src/transformers/replicate/cjwbw-internlm-xcomposer.ts +29 -29
- package/src/transformers/replicate/cjwbw-night-enhancement.ts +35 -35
- package/src/transformers/replicate/cjwbw-parler-tts.ts +28 -28
- package/src/transformers/replicate/cjwbw-real-esrgan.ts +28 -28
- package/src/transformers/replicate/cjwbw-rudalle-sr.ts +37 -37
- package/src/transformers/replicate/cjwbw-seamless_communication.ts +83 -83
- package/src/transformers/replicate/cjwbw-supir-v0f.ts +45 -45
- package/src/transformers/replicate/cjwbw-supir-v0q.ts +44 -44
- package/src/transformers/replicate/cjwbw-supir.ts +47 -47
- package/src/transformers/replicate/cjwbw-voicecraft.ts +62 -62
- package/src/transformers/replicate/cjwbw-vqfr.ts +39 -39
- package/src/transformers/replicate/codeplugtech-object_remover.ts +31 -31
- package/src/transformers/replicate/codeslake-ifan-defocus-deblur.ts +35 -35
- package/src/transformers/replicate/comfyui-any-comfyui-workflow.ts +41 -41
- package/src/transformers/replicate/cswry-seesr.ts +39 -39
- package/src/transformers/replicate/cudanexus-ocr-surya.ts +44 -44
- package/src/transformers/replicate/curt-park-sentiment-analysis.ts +39 -39
- package/src/transformers/replicate/cuuupid-glm-4v-9b.ts +61 -61
- package/src/transformers/replicate/cuuupid-gte-qwen2-7b-instruct.ts +32 -32
- package/src/transformers/replicate/cuuupid-marker.ts +37 -37
- package/src/transformers/replicate/daanelson-imagebind.ts +45 -45
- package/src/transformers/replicate/daanelson-minigpt-4.ts +37 -37
- package/src/transformers/replicate/daanelson-whisperx.ts +39 -39
- package/src/transformers/replicate/datacte-proteus-v0-2.ts +85 -85
- package/src/transformers/replicate/datacte-proteus-v0-3.ts +77 -77
- package/src/transformers/replicate/datalab-to-marker.ts +63 -63
- package/src/transformers/replicate/datalab-to-ocr.ts +51 -51
- package/src/transformers/replicate/easel-advanced-face-swap.ts +35 -35
- package/src/transformers/replicate/easel-ai-avatars.ts +50 -50
- package/src/transformers/replicate/fermatresearch-high-resolution-controlnet-tile.ts +45 -45
- package/src/transformers/replicate/fermatresearch-magic-image-refiner.ts +53 -53
- package/src/transformers/replicate/fermatresearch-magic-style-transfer.ts +58 -58
- package/src/transformers/replicate/fermatresearch-sdxl-controlnet-lora.ts +58 -58
- package/src/transformers/replicate/fermatresearch-spanish-f5-tts.ts +36 -36
- package/src/transformers/replicate/fewjative-ultimate-sd-upscale.ts +55 -55
- package/src/transformers/replicate/flux-kontext-apps-change-haircut.ts +39 -39
- package/src/transformers/replicate/flux-kontext-apps-multi-image-kontext-max.ts +65 -65
- package/src/transformers/replicate/flux-kontext-apps-multi-image-kontext-pro.ts +65 -65
- package/src/transformers/replicate/flux-kontext-apps-multi-image-list.ts +54 -54
- package/src/transformers/replicate/flux-kontext-apps-professional-headshot.ts +37 -37
- package/src/transformers/replicate/flux-kontext-apps-restore-image.ts +31 -31
- package/src/transformers/replicate/fofr-become-image.ts +39 -39
- package/src/transformers/replicate/fofr-color-matcher.ts +36 -36
- package/src/transformers/replicate/fofr-deprecated-batch-image-captioning.ts +54 -54
- package/src/transformers/replicate/fofr-face-swap-with-ideogram.ts +28 -28
- package/src/transformers/replicate/fofr-face-to-many.ts +47 -47
- package/src/transformers/replicate/fofr-face-to-sticker.ts +40 -40
- package/src/transformers/replicate/fofr-latent-consistency-model.ts +79 -79
- package/src/transformers/replicate/fofr-prompt-classifier.ts +53 -53
- package/src/transformers/replicate/fofr-sdxl-emoji.ts +92 -92
- package/src/transformers/replicate/fofr-sdxl-multi-controlnet-lora.ts +110 -110
- package/src/transformers/replicate/fofr-sticker-maker.ts +54 -54
- package/src/transformers/replicate/georgedavila-bart-large-mnli-classifier.ts +36 -36
- package/src/transformers/replicate/google-gemini-2-5-flash.ts +90 -90
- package/src/transformers/replicate/google-gemini-3-pro.ts +91 -91
- package/src/transformers/replicate/google-imagen-3-fast.ts +32 -32
- package/src/transformers/replicate/google-imagen-3.ts +34 -34
- package/src/transformers/replicate/google-imagen-4-fast.ts +32 -32
- package/src/transformers/replicate/google-imagen-4-ultra.ts +32 -32
- package/src/transformers/replicate/google-imagen-4.ts +32 -32
- package/src/transformers/replicate/google-lyria-2.ts +28 -28
- package/src/transformers/replicate/google-nano-banana.ts +41 -41
- package/src/transformers/replicate/google-research-maxim.ts +38 -38
- package/src/transformers/replicate/google-upscaler.ts +29 -29
- package/src/transformers/replicate/grandlineai-instant-id-artistic.ts +61 -61
- package/src/transformers/replicate/grandlineai-instant-id-photorealistic.ts +35 -35
- package/src/transformers/replicate/ibm-granite-granite-embedding-278m-multilingual.ts +28 -28
- package/src/transformers/replicate/ideogram-ai-ideogram-character.ts +66 -66
- package/src/transformers/replicate/ideogram-ai-ideogram-v2-turbo.ts +51 -51
- package/src/transformers/replicate/ideogram-ai-ideogram-v2.ts +53 -53
- package/src/transformers/replicate/ideogram-ai-ideogram-v2a-turbo.ts +52 -52
- package/src/transformers/replicate/ideogram-ai-ideogram-v2a.ts +50 -50
- package/src/transformers/replicate/ideogram-ai-ideogram-v3-balanced.ts +82 -82
- package/src/transformers/replicate/ideogram-ai-ideogram-v3-quality.ts +77 -77
- package/src/transformers/replicate/ideogram-ai-ideogram-v3-turbo.ts +77 -77
- package/src/transformers/replicate/index.ts +612 -612
- package/src/transformers/replicate/j-min-clip-caption-reward.ts +38 -38
- package/src/transformers/replicate/jaaari-kokoro-82m.ts +31 -31
- package/src/transformers/replicate/jagilley-controlnet-scribble.ts +39 -39
- package/src/transformers/replicate/jingyunliang-hcflow-sr.ts +37 -37
- package/src/transformers/replicate/jingyunliang-swinir.ts +42 -42
- package/src/transformers/replicate/joehoover-instructblip-vicuna13b.ts +27 -27
- package/src/transformers/replicate/joehoover-mplug-owl.ts +24 -24
- package/src/transformers/replicate/juergengunz-ultimate-portrait-upscale.ts +55 -55
- package/src/transformers/replicate/krthr-clip-embeddings.ts +46 -46
- package/src/transformers/replicate/kshitijagrwl-pii-extractor-llm.ts +40 -40
- package/src/transformers/replicate/leonardoai-lucid-origin.ts +36 -36
- package/src/transformers/replicate/lucataco-ace-step.ts +41 -41
- package/src/transformers/replicate/lucataco-bakllava.ts +31 -31
- package/src/transformers/replicate/lucataco-codeformer.ts +33 -33
- package/src/transformers/replicate/lucataco-controlnet-tile.ts +34 -34
- package/src/transformers/replicate/lucataco-csm-1b.ts +40 -40
- package/src/transformers/replicate/lucataco-deepseek-ocr.ts +33 -33
- package/src/transformers/replicate/lucataco-demofusion-enhance.ts +43 -43
- package/src/transformers/replicate/lucataco-dreamshaper-xl-turbo.ts +55 -55
- package/src/transformers/replicate/lucataco-florence-2-base.ts +45 -45
- package/src/transformers/replicate/lucataco-fuyu-8b.ts +31 -31
- package/src/transformers/replicate/lucataco-gpt-oss-safeguard-20b.ts +50 -50
- package/src/transformers/replicate/lucataco-ip-adapter-faceid.ts +75 -75
- package/src/transformers/replicate/lucataco-ip_adapter-face-inpaint.ts +48 -48
- package/src/transformers/replicate/lucataco-ip_adapter-sdxl-face.ts +52 -52
- package/src/transformers/replicate/lucataco-llama-3-vision-alpha.ts +32 -32
- package/src/transformers/replicate/lucataco-magnet.ts +44 -44
- package/src/transformers/replicate/lucataco-modelscope-facefusion.ts +46 -46
- package/src/transformers/replicate/lucataco-moondream2.ts +32 -32
- package/src/transformers/replicate/lucataco-nomic-embed-text-v1.ts +28 -28
- package/src/transformers/replicate/lucataco-ollama-llama3-2-vision-11b.ts +37 -37
- package/src/transformers/replicate/lucataco-ollama-llama3-2-vision-90b.ts +47 -47
- package/src/transformers/replicate/lucataco-omnigen2.ts +43 -43
- package/src/transformers/replicate/lucataco-open-dalle-v1-1.ts +81 -81
- package/src/transformers/replicate/lucataco-orpheus-3b-0-1-ft.ts +38 -38
- package/src/transformers/replicate/lucataco-pasd-magnify.ts +35 -35
- package/src/transformers/replicate/lucataco-pheme.ts +33 -33
- package/src/transformers/replicate/lucataco-qwen-vl-chat.ts +30 -30
- package/src/transformers/replicate/lucataco-qwen2-5-omni-7b.ts +78 -78
- package/src/transformers/replicate/lucataco-qwen2-vl-7b-instruct.ts +43 -43
- package/src/transformers/replicate/lucataco-realistic-vision-v5-1.ts +50 -50
- package/src/transformers/replicate/lucataco-sdxl-clip-interrogator.ts +29 -29
- package/src/transformers/replicate/lucataco-smolvlm-instruct.ts +38 -38
- package/src/transformers/replicate/lucataco-snowflake-arctic-embed-l.ts +30 -30
- package/src/transformers/replicate/lucataco-ssd-1b.ts +76 -76
- package/src/transformers/replicate/lucataco-stable-diffusion-x4-upscaler.ts +30 -30
- package/src/transformers/replicate/lucataco-xtts-v2.ts +42 -42
- package/src/transformers/replicate/lucataco-xtts-v2.ts.invalid +31 -31
- package/src/transformers/replicate/luma-photon-flash.ts +47 -47
- package/src/transformers/replicate/luma-photon.ts +35 -35
- package/src/transformers/replicate/m1guelpf-whisper-subtitles.ts +46 -46
- package/src/transformers/replicate/mark3labs-embeddings-gte-base.ts +31 -31
- package/src/transformers/replicate/megvii-research-nafnet.ts +39 -39
- package/src/transformers/replicate/meta-musicgen.ts +53 -53
- package/src/transformers/replicate/methexis-inc-img2prompt.ts +43 -43
- package/src/transformers/replicate/mickeybeurskens-latex-ocr.ts +27 -27
- package/src/transformers/replicate/microsoft-bringing-old-photos-back-to-life.ts +38 -38
- package/src/transformers/replicate/minimax-image-01.ts +39 -39
- package/src/transformers/replicate/minimax-music-01.ts +35 -35
- package/src/transformers/replicate/minimax-music-1-5.ts +35 -35
- package/src/transformers/replicate/minimax-speech-02-hd.ts +52 -52
- package/src/transformers/replicate/minimax-speech-02-turbo.ts +52 -52
- package/src/transformers/replicate/minimax-voice-cloning.ts +36 -36
- package/src/transformers/replicate/mv-lab-instructir.ts +30 -30
- package/src/transformers/replicate/mv-lab-swin2sr.ts +37 -37
- package/src/transformers/replicate/nateraw-bge-large-en-v1-5.ts +37 -37
- package/src/transformers/replicate/nateraw-jina-embeddings-v2-base-en.ts +22 -22
- package/src/transformers/replicate/nicknaskida-whisper-diarization.ts +53 -53
- package/src/transformers/replicate/nightmareai-latent-sr.ts +40 -40
- package/src/transformers/replicate/nightmareai-real-esrgan.ts +28 -28
- package/src/transformers/replicate/nohamoamary-image-captioning-with-visual-attention.ts +29 -29
- package/src/transformers/replicate/nvidia-parakeet-rnnt-1-1b.ts +26 -26
- package/src/transformers/replicate/nvidia-sana-sprint-1-6b.ts +49 -49
- package/src/transformers/replicate/nvidia-sana.ts +62 -62
- package/src/transformers/replicate/openai-gpt-4-1-mini.ts +65 -65
- package/src/transformers/replicate/openai-gpt-4o-mini-transcribe.ts +32 -32
- package/src/transformers/replicate/openai-gpt-4o-mini.ts +72 -72
- package/src/transformers/replicate/openai-gpt-4o-transcribe.ts +36 -36
- package/src/transformers/replicate/openai-gpt-4o.ts +69 -69
- package/src/transformers/replicate/openai-gpt-5.ts +80 -80
- package/src/transformers/replicate/openai-gpt-image-1.ts +60 -60
- package/src/transformers/replicate/openai-whisper.ts +56 -56
- package/src/transformers/replicate/orpatashnik-styleclip.ts +40 -40
- package/src/transformers/replicate/pbevan1-llama-3-1-8b-ocr-correction.ts +56 -56
- package/src/transformers/replicate/pharmapsychotic-clip-interrogator.ts +37 -37
- package/src/transformers/replicate/philz1337x-clarity-upscaler.ts +56 -56
- package/src/transformers/replicate/philz1337x-crystal-upscaler.ts +29 -29
- package/src/transformers/replicate/piddnad-ddcolor.ts +28 -28
- package/src/transformers/replicate/platform-kit-mars5-tts.ts +38 -38
- package/src/transformers/replicate/playgroundai-playground-v2-5-1024px-aesthetic.ts +81 -81
- package/src/transformers/replicate/prunaai-flux-fast.ts +38 -38
- package/src/transformers/replicate/prunaai-flux-kontext-fast.ts +40 -40
- package/src/transformers/replicate/prunaai-hidream-l1-dev.ts +55 -55
- package/src/transformers/replicate/prunaai-hidream-l1-fast.ts +38 -38
- package/src/transformers/replicate/prunaai-hidream-l1-full.ts +61 -61
- package/src/transformers/replicate/prunaai-sdxl-lightning.ts +52 -52
- package/src/transformers/replicate/prunaai-wan-2-2-image.ts +36 -36
- package/src/transformers/replicate/qwen-qwen-image-edit-plus.ts +36 -36
- package/src/transformers/replicate/qwen-qwen-image-edit.ts +35 -35
- package/src/transformers/replicate/qwen-qwen-image.ts +67 -67
- package/src/transformers/replicate/recraft-ai-recraft-creative-upscale.ts +26 -26
- package/src/transformers/replicate/recraft-ai-recraft-crisp-upscale.ts +26 -26
- package/src/transformers/replicate/recraft-ai-recraft-v3-svg.ts +33 -33
- package/src/transformers/replicate/recraft-ai-recraft-v3.ts +33 -33
- package/src/transformers/replicate/replicate-all-mpnet-base-v2.ts +40 -40
- package/src/transformers/replicate/resemble-ai-chatterbox-multilingual.ts +43 -43
- package/src/transformers/replicate/resemble-ai-chatterbox-pro.ts +36 -36
- package/src/transformers/replicate/resemble-ai-chatterbox.ts +41 -41
- package/src/transformers/replicate/resemble-ai-chatterbox.ts.invalid +38 -38
- package/src/transformers/replicate/riffusion-riffusion.ts +35 -35
- package/src/transformers/replicate/rmokady-clip_prefix_caption.ts +47 -47
- package/src/transformers/replicate/runwayml-gen4-image-turbo.ts +34 -34
- package/src/transformers/replicate/runwayml-gen4-image.ts +44 -44
- package/src/transformers/replicate/sakemin-musicgen-chord.ts +46 -46
- package/src/transformers/replicate/sakemin-musicgen-remixer.ts +55 -55
- package/src/transformers/replicate/sakemin-musicgen-stereo-chord.ts +47 -47
- package/src/transformers/replicate/salesforce-blip.ts +46 -46
- package/src/transformers/replicate/sczhou-codeformer.ts +33 -33
- package/src/transformers/replicate/sdxl-based-realvisxl-v3-multi-controlnet-lora.ts +90 -90
- package/src/transformers/replicate/stability-ai-sdxl.ts +69 -69
- package/src/transformers/replicate/stability-ai-stable-audio-2-5.ts +33 -33
- package/src/transformers/replicate/stability-ai-stable-diffusion-3-5-large-turbo.ts +55 -55
- package/src/transformers/replicate/stability-ai-stable-diffusion-3-5-large.ts +73 -73
- package/src/transformers/replicate/stability-ai-stable-diffusion-3-5-medium.ts +47 -47
- package/src/transformers/replicate/stability-ai-stable-diffusion.ts +57 -57
- package/src/transformers/replicate/suno-ai-bark.ts +37 -37
- package/src/transformers/replicate/tencent-hunyuan-image-3.ts +35 -35
- package/src/transformers/replicate/tencentarc-gfpgan.ts +39 -39
- package/src/transformers/replicate/tencentarc-photomaker-style.ts +53 -53
- package/src/transformers/replicate/tencentarc-photomaker.ts +80 -80
- package/src/transformers/replicate/tencentarc-vqfr.ts +39 -39
- package/src/transformers/replicate/thomasmol-whisper-diarization.ts +44 -44
- package/src/transformers/replicate/topazlabs-image-upscale.ts +37 -37
- package/src/transformers/replicate/tstramer-material-diffusion.ts +85 -85
- package/src/transformers/replicate/vaibhavs10-incredibly-fast-whisper.ts +44 -44
- package/src/transformers/replicate/victor-upmeet-whisperx.ts +50 -50
- package/src/transformers/replicate/willywongi-donut.ts +26 -26
- package/src/transformers/replicate/x-lance-f5-tts.ts +47 -47
- package/src/transformers/replicate/xai-grok-4.ts +50 -50
- package/src/transformers/replicate/xinntao-esrgan.ts +35 -35
- package/src/transformers/replicate/yangxy-gpen.ts +41 -41
- package/src/transformers/replicate/yorickvp-llava-13b.ts +55 -55
- package/src/transformers/replicate/yorickvp-llava-v1-6-34b.ts +58 -58
- package/src/transformers/replicate/yorickvp-llava-v1-6-mistral-7b.ts +83 -83
- package/src/transformers/replicate/yorickvp-llava-v1-6-vicuna-13b.ts +108 -108
- package/src/transformers/replicate/zsxkib-aura-sr-v2.ts +32 -32
- package/src/transformers/replicate/zsxkib-aura-sr.ts +30 -30
- package/src/transformers/replicate/zsxkib-blip-3.ts +47 -47
- package/src/transformers/replicate/zsxkib-bsrgan.ts +28 -28
- package/src/transformers/replicate/zsxkib-dia.ts +42 -42
- package/src/transformers/replicate/zsxkib-diffbir.ts +57 -57
- package/src/transformers/replicate/zsxkib-flash-face.ts +47 -47
- package/src/transformers/replicate/zsxkib-flux-music.ts +36 -36
- package/src/transformers/replicate/zsxkib-idefics3.ts +96 -96
- package/src/transformers/replicate/zsxkib-instant-id.ts +58 -58
- package/src/transformers/replicate/zsxkib-jina-clip-v2.ts +47 -47
- package/src/transformers/replicate/zsxkib-molmo-7b.ts +54 -54
- package/src/transformers/replicate/zsxkib-realistic-voice-cloning.ts +54 -54
- package/src/transformers/replicate/zsxkib-seedvr2.ts +38 -38
- package/src/transformers/replicate/zsxkib-step1x-edit.ts +35 -35
- package/src/transformers/replicate/zsxkib-uform-gen.ts +29 -29
- package/src/transformers/replicate/zsyoaoa-invsr.ts +33 -33
- package/tsconfig.json +16 -16
|
@@ -1,252 +1,252 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI Model Scraper
|
|
3
|
-
*
|
|
4
|
-
* Builds model information for every model the API lists from the Markdown
|
|
5
|
-
* versions of OpenAI's docs: each model page (details, pricing, endpoints,
|
|
6
|
-
* features), the pricing page (GPT Image token prices), and the deprecations
|
|
7
|
-
* page (shutdown dates).
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import * as path from 'path';
|
|
11
|
-
import { fileURLToPath } from 'url';
|
|
12
|
-
import { detectTier, type ModelCapability, type ModelInfo, type ModelParameter, type ModelPricing } from '@aeye/ai';
|
|
13
|
-
import type { ReasoningEffort } from '@aeye/core';
|
|
14
|
-
import { writeModelJSON, writeModelTS } from '../codegen';
|
|
15
|
-
import { amount, bullets, fetchMarkdown, isoDate, reasoningEfforts, section, subsections, tableRows } from './docs';
|
|
16
|
-
|
|
17
|
-
const DOCS = 'https://developers.openai.com/api/docs';
|
|
18
|
-
|
|
19
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A dated snapshot suffix, which shares its base model's page.
|
|
23
|
-
*/
|
|
24
|
-
const SNAPSHOT = /-(\d{4}-\d{2}-\d{2}|\d{4})$/;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Models the Decisions API takes. Model pages leave that endpoint out, so
|
|
28
|
-
* this follows the Decisions guide.
|
|
29
|
-
*/
|
|
30
|
-
const DECISION_MODELS = /^gpt-6-luna\b/;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Reasoning efforts of models whose pages don't list them, by base model:
|
|
34
|
-
* the o-series takes low to high, and the first GPT-5 models add minimal.
|
|
35
|
-
*/
|
|
36
|
-
const UNLISTED_EFFORTS: Array<[RegExp, ReasoningEffort[]]> = [
|
|
37
|
-
[/^o\d(-mini)?$/, ['low', 'medium', 'high']],
|
|
38
|
-
[/^gpt-5-(mini|nano)$/, ['minimal', 'low', 'medium', 'high']],
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Fetch a docs page as Markdown, or undefined when it doesn't exist.
|
|
43
|
-
*/
|
|
44
|
-
function fetchPage(page: string): Promise<string | undefined> {
|
|
45
|
-
return fetchMarkdown(`${DOCS}/${page}.md`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Shutdown date of each model the deprecations page lists, as YYYY-MM-DD.
|
|
50
|
-
*/
|
|
51
|
-
async function fetchRetirements(): Promise<Map<string, string>> {
|
|
52
|
-
const retirements = new Map<string, string>();
|
|
53
|
-
for (const [date, models] of tableRows(await fetchPage('deprecations') ?? '')) {
|
|
54
|
-
const retiresAt = isoDate(date);
|
|
55
|
-
if (retiresAt) {
|
|
56
|
-
for (const [, id] of models.matchAll(/`([^`/]+)`/g)) {
|
|
57
|
-
retirements.set(id, retiresAt);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return retirements;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* GPT Image token prices from the pricing page's standard image table,
|
|
66
|
-
* since image model pages carry none.
|
|
67
|
-
*/
|
|
68
|
-
async function fetchImagePricing(): Promise<Map<string, ModelPricing>> {
|
|
69
|
-
const markdown = await fetchPage('pricing') ?? '';
|
|
70
|
-
const start = markdown.indexOf('Image generation models');
|
|
71
|
-
const table = markdown.slice(start).split('### Grouped Pricing Table data')[1] ?? '';
|
|
72
|
-
const pricing = new Map<string, ModelPricing>();
|
|
73
|
-
for (const [model, modality, input, output, cached] of tableRows(table.split('\n\n\n')[0])) {
|
|
74
|
-
const entry = pricing.get(model) ?? {};
|
|
75
|
-
if (modality === 'Image') {
|
|
76
|
-
entry.image = { input: amount(input), tokens: amount(output) };
|
|
77
|
-
} else if (modality === 'Text') {
|
|
78
|
-
entry.text = { input: amount(input), output: amount(output), cached: amount(cached) };
|
|
79
|
-
}
|
|
80
|
-
pricing.set(model, entry);
|
|
81
|
-
}
|
|
82
|
-
return pricing;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Prices from a model page's Pricing section.
|
|
87
|
-
*/
|
|
88
|
-
function parsePricing(markdown: string): ModelPricing {
|
|
89
|
-
const pricing: ModelPricing = {};
|
|
90
|
-
for (const [name, body] of subsections(section(markdown, 'Pricing'))) {
|
|
91
|
-
const price = (metric: string) => amount(tableRows(body).find(([m]) => m === metric)?.[1] ?? '');
|
|
92
|
-
switch (name) {
|
|
93
|
-
case 'Text tokens':
|
|
94
|
-
pricing.text = { input: price('Input'), output: price('Output'), cached: price('Cached input'), cacheWrite: price('Cache writes') };
|
|
95
|
-
break;
|
|
96
|
-
case 'Audio tokens':
|
|
97
|
-
pricing.audio = { input: price('Input'), output: price('Output') };
|
|
98
|
-
break;
|
|
99
|
-
case 'Image tokens':
|
|
100
|
-
pricing.image = { input: price('Input'), tokens: price('Output') };
|
|
101
|
-
break;
|
|
102
|
-
case 'Embeddings':
|
|
103
|
-
pricing.embeddings = { cost: price('Cost') };
|
|
104
|
-
break;
|
|
105
|
-
case 'Transcription audio duration': {
|
|
106
|
-
const perMinute = price('Price');
|
|
107
|
-
pricing.audio = { perSecond: perMinute && perMinute / 60 };
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return pricing;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Convert one model page into ModelInfo.
|
|
117
|
-
*/
|
|
118
|
-
function parseModel(id: string, markdown: string, retirements: Map<string, string>, extraPricing: ModelPricing | undefined): ModelInfo {
|
|
119
|
-
const details = bullets(section(markdown, 'Model details'));
|
|
120
|
-
const detail = (pattern: RegExp) => details.map(d => pattern.exec(d)?.[1]).find(Boolean);
|
|
121
|
-
const list = (pattern: RegExp) => detail(pattern)?.split(',').map(s => s.trim()) ?? [];
|
|
122
|
-
|
|
123
|
-
const inputs = list(/^Input modalities: (.+)$/);
|
|
124
|
-
const outputs = list(/^Output modalities: (.+)$/);
|
|
125
|
-
const features = new Set(bullets(section(markdown, 'Supported features')));
|
|
126
|
-
const endpoints = new Set(tableRows(section(markdown, 'Endpoints')).flatMap(([name, , support]) => support === 'Supported' ? [name] : []));
|
|
127
|
-
const reasons = details.includes('Reasoning token support');
|
|
128
|
-
const efforts = /Reasoning\.effort supports: ([^.]+)\./.exec(markdown)?.[1];
|
|
129
|
-
// Deprecations list snapshots, so an alias retires with its default snapshot
|
|
130
|
-
const snapshot = detail(/^Default snapshot: `(.+)`$/);
|
|
131
|
-
const retiresAt = retirements.get(id) ?? retirements.get(id.replace(SNAPSHOT, '')) ?? (snapshot && retirements.get(snapshot));
|
|
132
|
-
|
|
133
|
-
const chat = (endpoints.has('Chat Completions') || endpoints.has('Responses')) && outputs.includes('text');
|
|
134
|
-
const capabilities = new Set<ModelCapability>();
|
|
135
|
-
const parameters = new Set<ModelParameter>();
|
|
136
|
-
const allow = (when: boolean, ...params: ModelParameter[]) => {
|
|
137
|
-
if (when) {
|
|
138
|
-
params.forEach(p => parameters.add(p));
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
const add = (when: boolean, capability: ModelCapability, ...params: ModelParameter[]) => {
|
|
142
|
-
if (when) {
|
|
143
|
-
capabilities.add(capability);
|
|
144
|
-
}
|
|
145
|
-
allow(when, ...params);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
add(chat, 'chat', 'maxTokens', 'serviceTier');
|
|
149
|
-
add(chat && features.has('streaming'), 'streaming');
|
|
150
|
-
add(chat && features.has('function_calling'), 'tools', 'tools', 'toolChoice');
|
|
151
|
-
add(chat && features.has('structured_outputs'), 'structured', 'responseFormat', 'structuredOutput');
|
|
152
|
-
add(chat && features.has('structured_outputs'), 'json');
|
|
153
|
-
add(chat && inputs.includes('image'), 'vision');
|
|
154
|
-
add(chat && inputs.includes('audio'), 'hearing');
|
|
155
|
-
add(chat && features.has('file_uploads'), 'files');
|
|
156
|
-
add(chat && outputs.includes('audio'), 'audio');
|
|
157
|
-
add(chat && reasons, 'reasoning', 'reason', 'verbosity');
|
|
158
|
-
// Sampling controls are rejected by reasoning models
|
|
159
|
-
allow(chat && !reasons, 'temperature', 'topP', 'frequencyPenalty', 'presencePenalty', 'stop', 'seed', 'logitBias', 'logProbabilities');
|
|
160
|
-
add(endpoints.has('Image generation'), 'image', 'imageBackground', 'imageMultiple', 'imageFormat', 'imageStream');
|
|
161
|
-
add(endpoints.has('Image edit'), 'image');
|
|
162
|
-
add(endpoints.has('Speech generation'), 'audio', 'speechInstructions');
|
|
163
|
-
add(endpoints.has('Transcription'), 'hearing', 'transcribeStream', 'transcribePrompt');
|
|
164
|
-
add(endpoints.has('Embeddings'), 'embedding', 'embeddingDimensions');
|
|
165
|
-
add(DECISION_MODELS.test(id), 'decision');
|
|
166
|
-
|
|
167
|
-
return {
|
|
168
|
-
provider: 'openai',
|
|
169
|
-
id,
|
|
170
|
-
name: /^# (.+)$/m.exec(markdown)?.[1].trim() ?? id,
|
|
171
|
-
capabilities,
|
|
172
|
-
supportedParameters: parameters,
|
|
173
|
-
tier: detectTier(id),
|
|
174
|
-
contextWindow: amount(detail(/^([\d,]+) context window$/) ?? '') ?? 0,
|
|
175
|
-
maxOutputTokens: amount(detail(/^([\d,]+) max output tokens$/) ?? ''),
|
|
176
|
-
pricing: { ...parsePricing(markdown), ...extraPricing },
|
|
177
|
-
reasoningEfforts: efforts ? reasoningEfforts(efforts) : reasons ? UNLISTED_EFFORTS.find(([base]) => base.test(id.replace(SNAPSHOT, '')))?.[1] : undefined,
|
|
178
|
-
retiresAt,
|
|
179
|
-
metadata: {
|
|
180
|
-
knowledgeCutoff: detail(/^(.+) knowledge cutoff$/),
|
|
181
|
-
responsesOnly: endpoints.has('Responses') && !endpoints.has('Chat Completions'),
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Model ids the API lists for the configured key.
|
|
188
|
-
*/
|
|
189
|
-
async function fetchModelIds(): Promise<string[]> {
|
|
190
|
-
const response = await fetch('https://api.openai.com/v1/models', {
|
|
191
|
-
headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },
|
|
192
|
-
});
|
|
193
|
-
const data: { data?: { id: string }[] } = JSON.parse(await response.text());
|
|
194
|
-
if (!data.data) {
|
|
195
|
-
throw new Error('Invalid response from OpenAI API');
|
|
196
|
-
}
|
|
197
|
-
return data.data.map(model => model.id).sort();
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Main scraper function
|
|
202
|
-
*/
|
|
203
|
-
export async function scrapeOpenAI(
|
|
204
|
-
outputDir: string,
|
|
205
|
-
options: { concurrency?: number } = {}
|
|
206
|
-
): Promise<void> {
|
|
207
|
-
const { concurrency = 8 } = options;
|
|
208
|
-
console.log('\n=== OpenAI Scraper ===\n');
|
|
209
|
-
|
|
210
|
-
const [ids, retirements, imagePricing] = await Promise.all([fetchModelIds(), fetchRetirements(), fetchImagePricing()]);
|
|
211
|
-
console.log(`✓ ${ids.length} models listed, ${retirements.size} with shutdown dates`);
|
|
212
|
-
|
|
213
|
-
// A snapshot without its own page shares its base model's page
|
|
214
|
-
const pages = new Map<string, Promise<string | undefined>>();
|
|
215
|
-
const page = (slug: string) => {
|
|
216
|
-
const markdown = pages.get(slug) ?? fetchPage(`models/${slug}`);
|
|
217
|
-
pages.set(slug, markdown);
|
|
218
|
-
return markdown;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const models: ModelInfo[] = [];
|
|
222
|
-
const skipped: string[] = [];
|
|
223
|
-
for (let i = 0; i < ids.length; i += concurrency) {
|
|
224
|
-
await Promise.all(ids.slice(i, i + concurrency).map(async id => {
|
|
225
|
-
const base = id.replace(SNAPSHOT, '');
|
|
226
|
-
const markdown = await page(id) ?? await page(base);
|
|
227
|
-
if (markdown) {
|
|
228
|
-
models.push(parseModel(id, markdown, retirements, imagePricing.get(id) ?? imagePricing.get(base)));
|
|
229
|
-
} else {
|
|
230
|
-
skipped.push(id);
|
|
231
|
-
}
|
|
232
|
-
}));
|
|
233
|
-
}
|
|
234
|
-
models.sort((a, b) => a.id.localeCompare(b.id));
|
|
235
|
-
console.log(`✓ Parsed ${models.length} models${skipped.length ? `, no docs page for: ${skipped.join(', ')}` : ''}`);
|
|
236
|
-
|
|
237
|
-
await writeModelJSON(models, path.join(outputDir, 'openai-modelinfo.json'));
|
|
238
|
-
await writeModelTS(models, 'openaiModels', path.join(__dirname, '../../src/models/openai.ts'));
|
|
239
|
-
console.log('✓ Generated TypeScript file: src/models/openai.ts\n');
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// CLI execution
|
|
243
|
-
if (process.argv[1].endsWith('openai.ts')) {
|
|
244
|
-
const args = process.argv.slice(2);
|
|
245
|
-
const outputDir = args.find((arg) => !arg.startsWith('--')) || path.join(__dirname, '../../data');
|
|
246
|
-
const concurrencyArg = args.find((arg) => arg.startsWith('--concurrency='));
|
|
247
|
-
|
|
248
|
-
scrapeOpenAI(outputDir, { concurrency: concurrencyArg ? parseInt(concurrencyArg.split('=')[1], 10) : undefined }).catch((error) => {
|
|
249
|
-
console.error('✗ OpenAI scraping failed:', error);
|
|
250
|
-
process.exit(1);
|
|
251
|
-
});
|
|
252
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Model Scraper
|
|
3
|
+
*
|
|
4
|
+
* Builds model information for every model the API lists from the Markdown
|
|
5
|
+
* versions of OpenAI's docs: each model page (details, pricing, endpoints,
|
|
6
|
+
* features), the pricing page (GPT Image token prices), and the deprecations
|
|
7
|
+
* page (shutdown dates).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
import { detectTier, type ModelCapability, type ModelInfo, type ModelParameter, type ModelPricing } from '@aeye/ai';
|
|
13
|
+
import type { ReasoningEffort } from '@aeye/core';
|
|
14
|
+
import { writeModelJSON, writeModelTS } from '../codegen';
|
|
15
|
+
import { amount, bullets, fetchMarkdown, isoDate, reasoningEfforts, section, subsections, tableRows } from './docs';
|
|
16
|
+
|
|
17
|
+
const DOCS = 'https://developers.openai.com/api/docs';
|
|
18
|
+
|
|
19
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A dated snapshot suffix, which shares its base model's page.
|
|
23
|
+
*/
|
|
24
|
+
const SNAPSHOT = /-(\d{4}-\d{2}-\d{2}|\d{4})$/;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Models the Decisions API takes. Model pages leave that endpoint out, so
|
|
28
|
+
* this follows the Decisions guide.
|
|
29
|
+
*/
|
|
30
|
+
const DECISION_MODELS = /^gpt-6-luna\b/;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Reasoning efforts of models whose pages don't list them, by base model:
|
|
34
|
+
* the o-series takes low to high, and the first GPT-5 models add minimal.
|
|
35
|
+
*/
|
|
36
|
+
const UNLISTED_EFFORTS: Array<[RegExp, ReasoningEffort[]]> = [
|
|
37
|
+
[/^o\d(-mini)?$/, ['low', 'medium', 'high']],
|
|
38
|
+
[/^gpt-5-(mini|nano)$/, ['minimal', 'low', 'medium', 'high']],
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Fetch a docs page as Markdown, or undefined when it doesn't exist.
|
|
43
|
+
*/
|
|
44
|
+
function fetchPage(page: string): Promise<string | undefined> {
|
|
45
|
+
return fetchMarkdown(`${DOCS}/${page}.md`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Shutdown date of each model the deprecations page lists, as YYYY-MM-DD.
|
|
50
|
+
*/
|
|
51
|
+
async function fetchRetirements(): Promise<Map<string, string>> {
|
|
52
|
+
const retirements = new Map<string, string>();
|
|
53
|
+
for (const [date, models] of tableRows(await fetchPage('deprecations') ?? '')) {
|
|
54
|
+
const retiresAt = isoDate(date);
|
|
55
|
+
if (retiresAt) {
|
|
56
|
+
for (const [, id] of models.matchAll(/`([^`/]+)`/g)) {
|
|
57
|
+
retirements.set(id, retiresAt);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return retirements;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* GPT Image token prices from the pricing page's standard image table,
|
|
66
|
+
* since image model pages carry none.
|
|
67
|
+
*/
|
|
68
|
+
async function fetchImagePricing(): Promise<Map<string, ModelPricing>> {
|
|
69
|
+
const markdown = await fetchPage('pricing') ?? '';
|
|
70
|
+
const start = markdown.indexOf('Image generation models');
|
|
71
|
+
const table = markdown.slice(start).split('### Grouped Pricing Table data')[1] ?? '';
|
|
72
|
+
const pricing = new Map<string, ModelPricing>();
|
|
73
|
+
for (const [model, modality, input, output, cached] of tableRows(table.split('\n\n\n')[0])) {
|
|
74
|
+
const entry = pricing.get(model) ?? {};
|
|
75
|
+
if (modality === 'Image') {
|
|
76
|
+
entry.image = { input: amount(input), tokens: amount(output) };
|
|
77
|
+
} else if (modality === 'Text') {
|
|
78
|
+
entry.text = { input: amount(input), output: amount(output), cached: amount(cached) };
|
|
79
|
+
}
|
|
80
|
+
pricing.set(model, entry);
|
|
81
|
+
}
|
|
82
|
+
return pricing;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Prices from a model page's Pricing section.
|
|
87
|
+
*/
|
|
88
|
+
function parsePricing(markdown: string): ModelPricing {
|
|
89
|
+
const pricing: ModelPricing = {};
|
|
90
|
+
for (const [name, body] of subsections(section(markdown, 'Pricing'))) {
|
|
91
|
+
const price = (metric: string) => amount(tableRows(body).find(([m]) => m === metric)?.[1] ?? '');
|
|
92
|
+
switch (name) {
|
|
93
|
+
case 'Text tokens':
|
|
94
|
+
pricing.text = { input: price('Input'), output: price('Output'), cached: price('Cached input'), cacheWrite: price('Cache writes') };
|
|
95
|
+
break;
|
|
96
|
+
case 'Audio tokens':
|
|
97
|
+
pricing.audio = { input: price('Input'), output: price('Output') };
|
|
98
|
+
break;
|
|
99
|
+
case 'Image tokens':
|
|
100
|
+
pricing.image = { input: price('Input'), tokens: price('Output') };
|
|
101
|
+
break;
|
|
102
|
+
case 'Embeddings':
|
|
103
|
+
pricing.embeddings = { cost: price('Cost') };
|
|
104
|
+
break;
|
|
105
|
+
case 'Transcription audio duration': {
|
|
106
|
+
const perMinute = price('Price');
|
|
107
|
+
pricing.audio = { perSecond: perMinute && perMinute / 60 };
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return pricing;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Convert one model page into ModelInfo.
|
|
117
|
+
*/
|
|
118
|
+
function parseModel(id: string, markdown: string, retirements: Map<string, string>, extraPricing: ModelPricing | undefined): ModelInfo {
|
|
119
|
+
const details = bullets(section(markdown, 'Model details'));
|
|
120
|
+
const detail = (pattern: RegExp) => details.map(d => pattern.exec(d)?.[1]).find(Boolean);
|
|
121
|
+
const list = (pattern: RegExp) => detail(pattern)?.split(',').map(s => s.trim()) ?? [];
|
|
122
|
+
|
|
123
|
+
const inputs = list(/^Input modalities: (.+)$/);
|
|
124
|
+
const outputs = list(/^Output modalities: (.+)$/);
|
|
125
|
+
const features = new Set(bullets(section(markdown, 'Supported features')));
|
|
126
|
+
const endpoints = new Set(tableRows(section(markdown, 'Endpoints')).flatMap(([name, , support]) => support === 'Supported' ? [name] : []));
|
|
127
|
+
const reasons = details.includes('Reasoning token support');
|
|
128
|
+
const efforts = /Reasoning\.effort supports: ([^.]+)\./.exec(markdown)?.[1];
|
|
129
|
+
// Deprecations list snapshots, so an alias retires with its default snapshot
|
|
130
|
+
const snapshot = detail(/^Default snapshot: `(.+)`$/);
|
|
131
|
+
const retiresAt = retirements.get(id) ?? retirements.get(id.replace(SNAPSHOT, '')) ?? (snapshot && retirements.get(snapshot));
|
|
132
|
+
|
|
133
|
+
const chat = (endpoints.has('Chat Completions') || endpoints.has('Responses')) && outputs.includes('text');
|
|
134
|
+
const capabilities = new Set<ModelCapability>();
|
|
135
|
+
const parameters = new Set<ModelParameter>();
|
|
136
|
+
const allow = (when: boolean, ...params: ModelParameter[]) => {
|
|
137
|
+
if (when) {
|
|
138
|
+
params.forEach(p => parameters.add(p));
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const add = (when: boolean, capability: ModelCapability, ...params: ModelParameter[]) => {
|
|
142
|
+
if (when) {
|
|
143
|
+
capabilities.add(capability);
|
|
144
|
+
}
|
|
145
|
+
allow(when, ...params);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
add(chat, 'chat', 'maxTokens', 'serviceTier');
|
|
149
|
+
add(chat && features.has('streaming'), 'streaming');
|
|
150
|
+
add(chat && features.has('function_calling'), 'tools', 'tools', 'toolChoice');
|
|
151
|
+
add(chat && features.has('structured_outputs'), 'structured', 'responseFormat', 'structuredOutput');
|
|
152
|
+
add(chat && features.has('structured_outputs'), 'json');
|
|
153
|
+
add(chat && inputs.includes('image'), 'vision');
|
|
154
|
+
add(chat && inputs.includes('audio'), 'hearing');
|
|
155
|
+
add(chat && features.has('file_uploads'), 'files');
|
|
156
|
+
add(chat && outputs.includes('audio'), 'audio');
|
|
157
|
+
add(chat && reasons, 'reasoning', 'reason', 'verbosity');
|
|
158
|
+
// Sampling controls are rejected by reasoning models
|
|
159
|
+
allow(chat && !reasons, 'temperature', 'topP', 'frequencyPenalty', 'presencePenalty', 'stop', 'seed', 'logitBias', 'logProbabilities');
|
|
160
|
+
add(endpoints.has('Image generation'), 'image', 'imageBackground', 'imageMultiple', 'imageFormat', 'imageStream');
|
|
161
|
+
add(endpoints.has('Image edit'), 'image');
|
|
162
|
+
add(endpoints.has('Speech generation'), 'audio', 'speechInstructions');
|
|
163
|
+
add(endpoints.has('Transcription'), 'hearing', 'transcribeStream', 'transcribePrompt');
|
|
164
|
+
add(endpoints.has('Embeddings'), 'embedding', 'embeddingDimensions');
|
|
165
|
+
add(DECISION_MODELS.test(id), 'decision');
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
provider: 'openai',
|
|
169
|
+
id,
|
|
170
|
+
name: /^# (.+)$/m.exec(markdown)?.[1].trim() ?? id,
|
|
171
|
+
capabilities,
|
|
172
|
+
supportedParameters: parameters,
|
|
173
|
+
tier: detectTier(id),
|
|
174
|
+
contextWindow: amount(detail(/^([\d,]+) context window$/) ?? '') ?? 0,
|
|
175
|
+
maxOutputTokens: amount(detail(/^([\d,]+) max output tokens$/) ?? ''),
|
|
176
|
+
pricing: { ...parsePricing(markdown), ...extraPricing },
|
|
177
|
+
reasoningEfforts: efforts ? reasoningEfforts(efforts) : reasons ? UNLISTED_EFFORTS.find(([base]) => base.test(id.replace(SNAPSHOT, '')))?.[1] : undefined,
|
|
178
|
+
retiresAt,
|
|
179
|
+
metadata: {
|
|
180
|
+
knowledgeCutoff: detail(/^(.+) knowledge cutoff$/),
|
|
181
|
+
responsesOnly: endpoints.has('Responses') && !endpoints.has('Chat Completions'),
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Model ids the API lists for the configured key.
|
|
188
|
+
*/
|
|
189
|
+
async function fetchModelIds(): Promise<string[]> {
|
|
190
|
+
const response = await fetch('https://api.openai.com/v1/models', {
|
|
191
|
+
headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },
|
|
192
|
+
});
|
|
193
|
+
const data: { data?: { id: string }[] } = JSON.parse(await response.text());
|
|
194
|
+
if (!data.data) {
|
|
195
|
+
throw new Error('Invalid response from OpenAI API');
|
|
196
|
+
}
|
|
197
|
+
return data.data.map(model => model.id).sort();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Main scraper function
|
|
202
|
+
*/
|
|
203
|
+
export async function scrapeOpenAI(
|
|
204
|
+
outputDir: string,
|
|
205
|
+
options: { concurrency?: number } = {}
|
|
206
|
+
): Promise<void> {
|
|
207
|
+
const { concurrency = 8 } = options;
|
|
208
|
+
console.log('\n=== OpenAI Scraper ===\n');
|
|
209
|
+
|
|
210
|
+
const [ids, retirements, imagePricing] = await Promise.all([fetchModelIds(), fetchRetirements(), fetchImagePricing()]);
|
|
211
|
+
console.log(`✓ ${ids.length} models listed, ${retirements.size} with shutdown dates`);
|
|
212
|
+
|
|
213
|
+
// A snapshot without its own page shares its base model's page
|
|
214
|
+
const pages = new Map<string, Promise<string | undefined>>();
|
|
215
|
+
const page = (slug: string) => {
|
|
216
|
+
const markdown = pages.get(slug) ?? fetchPage(`models/${slug}`);
|
|
217
|
+
pages.set(slug, markdown);
|
|
218
|
+
return markdown;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const models: ModelInfo[] = [];
|
|
222
|
+
const skipped: string[] = [];
|
|
223
|
+
for (let i = 0; i < ids.length; i += concurrency) {
|
|
224
|
+
await Promise.all(ids.slice(i, i + concurrency).map(async id => {
|
|
225
|
+
const base = id.replace(SNAPSHOT, '');
|
|
226
|
+
const markdown = await page(id) ?? await page(base);
|
|
227
|
+
if (markdown) {
|
|
228
|
+
models.push(parseModel(id, markdown, retirements, imagePricing.get(id) ?? imagePricing.get(base)));
|
|
229
|
+
} else {
|
|
230
|
+
skipped.push(id);
|
|
231
|
+
}
|
|
232
|
+
}));
|
|
233
|
+
}
|
|
234
|
+
models.sort((a, b) => a.id.localeCompare(b.id));
|
|
235
|
+
console.log(`✓ Parsed ${models.length} models${skipped.length ? `, no docs page for: ${skipped.join(', ')}` : ''}`);
|
|
236
|
+
|
|
237
|
+
await writeModelJSON(models, path.join(outputDir, 'openai-modelinfo.json'));
|
|
238
|
+
await writeModelTS(models, 'openaiModels', path.join(__dirname, '../../src/models/openai.ts'));
|
|
239
|
+
console.log('✓ Generated TypeScript file: src/models/openai.ts\n');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// CLI execution
|
|
243
|
+
if (process.argv[1].endsWith('openai.ts')) {
|
|
244
|
+
const args = process.argv.slice(2);
|
|
245
|
+
const outputDir = args.find((arg) => !arg.startsWith('--')) || path.join(__dirname, '../../data');
|
|
246
|
+
const concurrencyArg = args.find((arg) => arg.startsWith('--concurrency='));
|
|
247
|
+
|
|
248
|
+
scrapeOpenAI(outputDir, { concurrency: concurrencyArg ? parseInt(concurrencyArg.split('=')[1], 10) : undefined }).catch((error) => {
|
|
249
|
+
console.error('✗ OpenAI scraping failed:', error);
|
|
250
|
+
process.exit(1);
|
|
251
|
+
});
|
|
252
|
+
}
|