页面简介
Learn how to build and deploy AI applications with fal
正文摘录
Build with falThe generative media platform powering the world’s top AI apps.Call 1,000+ optimized models through a unified API, or deploy your own on the same infrastructure. Image, video, audio, music, speech, 3D, and real-time streaming. Built to scale to billions of requests.Search or ask…99.99%+UptimeBillions+Requests/day1,000+EndpointsModel APIsCall 1,000+ models with one API. Image, video, audio, and multimodal generation. Optimized and production-ready.ServerlessDeploy your own models. Same infrastructure, same autoscaling, same reliability. From zero to thousands of GPUs.ComputeDedicated GPU instances. Full SSH access for training, fine-tuning, and persistent workloads.fal AgentYour creative partner across every model. Plan, generate, and edit images, video, audio, and 3D in one conversation.Platform APIsREST APIs for model metadata, pricing, usage tracking, logs, files, and metricsStart with a Model API CallMost users start here. Pick a model from the Marketplace, get an API key, and make a request. Three lines of code, no infrastructure to manage.PythonJavaScriptcURLimport fal_client result = fal_client.subscribe("fal-ai/nano-banana-2", arguments={"prompt": "a sunset over mountains"} ) print(result["images"][0]["url"]) Every model supports synchronous and async queue calls out of the box. Many also support streaming and real-time WebSocket connections. You can compare models side-by-side in the Sandbox before committing to one.Model APIs QuickstartBrowse models, see pricing, and start generatingDeploy Your Own ModelsFor teams that need to run custom models, proprietary pipelines, or fine-tuned variants, fal Serverless lets you deploy on the same engine that powers the Marketplace. Your apps run on serverless GPUs that scale with your traffic. fal has been running this infrastructure for over 3 years, and every model on the platform goes through the same lifecycle below.1DevelopA fal.App is a Python class where your setup() method runs once per runner to load model weights and initialize resources. Your @fal.endpoint methods then serve incoming requests using the initialized state. You declare hardware needs and environment alongside your code, so infrastructure is versioned with your app.import fal from pydantic import BaseModel class Input(BaseModel): prompt: str class MyModel(fal.App): machine_type = "GPU-H100" def setup(self): self.model = load_my_model() @fal.endpoint("/") def generate(self, input: Input): return self.model(input.prompt) 2Testfal run spins up a cloud GPU runner and gives you a temporary URL so you can test on the same hardware you’ll use in production. It also generates a playground UI automatically. For CI, AppClient lets you run tests against ephemeral deployments.fal run my_app.py 3Deployfal deploy creates a persistent, authenticated endpoint with autoscaling and built-in retries. Every deploy creates a new revision for instant rollbacks. For staging and production separation, fal supports multiple environments per app.Open the persistent app in the Apps dashboard. Follow Testing Your Own Apps to test its endpoints in the browser.fal deploy my_app.py 4ObserveThe dashboard gives you real-time logs, request-level analytics, and error tracking out of the box. Trace individual requests, spot latency regressions, and monitor runner utilization. For external stacks, fal supports Prometheus metrics and log drains to any HTTPS endpoint.5Scalefal scales runners from zero to thousands of GPUs based on demand, with a multi-layer caching system that reduces cold starts over time. Scaling parameters let you control the tradeoff: min_concurrency keeps runners warm, max_concurrency caps spend, and concurrency_buffer pre-warms ahead of spikes. See optimizing cold starts and machine types for latency-sensitive workloads.class MyModel(fal.App): min_concurrency = 2 max_concurrency = 100 concurrency_buffer = 3 6DistributeEndpoints start as private. You can deploy in public mode for open access, or shared mode where callers pay for their own usage. To list on the Marketplace for broader distribution and revenue, see publishing to the marketplace.class MyModel(fal.App): app_auth = "shared" Serverless QuickstartDeploy your first model in minutesTrain Your Own ModelsFor training runs, fine-tuning, and workloads that need sustained GPU access, fal Compute gives you dedicated instances with full SSH control. No cold starts, no autoscaling, just raw GPU power billed at a fixed hourly rate.H100 SXMSingle-GPU instances for development, fine-tuning, and single-GPU training8x H100 SXMMulti-GPU instances connected over InfiniBand for distributed trainingComputeServerlessBest forTraining, fine-tuning, batch jobsAPI endpoints, on-demand inferenceBillingPer-hour, fixed ratePer-second of executionScalingManualAutomaticAccessFull SSHManaged runnersCompute QuickstartProvision your first GPU instance in minutesWas this page helpful?YesNo⌘I