SYMBOL INDEX (186 symbols across 30 files) FILE: app/api/batch.py function _get_worker (line 36) | def _get_worker(request: Request): function create_batch_job (line 41) | async def create_batch_job( function create_batch_from_file (line 54) | async def create_batch_from_file( function get_batch_status (line 88) | async def get_batch_status( function stream_batch_progress (line 99) | async def stream_batch_progress( function download_batch_images (line 138) | async def download_batch_images( function cancel_batch_job (line 216) | async def cancel_batch_job( function retry_failed_jobs (line 227) | async def retry_failed_jobs( function _parse_json (line 247) | def _parse_json(content: bytes) -> list[ImageRequest]: function _parse_csv (line 265) | def _parse_csv(content: bytes) -> list[ImageRequest]: function _estimate_eta (line 296) | def _estimate_eta(progress: dict, worker) -> float | None: FILE: app/api/generate.py function _get_worker (line 30) | def _get_worker(request: Request): function generate_async (line 35) | async def generate_async( function stream_generate_progress (line 57) | async def stream_generate_progress( function generate_sync (line 117) | async def generate_sync( function serve_image (line 161) | async def serve_image( FILE: app/api/health.py function set_start_time (line 14) | def set_start_time() -> None: function health_check (line 20) | async def health_check(request: Request): FILE: app/api/jobs.py function list_all_jobs (line 16) | async def list_all_jobs( function get_job_detail (line 28) | async def get_job_detail( function cancel_job_endpoint (line 39) | async def cancel_job_endpoint( FILE: app/config.py class Settings (line 5) | class Settings(BaseSettings): FILE: app/database.py function init_db (line 11) | async def init_db() -> None: function get_session (line 18) | async def get_session() -> AsyncSession: # type: ignore[misc] FILE: app/engine/engine_config.py function estimated_vram_gb (line 22) | def estimated_vram_gb(width: int, height: int) -> float: FILE: app/engine/flux_engine.py class GenerationResult (line 26) | class GenerationResult: class FluxEngine (line 33) | class FluxEngine: method load_model (line 41) | def load_model(self) -> None: method warmup (line 85) | def warmup(self) -> None: method generate (line 97) | def generate( method get_vram_usage_gb (line 141) | def get_vram_usage_gb(self) -> float: method get_vram_stats (line 147) | def get_vram_stats(self) -> dict: method unload (line 162) | def unload(self) -> None: method is_loaded (line 174) | def is_loaded(self) -> bool: FILE: app/engine/mock_engine.py class GenerationResult (line 16) | class GenerationResult: class MockFluxEngine (line 23) | class MockFluxEngine: method load_model (line 28) | def load_model(self) -> None: method warmup (line 32) | def warmup(self) -> None: method generate (line 35) | def generate( method get_vram_usage_gb (line 80) | def get_vram_usage_gb(self) -> float: method get_vram_stats (line 83) | def get_vram_stats(self) -> dict: method unload (line 86) | def unload(self) -> None: method is_loaded (line 91) | def is_loaded(self) -> bool: FILE: app/main.py function _setup_logging (line 20) | def _setup_logging() -> None: function lifespan (line 54) | async def lifespan(app: FastAPI): FILE: app/models/enums.py class JobStatus (line 4) | class JobStatus(str, enum.Enum): class JobPriority (line 12) | class JobPriority(int, enum.Enum): class ImageFormat (line 17) | class ImageFormat(str, enum.Enum): FILE: app/models/job.py class Base (line 17) | class Base(DeclarativeBase): function _utcnow (line 21) | def _utcnow() -> datetime: class Job (line 25) | class Job(Base): class BatchJob (line 57) | class BatchJob(Base): FILE: app/schemas/batch.py class BatchRequest (line 6) | class BatchRequest(BaseModel): class BatchProgress (line 11) | class BatchProgress(BaseModel): FILE: app/schemas/generate.py class ImageRequest (line 7) | class ImageRequest(BaseModel): method check_content_safety (line 20) | def check_content_safety(cls, v: str) -> str: method validate_resolution (line 27) | def validate_resolution(self) -> "ImageRequest": class ImageResponse (line 35) | class ImageResponse(BaseModel): FILE: app/schemas/job.py class JobDetail (line 4) | class JobDetail(BaseModel): class JobList (line 25) | class JobList(BaseModel): FILE: app/services/generation_service.py function create_single_job (line 18) | async def create_single_job( function create_batch (line 63) | async def create_batch( FILE: app/services/job_service.py function _job_to_detail (line 16) | def _job_to_detail(job: Job) -> JobDetail: function get_job (line 39) | async def get_job(session: AsyncSession, job_id: str) -> JobDetail | None: function list_jobs (line 47) | async def list_jobs( function cancel_job (line 71) | async def cancel_job(session: AsyncSession, job_id: str) -> JobDetail | ... function get_batch_progress (line 85) | async def get_batch_progress(session: AsyncSession, batch_id: str) -> di... function cancel_batch (line 113) | async def cancel_batch(session: AsyncSession, batch_id: str) -> dict | N... function retry_failed_in_batch (line 135) | async def retry_failed_in_batch(session: AsyncSession, batch_id: str) ->... FILE: app/services/moderation_service.py class ModerationError (line 14) | class ModerationError(Exception): function check_prompt_safety (line 18) | async def check_prompt_safety(prompt: str) -> tuple[bool, str | None]: FILE: app/utils/image_utils.py function save_image (line 12) | def save_image( FILE: app/utils/moderation.py class ModerationResult (line 20) | class ModerationResult: class ModerationEngine (line 26) | class ModerationEngine: method __init__ (line 34) | def __init__(self) -> None: method load (line 40) | def load(self, model_id: str = "google/gemma-3-1b-it") -> None: method is_loaded (line 61) | def is_loaded(self) -> bool: method _parse_pipeline_output (line 67) | def _parse_pipeline_output(self, raw: object) -> str: method check_with_local_model (line 80) | def check_with_local_model(self, prompt: str) -> ModerationResult: method check_with_agent_api (line 102) | def check_with_agent_api( method check (line 129) | def check(self, prompt: str, *, hf_token: str | None = None) -> Modera... function get_moderation_engine (line 169) | def get_moderation_engine() -> ModerationEngine: function check_prompt (line 174) | def check_prompt(prompt: str) -> None: FILE: app/utils/storage.py function ensure_storage_dirs (line 11) | def ensure_storage_dirs() -> None: function get_image_path (line 17) | def get_image_path(job_id: str, fmt: str, batch_id: str | None = None) -... function image_url_path (line 38) | def image_url_path(job_id: str) -> str: FILE: app/worker/gpu_worker.py class _QueueItem (line 27) | class _QueueItem: class GPUWorker (line 36) | class GPUWorker: method _normalize_priority (line 49) | def _normalize_priority(priority: int) -> int: method enqueue (line 57) | async def enqueue(self, job_id: str, priority: int = 1) -> None: method queue_depth (line 64) | def queue_depth(self) -> int: method start (line 69) | def start(self) -> asyncio.Task: method shutdown (line 76) | async def shutdown(self) -> None: method resume_pending_jobs (line 88) | async def resume_pending_jobs(self) -> int: method _run (line 108) | async def _run(self) -> None: method _process_job (line 124) | async def _process_job(self, job_id: str) -> None: method _fail_job (line 198) | async def _fail_job(self, job_id: str, error: str) -> None: method _update_batch_count (line 211) | async def _update_batch_count(self, session, batch_id: str) -> None: method get_stats (line 244) | def get_stats(self) -> dict: FILE: tests/conftest.py function event_loop (line 19) | def event_loop(): function db_engine (line 26) | async def db_engine(tmp_path): function db_session (line 36) | async def db_session(db_engine): function mock_engine (line 43) | def mock_engine(): function mock_worker (line 58) | def mock_worker(mock_engine): function client (line 73) | async def client(mock_engine, mock_worker, db_engine, tmp_path): FILE: tests/test_api_batch.py function test_create_batch (line 7) | async def test_create_batch(client, mock_worker): function test_get_batch_404 (line 29) | async def test_get_batch_404(client): function test_cancel_batch (line 35) | async def test_cancel_batch(client, mock_worker): function test_batch_requires_prompts (line 54) | async def test_batch_requires_prompts(client): FILE: tests/test_api_generate.py function test_generate_async_returns_job_ids (line 13) | async def test_generate_async_returns_job_ids(client): function test_generate_multiple_images (line 23) | async def test_generate_multiple_images(client, mock_worker): function test_generate_max_4_images (line 32) | async def test_generate_max_4_images(client): function test_generate_rejects_more_than_4_images (line 39) | async def test_generate_rejects_more_than_4_images(client): function test_generate_async_enqueues_work (line 45) | async def test_generate_async_enqueues_work(client, mock_worker): function test_generate_validates_resolution_multiple_of_8 (line 52) | async def test_generate_validates_resolution_multiple_of_8(client): function test_generate_rejects_empty_prompt (line 61) | async def test_generate_rejects_empty_prompt(client): function test_generate_rejects_oversized_resolution (line 67) | async def test_generate_rejects_oversized_resolution(client): function test_generate_default_values (line 76) | async def test_generate_default_values(client, mock_worker): function test_serve_image_404_for_missing_job (line 82) | async def test_serve_image_404_for_missing_job(client): function test_generate_stream_emits_done_for_completed_jobs (line 88) | async def test_generate_stream_emits_done_for_completed_jobs(client, db_... function test_generate_stream_returns_404_for_unknown_job (line 115) | async def test_generate_stream_returns_404_for_unknown_job(client): function test_generate_async_blocked_when_prompt_is_unsafe (line 126) | async def test_generate_async_blocked_when_prompt_is_unsafe(client): function test_generate_async_proceeds_when_prompt_is_safe (line 139) | async def test_generate_async_proceeds_when_prompt_is_safe(client, mock_... function test_generate_async_returns_503_when_moderation_service_fails (line 153) | async def test_generate_async_returns_503_when_moderation_service_fails(... function test_generate_sync_blocked_when_prompt_is_unsafe (line 165) | async def test_generate_sync_blocked_when_prompt_is_unsafe(client): function test_generate_sync_returns_503_when_moderation_service_fails (line 178) | async def test_generate_sync_returns_503_when_moderation_service_fails(c... FILE: tests/test_api_jobs.py function test_list_jobs_empty (line 7) | async def test_list_jobs_empty(client): function test_get_job_after_create (line 16) | async def test_get_job_after_create(client, mock_worker): function test_cancel_job (line 33) | async def test_cancel_job(client, mock_worker): function test_list_jobs_with_status_filter (line 43) | async def test_list_jobs_with_status_filter(client, mock_worker): function test_get_nonexistent_job (line 54) | async def test_get_nonexistent_job(client): function test_health_endpoint (line 60) | async def test_health_endpoint(client): FILE: tests/test_moderation.py class TestModerationEngine (line 16) | class TestModerationEngine: method test_is_loaded_false_before_load (line 17) | def test_is_loaded_false_before_load(self): method test_load_failure_leaves_engine_unloaded (line 21) | def test_load_failure_leaves_engine_unloaded(self): method test_parse_pipeline_output_safe (line 31) | def test_parse_pipeline_output_safe(self): method test_parse_pipeline_output_unsafe (line 36) | def test_parse_pipeline_output_unsafe(self): method test_check_with_local_model_raises_when_not_loaded (line 41) | def test_check_with_local_model_raises_when_not_loaded(self): method test_check_with_local_model_safe (line 46) | def test_check_with_local_model_safe(self): method test_check_with_local_model_unsafe (line 55) | def test_check_with_local_model_unsafe(self): method test_check_with_agent_api_safe (line 65) | def test_check_with_agent_api_safe(self): method test_check_with_agent_api_unsafe (line 83) | def test_check_with_agent_api_unsafe(self): method test_check_uses_local_model_first (line 102) | def test_check_uses_local_model_first(self): method test_check_falls_back_to_agent_api_when_local_fails (line 115) | def test_check_falls_back_to_agent_api_when_local_fails(self): method test_check_fails_open_when_both_unavailable (line 127) | def test_check_fails_open_when_both_unavailable(self): method test_check_falls_open_when_agent_api_also_fails (line 134) | def test_check_falls_open_when_agent_api_also_fails(self): class TestCheckPrompt (line 148) | class TestCheckPrompt: method test_allows_safe_prompt (line 149) | def test_allows_safe_prompt(self): method test_rejects_unsafe_prompt (line 157) | def test_rejects_unsafe_prompt(self): method test_skips_when_moderation_disabled (line 168) | def test_skips_when_moderation_disabled(self): class TestImageRequestModeration (line 180) | class TestImageRequestModeration: method test_unsafe_prompt_raises_validation_error (line 181) | def test_unsafe_prompt_raises_validation_error(self): method test_safe_prompt_passes_validation (line 194) | def test_safe_prompt_passes_validation(self): FILE: tests/test_moderation_service.py function _make_moderation_response (line 18) | def _make_moderation_response(flagged: bool, categories: dict[str, bool]... function test_check_prompt_safety_disabled_skips_api (line 43) | async def test_check_prompt_safety_disabled_skips_api(): function test_check_prompt_safety_no_api_key_skips_api (line 54) | async def test_check_prompt_safety_no_api_key_skips_api(): function test_check_prompt_safety_safe_prompt (line 71) | async def test_check_prompt_safety_safe_prompt(): function test_check_prompt_safety_flagged_prompt (line 100) | async def test_check_prompt_safety_flagged_prompt(): function test_check_prompt_safety_flagged_multiple_categories (line 128) | async def test_check_prompt_safety_flagged_multiple_categories(): function test_check_prompt_safety_flagged_no_categories (line 156) | async def test_check_prompt_safety_flagged_no_categories(): function test_check_prompt_safety_http_error_raises_moderation_error (line 185) | async def test_check_prompt_safety_http_error_raises_moderation_error(): function test_check_prompt_safety_http_status_error_raises_moderation_error (line 207) | async def test_check_prompt_safety_http_status_error_raises_moderation_e... function test_check_prompt_safety_empty_results (line 237) | async def test_check_prompt_safety_empty_results(): FILE: tests/test_schemas.py class TestImageRequest (line 10) | class TestImageRequest: method test_defaults (line 11) | def test_defaults(self): method test_num_images_up_to_4 (line 21) | def test_num_images_up_to_4(self): method test_num_images_rejects_above_4 (line 25) | def test_num_images_rejects_above_4(self): method test_num_images_rejects_zero (line 29) | def test_num_images_rejects_zero(self): method test_width_must_be_multiple_of_8 (line 33) | def test_width_must_be_multiple_of_8(self): method test_height_must_be_multiple_of_8 (line 37) | def test_height_must_be_multiple_of_8(self): method test_valid_custom_resolution (line 41) | def test_valid_custom_resolution(self): method test_rejects_empty_prompt (line 46) | def test_rejects_empty_prompt(self): method test_rejects_oversized_resolution (line 50) | def test_rejects_oversized_resolution(self): method test_seed_bounds (line 54) | def test_seed_bounds(self): method test_all_formats (line 64) | def test_all_formats(self): class TestBatchRequest (line 70) | class TestBatchRequest: method test_valid_batch (line 71) | def test_valid_batch(self): method test_empty_prompts_rejected (line 78) | def test_empty_prompts_rejected(self): FILE: tests/test_worker.py class TestQueuePriority (line 18) | class TestQueuePriority: method test_realtime_before_batch (line 19) | def test_realtime_before_batch(self): method test_same_priority_fifo (line 25) | def test_same_priority_fifo(self): class TestWorkerEnqueue (line 32) | class TestWorkerEnqueue: method test_enqueue_increases_depth (line 34) | async def test_enqueue_increases_depth(self): method test_realtime_preempts_queued_batch_jobs (line 42) | async def test_realtime_preempts_queued_batch_jobs(self): class TestWorkerStats (line 54) | class TestWorkerStats: method test_initial_stats (line 55) | def test_initial_stats(self):