openai
¶
Modules¶
fastvideo.entrypoints.openai.api_server
¶
Classes¶
Functions¶
fastvideo.entrypoints.openai.api_server.create_app
¶
create_app(fastvideo_args: FastVideoArgs, output_dir: str = DEFAULT_OUTPUT_DIR) -> FastAPI
Build the FastAPI application with all routers mounted
Source code in fastvideo/entrypoints/openai/api_server.py
fastvideo.entrypoints.openai.api_server.lifespan
async
¶
lifespan(app: FastAPI) -> AsyncIterator[None]
Load model on startup, clean up on shutdown
Source code in fastvideo/entrypoints/openai/api_server.py
fastvideo.entrypoints.openai.api_server.run_server
¶
run_server(fastvideo_args: FastVideoArgs, host: str = DEFAULT_HOST, port: int = DEFAULT_PORT, output_dir: str = DEFAULT_OUTPUT_DIR)
Create the app and run it with uvicorn
Source code in fastvideo/entrypoints/openai/api_server.py
fastvideo.entrypoints.openai.common_api
¶
Classes¶
fastvideo.entrypoints.openai.common_api.ModelCard
¶
Bases: BaseModel
OpenAI-compatible model card
Functions¶
fastvideo.entrypoints.openai.common_api.available_models
async
¶
Show available models
Source code in fastvideo/entrypoints/openai/common_api.py
fastvideo.entrypoints.openai.common_api.model_info
async
¶
fastvideo.entrypoints.openai.common_api.retrieve_model
async
¶
retrieve_model(model: str)
Retrieve a model by name
Source code in fastvideo/entrypoints/openai/common_api.py
fastvideo.entrypoints.openai.protocol
¶
fastvideo.entrypoints.openai.state
¶
Global server state shared across API modules.
Keeping state in a dedicated module prevents the classic 'main vs package
module' duplication that occurs when api_server.py is run with python -m.
All modules that need the generator or server args should import from here.
Classes¶
Functions¶
fastvideo.entrypoints.openai.state.clear_state
¶
fastvideo.entrypoints.openai.state.get_generator
¶
get_generator() -> VideoGenerator
Return the global VideoGenerator instance (set during startup).
fastvideo.entrypoints.openai.state.get_server_args
¶
get_server_args() -> FastVideoArgs
Return the global FastVideoArgs (set during startup).
fastvideo.entrypoints.openai.state.set_state
¶
set_state(generator: VideoGenerator, fastvideo_args: FastVideoArgs, output_dir: str) -> None
Set all server state at once (called from lifespan).
Source code in fastvideo/entrypoints/openai/state.py
fastvideo.entrypoints.openai.stores
¶
Classes¶
fastvideo.entrypoints.openai.stores.AsyncDictStore
¶
A small async-safe in-memory key-value store for dict items.
This encapsulates the usual pattern of a module-level dict guarded by an asyncio.Lock and provides simple CRUD methods that are safe to call concurrently from FastAPI request handlers and background tasks.
Source code in fastvideo/entrypoints/openai/stores.py
fastvideo.entrypoints.openai.utils
¶
Functions¶
fastvideo.entrypoints.openai.utils.choose_image_ext
¶
Pick a file extension for image outputs
Source code in fastvideo/entrypoints/openai/utils.py
fastvideo.entrypoints.openai.utils.merge_image_input_list
¶
Merge multiple image input sources into a single flat list
Source code in fastvideo/entrypoints/openai/utils.py
fastvideo.entrypoints.openai.utils.parse_size
¶
Parse a 'WIDTHxHEIGHT' string into (width, height)
Source code in fastvideo/entrypoints/openai/utils.py
fastvideo.entrypoints.openai.utils.save_image_to_path
async
¶
Save an uploaded file or download from URL to target_path