Skip to content

olegzaimdev/ai-video-concepts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-video-concepts

A small async script that asks an LLM (local via Ollama, or remotely via the Anthropic API) for a short-form video concept, and validates the response into a typed Pydantic model before using it.

This is a learning project for picking up Python idioms that differ from Dart/Java: type hints + mypy, asyncio, Pydantic v2 for structured/validated data, and the uv + ruff + src/ toolchain.

What it does

Given a one-line brief, it returns a VideoConcept:

{
  "hook": "...",
  "script": ["...", "..."],
  "on_screen_text": ["..."],
  "duration_seconds": 30
}

The shape is enforced two ways: the model is constrained to emit JSON matching the schema generated from VideoConcept, and the response is re-validated through Pydantic afterward — so a malformed response raises immediately instead of propagating bad data.

Requirements

  • Python 3.12+
  • uv for dependency management
  • Ollama running locally, with a model pulled (e.g. qwen3:4b)

Setup

uv sync                   # creates .venv and installs dependencies
ollama serve               # in a separate terminal, if not already running
ollama pull qwen3:4b        # or any model you prefer — see "Changing the model" below

Usage

Dry run — no Ollama, no network, just proves the Pydantic validation works:

uv run python -m ai_video_concepts.concept --dry

Real run — calls your local model:

uv run python -m ai_video_concepts.concept

Changing the model

Edit MODEL in src/ai_video_concepts/concept.py to match exactly what ollama list shows (including the tag, e.g. qwen3:4b, not just qwen3).

Development

uv run ruff check src/      # lint
uv run ruff format src/     # auto-format
uv run mypy src/            # strict type-check

Both ruff and mypy are configured in pyproject.toml and should report clean before committing changes.

Project layout

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages