# OpenVibes > Hand-checked lists of the best free AI tools, models, credits and resources. Every link goes to the official source and every number is verified. Curated by Khairallah AL-Awady (https://x.com/eng_khairallah1). Every item links to its official source and shows the date it was last verified. No affiliate links. ## Lists - [Every free resource to become an AI engineer (108)](https://openvibes.si/ai-engineer): A free 16-step AI engineer roadmap: Python to RAG, agents, evals, security, LLMOps, fine-tuning and interviews. 108 official docs, courses, repos and papers. Verified 24 Nov 2026. - [Every free uncensored AI model you can run yourself (21)](https://openvibes.si/uncensored-ai): Uncensored and abliterated open models on Hugging Face and Ollama, plus the free apps that run them offline. Links to the official pages only. Verified 24 Nov 2026. - [Every AI model that runs offline on your laptop (21)](https://openvibes.si/offline-ai): 21 open models you can run fully offline with one Ollama command each. Sizes from ollama.com, checked 22 Nov 2026. Verified 22 Nov 2026. - [Every free Claude Code alternative with public source (19)](https://openvibes.si/free-agents): 15 AI coding agents with public source + 4 free local models to power them. Real install commands from each official repo. Verified 22 Nov 2026. - [Every free AI credit worth claiming right now (18)](https://openvibes.si/credits): Up to $1,210 in one-time signup credits plus free GPUs and free LLM tiers. Every amount from the official page. Verified 22 Nov 2026. ## Guides - [The entire math behind quant trading bots (70 formulas)](https://openvibes.si/quant-math): 70 formulas every quant trading bot runs on, in 17 sections: returns, volatility, cointegration, Kalman, Kelly, VaR, order books, market making, Black–Scholes, backtesting and costs. Each with plain English, when a bot uses it, and Python. Checked 26 Nov 2026. ## AI engineer roadmap (108) Roadmap, in order: 1. Software engineering basics: Ship normal software before you add a model: Python, HTTP APIs, a database, Git and containers. Build: A plain REST API, no AI, deployed. 2. How LLMs actually work: Build a mental model: tokens, embeddings, attention, training, inference, sampling, reasoning models and how to pick one. 3. Building on LLM APIs: Turn single calls into software: messages, streaming, structured output, tool calls, retries, async and cost tracking. Build: A streaming assistant that calls tools. 4. Prompt engineering: Write instructions that make outputs predictable: examples, step-by-step reasoning, system prompts, output control, versioning. Build: Take one real prompt and measurably improve it. 5. Retrieval and RAG: Ground answers in your data: parse documents, chunk, embed, search with vectors and BM25, rerank, cite and say no. Build: A hybrid search engine, then a deployed RAG app. 6. AI agents: Let the model choose the next step: tool use, ReAct, planning, MCP, memory, multi-agent setups and sandboxed code. Build: A production-style agent. 7. Context engineering: Treat the context window as a budget: what goes in, what gets compressed, what moves to memory, what gets cached. Build: A long-running agent that manages its own context. 8. LLM evaluations: Measure before you ship: test sets, LLM-as-judge, offline vs online evals, regression suites, RAG and agent evals. 9. AI security: Defend against prompt injection, jailbreaks, data leaks and unsafe tool use, then red-team your own app. Build: Red-team and harden an agentic RAG app. 10. AI system design: Design the whole system and defend each choice on quality, latency, cost and reliability: routing, caching, fallbacks, feedback. Build: A written design doc for a real AI product. 11. LLMOps: dev to production: Version prompts, gate releases on evals, containerize, deploy with CI/CD and watch traces once real users arrive. Build: Take your RAG app and agent to production. 12. Managed AI platforms: Ship on what teams actually buy: a cloud AI platform, an open-weight host or a router, and know what you give up. Build: Deploy one app on a managed platform. 13. Multimodal: images, audio, video: Go beyond text: vision and document understanding, speech in and out, realtime voice agents and cross-modal search. Build: Ship one multimodal build. 14. Fine-tuning: Fine-tune only when prompting and retrieval run out: data curation, SFT, LoRA/QLoRA, DPO, distillation, and prove it with evals. Build: A LoRA that beats a prompted baseline. 15. Projects and portfolio: Proof, not certificates: combine earlier steps into 3–5 public builds you can demo and defend. Build: 3–5 public portfolio projects. 16. AI engineer interview prep: Turn the work into offers: scenario questions, system-design rounds, debugging cases and defending your projects. Build: A full mock interview loop. Resources: - [The Python Tutorial](https://docs.python.org/3/tutorial/) — official docs: The official walk-through of the language, from data structures to modules and classes. - [FastAPI Tutorial](https://fastapi.tiangolo.com/tutorial/) — official docs: Step-by-step guide to typed Python APIs, the default stack for serving LLM apps. - [MDN: Overview of HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Overview) — official docs: Mozilla's explainer of requests, responses, headers and status codes. - [PostgreSQL Tutorial](https://www.postgresql.org/docs/current/tutorial.html) — official docs: The Postgres manual's own intro to tables, queries and joins. Same database you will use for pgvector later. - [Pro Git](https://git-scm.com/book/en/v2) — free book: The full Git book, free to read online. - [Docker: Learn](https://docs.docker.com/get-started/) — official docs: Docker's own path from first container to Compose. - [The Missing Semester (MIT)](https://missing.csail.mit.edu/) — free course: MIT's course on the shell, editors, Git, debugging and the tools classes skip. - [Deep Dive into LLMs like ChatGPT](https://www.youtube.com/watch?v=7xTGNNLPyMI) — video · Andrej Karpathy: Karpathy's long general-audience walk-through of how ChatGPT-style models are trained and why they behave the way they do. - [3Blue1Brown: Neural networks](https://www.3blue1brown.com/topics/neural-networks) — video series: Visual lessons on neural nets, transformers and attention. - [The Illustrated Transformer](https://jalammar.github.io/illustrated-transformer/) — article · Jay Alammar: The classic picture-by-picture explanation of the transformer. - [Hugging Face LLM Course](https://huggingface.co/learn/llm-course) — free course: Hugging Face's course on transformers, tokenizers, datasets and fine-tuning. - [LLM Course (mlabonne)](https://github.com/mlabonne/llm-course) — GitHub roadmap: Maxime Labonne's roadmap and notebooks: LLM fundamentals, the scientist track and the engineer track. - [Tiktokenizer](https://tiktokenizer.vercel.app/) — tool: Paste text and see exactly how it splits into tokens. - [Arena leaderboard](https://arena.ai/leaderboard) — leaderboard: Rankings built from people voting on real head-to-head model answers. - [Artificial Analysis](https://artificialanalysis.ai/) — benchmarks: Compares models on quality, price, speed and latency. - [OpenAI API quickstart](https://developers.openai.com/api/docs/quickstart) — official docs: First request to the OpenAI API, then text, images, tools and streaming. - [Claude: Get started](https://platform.claude.com/docs/en/get-started) — official docs: Anthropic's first-call guide for the Claude API. - [Gemini API docs](https://aistudio.google.com/docs) — official docs: Google's docs for the Gemini API, with a free tier. - [OpenAI: Structured outputs](https://developers.openai.com/api/docs/guides/structured-outputs) — official docs: Make the model return JSON that matches your schema. - [Pydantic AI](https://ai.pydantic.dev/) — framework: Type-safe Python agent framework from the Pydantic team. - [Instructor](https://python.useinstructor.com/) — library: Structured outputs from any LLM, validated with Pydantic. - [LangChain docs](https://docs.langchain.com/) — framework: Docs for LangChain and LangGraph, the most common orchestration stack. - [DeepLearning.AI courses](https://www.deeplearning.ai/short-courses/) — free courses: 1–2 hour courses on building with LLMs, many made with the model labs. - [Claude: Prompt engineering](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview) — official docs: Anthropic's guide to clear prompts, examples, XML tags and chaining. - [OpenAI: Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering) — official docs: OpenAI's guide to messages, roles and few-shot prompting. - [Gemini: Prompting strategies](https://aistudio.google.com/docs/prompting-strategies) — official docs: Google's prompt design guide for Gemini. - [Prompt engineering interactive tutorial](https://github.com/anthropics/prompt-eng-interactive-tutorial) — GitHub · Anthropic: Anthropic's 9-chapter hands-on notebook course with exercises. - [Prompt Engineering Guide](https://www.promptingguide.ai/) — guide: Open guide to prompting techniques, each linked to its paper. - [Docling](https://github.com/docling-project/docling) — GitHub: Turns PDFs, DOCX, HTML and slides into clean Markdown or JSON for retrieval. - [Sentence Transformers](https://sbert.net/) — library: The standard library for embedding and reranking models. - [MTEB leaderboard](https://huggingface.co/spaces/mteb/leaderboard) — leaderboard: Benchmark for choosing an embedding model by task and language. - [pgvector](https://github.com/pgvector/pgvector) — GitHub: Vector search inside Postgres, with HNSW and IVFFlat indexes. - [Qdrant docs](https://qdrant.tech/documentation/) — official docs: Open-source vector database with filtering and hybrid search. - [Contextual Retrieval](https://www.anthropic.com/news/contextual-retrieval) — article · Anthropic: Anthropic's write-up on contextual embeddings + BM25 + reranking, with measured drops in failed retrievals. - [LlamaIndex docs](https://docs.llamaindex.ai/) — framework: Framework for indexing documents and building RAG pipelines. - [Pinecone Learn](https://www.pinecone.io/learn/) — guides: Free articles on embeddings, chunking, hybrid search and reranking. - [RAG paper (Lewis et al., 2020)](https://arxiv.org/abs/2005.11401) — paper: The paper that named retrieval-augmented generation. - [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) — article · Anthropic: When to use workflows vs agents, and the patterns that hold up in production. - [Model Context Protocol](https://modelcontextprotocol.io/) — official docs: The open standard for connecting agents to tools and data. - [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) — framework: Graph-based framework for stateful, long-running agents. - [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/) — framework: Lightweight Python SDK for agents, handoffs and guardrails. - [Hugging Face Agents Course](https://huggingface.co/learn/agents-course) — free course: Free course from agent basics to frameworks, with a certificate. - [ReAct paper](https://arxiv.org/abs/2210.03629) — paper: Reasoning + acting interleaved: the loop most agents still run. - [E2B](https://github.com/e2b-dev/E2B) — GitHub: Open-source cloud sandboxes for running agent-written code safely. - [Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) — article · Anthropic: Anthropic on curating context for agents: compaction, note-taking and sub-agents. - [Context engineering for agents](https://blog.langchain.com/context-engineering-for-agents/) — article · LangChain: Write, select, compress and isolate: the four strategies, with examples. - [Lessons from building Manus](https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus) — article · Manus: Production lessons: KV-cache hit rate, file system as memory, keeping errors in context. - [Lost in the Middle](https://arxiv.org/abs/2307.03172) — paper: Shows models use information at the start and end of long contexts better than the middle. - [Claude: Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) — official docs: Cache long, repeated context to cut cost and latency. - [Your AI product needs evals](https://hamel.dev/blog/posts/evals/) — article · Hamel Husain: The practical case and method for evals, from unit tests to human review. - [promptfoo](https://github.com/promptfoo/promptfoo) — GitHub: CLI for testing prompts, agents and RAG, plus red teaming. - [DeepEval](https://github.com/confident-ai/deepeval) — GitHub: Pytest-style evaluation framework for LLM apps. - [Ragas](https://docs.ragas.io/) — official docs: Metrics and test-set generation for RAG and agent evaluation. - [Inspect](https://inspect.aisi.org.uk/) — framework · UK AISI: The UK AI Security Institute's open-source framework for model evals. - [OpenAI Evals](https://github.com/openai/evals) — GitHub: OpenAI's framework and open registry of benchmarks. - [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) — GitHub: EleutherAI's standard harness for running academic benchmarks. - [OWASP Top 10 for LLM Applications](https://genai.owasp.org/llm-top-10/) — standard: The 10 most critical risks for LLM apps, with mitigations. - [MITRE ATLAS](https://atlas.mitre.org/) — knowledge base: Attack tactics and techniques against AI systems, built from real cases. - [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework) — standard: The US framework for mapping, measuring and managing AI risk. - [Simon Willison on prompt injection](https://simonwillison.net/tags/prompt-injection/) — blog: The running record of prompt injection attacks and why they are hard to fix. - [garak](https://github.com/NVIDIA/garak) — GitHub · NVIDIA: LLM vulnerability scanner: probes for injection, jailbreaks and leaks. - [PyRIT](https://github.com/Azure/PyRIT) — GitHub · Microsoft: Python toolkit for red-teaming generative AI systems. - [NeMo Guardrails](https://github.com/NVIDIA-NeMo/Guardrails) — GitHub · NVIDIA: Add programmable input, output and dialog rails to LLM apps. - [Presidio](https://github.com/data-privacy-stack/presidio) — GitHub: Detect and anonymize PII in text and images before it reaches a model. - [Building a generative AI platform](https://huyenchip.com/2024/07/25/genai-platform.html) — article · Chip Huyen: The common components of a GenAI platform, added one layer at a time. - [Patterns for building LLM-based systems](https://eugeneyan.com/writing/llm-patterns/) — article · Eugene Yan: Seven patterns: evals, RAG, fine-tuning, caching, guardrails, defensive UX, feedback. - [What we learned from a year of building with LLMs](https://applied-llms.org/) — guide: Tactical, operational and strategic lessons from six practitioners. - [System Design 101](https://github.com/ByteByteGoHq/system-design-101) — GitHub · ByteByteGo: Visual explanations of general system design, the base AI design builds on. - [LiteLLM](https://github.com/BerriAI/litellm) — GitHub: One API and proxy for 100+ model providers, with fallbacks and spend tracking. - [vLLM docs](https://docs.vllm.ai/) — official docs: High-throughput open-source inference engine for serving models. - [Langfuse](https://github.com/langfuse/langfuse) — GitHub: Open-source LLM tracing, prompt management and evals. Self-hostable. - [Arize Phoenix](https://github.com/Arize-ai/phoenix) — GitHub: Open-source tracing and evaluation for LLM apps, built on OpenTelemetry. - [MLflow for GenAI](https://mlflow.org/docs/latest/genai/) — official docs: Tracking, tracing, prompt registry and evaluation for LLM apps. - [OpenTelemetry GenAI conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) — standard: The standard attribute names for tracing model and agent calls. - [GitHub Actions docs](https://docs.github.com/en/actions) — official docs: CI/CD to run tests and evals on every change. - [Made With ML](https://madewithml.com/) — free course: Goku Mohandas's free course on putting ML into production. - [Amazon Bedrock docs](https://docs.aws.amazon.com/bedrock/) — official docs: AWS's managed service for foundation models, agents and knowledge bases. - [Google Cloud generative AI docs](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/overview) — official docs: Google Cloud's managed platform for Gemini and partner models. - [Microsoft Foundry docs](https://learn.microsoft.com/en-us/azure/ai-foundry/) — official docs: Azure's platform for models, agents and evaluation. - [OpenRouter docs](https://openrouter.ai/docs) — official docs: One API across hundreds of models and providers. - [Hugging Face Inference Providers](https://huggingface.co/docs/inference-providers) — official docs: Call open-weight models through many hosts with one client. - [Together AI docs](https://docs.together.ai/) — official docs: Serverless and dedicated hosting for open-weight models. - [Gemini: Image understanding](https://aistudio.google.com/docs/image-understanding) — official docs: Captioning, visual Q&A, object detection and segmentation with Gemini. - [OpenAI Realtime API](https://developers.openai.com/api/docs/guides/realtime) — official docs: Low-latency speech-to-speech for voice agents. - [Whisper](https://github.com/openai/whisper) — GitHub · OpenAI: Open-source speech recognition and translation model. - [LiveKit Agents](https://github.com/livekit/agents) — GitHub: Framework for realtime voice and video AI agents. - [Pipecat](https://github.com/pipecat-ai/pipecat) — GitHub: Open-source Python framework for voice and multimodal agents. - [CLIP](https://github.com/openai/CLIP) — GitHub · OpenAI: Joint image–text embeddings, the base of most cross-modal search. - [ColPali](https://github.com/illuin-tech/colpali) — GitHub: Retrieve document pages straight from their images, no OCR step. - [Unsloth](https://github.com/unslothai/unsloth) — GitHub: Faster, lower-memory fine-tuning with free Colab notebooks. - [TRL](https://huggingface.co/docs/trl) — official docs · Hugging Face: SFT, DPO, GRPO and reward modeling in one library. - [PEFT](https://huggingface.co/docs/peft) — official docs · Hugging Face: LoRA and other parameter-efficient methods. - [Axolotl](https://github.com/axolotl-ai-cloud/axolotl) — GitHub: Config-driven fine-tuning for many model families. - [smol course](https://github.com/huggingface/smol-course) — GitHub · Hugging Face: Hands-on course on aligning small models, runs on modest hardware. - [LoRA paper](https://arxiv.org/abs/2106.09685) — paper: Low-rank adaptation: train a small fraction of the weights. - [QLoRA paper](https://arxiv.org/abs/2305.14314) — paper: LoRA on a 4-bit quantized model, fine-tuning on a single GPU. - [DPO paper](https://arxiv.org/abs/2305.18290) — paper: Preference tuning without a separate reward model. - [OpenAI Cookbook](https://cookbook.openai.com/) — examples: Runnable examples for RAG, agents, evals and more. - [Claude Cookbooks](https://github.com/anthropics/claude-cookbooks) — GitHub · Anthropic: Notebooks and recipes for building with Claude. - [Gemini Cookbook](https://github.com/google-gemini/cookbook) — GitHub · Google: Examples and guides for the Gemini API. - [Neural Networks: Zero to Hero](https://karpathy.ai/zero-to-hero.html) — free course · Andrej Karpathy: Build neural nets up to a GPT from scratch, in code. - [nanoGPT](https://github.com/karpathy/nanoGPT) — GitHub: Small, readable repo for training and fine-tuning GPT models. - [Stanford CS336](https://cs336.stanford.edu/) — free course: Language Modeling from Scratch: build every piece of an LLM yourself. - [FSDL LLM Bootcamp](https://fullstackdeeplearning.com/llm-bootcamp/) — free course: Full Stack Deep Learning's free lectures on shipping LLM apps. - [Hugging Face Spaces](https://huggingface.co/spaces) — hosting: Host your demos for free so anyone can try them. - [Machine Learning Interviews Book](https://huyenchip.com/ml-interviews-book/) — free book · Chip Huyen: How ML interviews work, plus 200+ knowledge questions. - [AI Engineering book resources](https://github.com/chiphuyen/aie-book) — GitHub · Chip Huyen: Free companion repo to the AI Engineering book: summaries, case studies, prompt examples. - [Tech Interview Handbook](https://www.techinterviewhandbook.org/) — free guide: Free guide to coding interviews, résumés, negotiation and behavioral rounds. ## Uncensored AI (21) - [huihui-ai on Hugging Face](https://huggingface.co/huihui-ai) — 159 models: One of the biggest publishers of abliterated (refusal-removed) versions of popular open models. Count from the Hugging Face API. - [Hugging Face search, "abliterated"](https://huggingface.co/models?search=abliterated) — 1,000+ results: Every model on Hugging Face with "abliterated" in its name. The Hugging Face API returns its 1,000-result page limit for this search. - [UGI Leaderboard](https://huggingface.co/spaces/DontPlanToEnd/UGI-Leaderboard) — rankings: Public leaderboard that scores how much uncensored models know and how willing they are to answer. Use it to pick before you download. - [Ollama search, "uncensored"](https://ollama.com/search?q=uncensored) — one command each: Uncensored models packaged for Ollama, from the official library and community uploads. - [Heretic](https://github.com/p-e-w/heretic) — open source tool: "Training-free language model modification: remove censorship, suppress slop, reduce sycophancy." The tool behind many "heretic" model uploads. - [Dolphin 3.0](https://ollama.com/library/dolphin3) — 8B: Dolphin 3.0 Llama 3.1 8B: a general-purpose local model for coding, math, agentic and function-calling use. Command: `ollama run dolphin3` - [Dolphin Mixtral](https://ollama.com/library/dolphin-mixtral) — 8x7B · 8x22B: Uncensored fine-tunes of Mixtral that excel at coding. Created by Eric Hartford. Command: `ollama run dolphin-mixtral` - [Dolphin Mistral](https://ollama.com/library/dolphin-mistral) — 7B: The uncensored Dolphin model based on Mistral that excels at coding tasks. Updated to version 2.8. Command: `ollama run dolphin-mistral` - [Dolphin Phi](https://ollama.com/library/dolphin-phi) — 2.7B · tiny: 2.7B uncensored Dolphin model based on Microsoft's Phi. Small enough for older laptops. Command: `ollama run dolphin-phi` - [DolphinCoder](https://ollama.com/library/dolphincoder) — 7B · 15B: Uncensored Dolphin variant that excels at coding, based on StarCoder2. Command: `ollama run dolphincoder` - [Wizard Vicuna Uncensored](https://ollama.com/library/wizard-vicuna-uncensored) — 7B · 13B · 30B: Wizard Vicuna Uncensored by Eric Hartford, based on Llama 2. Command: `ollama run wizard-vicuna-uncensored` - [Llama 2 Uncensored](https://ollama.com/library/llama2-uncensored) — classic: Uncensored Llama 2 model by George Sung and Jarrad Hope. Command: `ollama run llama2-uncensored` - [Ollama](https://ollama.com/download) — Mac · Windows · Linux: Run any model above with one command. Also exposes a local OpenAI-style API for your own apps. - [Jan](https://www.jan.ai/) — open source: Open-source alternative to ChatGPT that runs 100% offline on your computer. - [LM Studio](https://lmstudio.ai/) — desktop app: Desktop app to download and chat with local open models, with a built-in model browser. - [GPT4All](https://github.com/nomic-ai/gpt4all) — open source: "Run local LLMs on any device. Open-source and available for commercial use." - [KoboldCpp](https://github.com/LostRuins/koboldcpp) — one file: Run GGUF models locally with a KoboldAI UI. One file, zero install. - [llamafile](https://github.com/mozilla-ai/llamafile) — single file: Distribute and run LLMs with a single file. From Mozilla. - [llama.cpp](https://github.com/ggml-org/llama.cpp) — the engine: LLM inference in C/C++. The engine most local apps are built on. - [Open WebUI](https://github.com/open-webui/open-webui) — ChatGPT-style UI: Self-hosted, ChatGPT-style interface. Supports Ollama and any OpenAI-compatible API. - [Google AI Edge Gallery](https://github.com/google-ai-edge/gallery) — phone · offline: Google's app to try and use models locally on your phone, no internet needed. ## Offline AI (21) - [Qwen3.8 27B](https://ollama.com/library/qwen3.8) — 18 GB download: Big gains in coding, research and long-horizon agentic tasks. Best pick if your machine has plenty of memory. Command: `ollama run qwen3.8` - [Gemma 4 (E4B)](https://ollama.com/library/gemma4) — 6.6–9.5 GB · 128K ctx: Google's Gemma 4, text + image input, built for reasoning, agents and coding. The default tag runs on a 16 GB laptop. Command: `ollama run gemma4` - [Gemma 4 12B](https://ollama.com/library/gemma4/tags) — 7.7–8.0 GB · 256K ctx: Same family, bigger brain and a 256K context window. Text + image input. Command: `ollama run gemma4:12b` - [gpt-oss 20B](https://ollama.com/library/gpt-oss/tags) — 14 GB download: OpenAI's open-weight model for reasoning and agentic tasks. Runs fully offline. Command: `ollama run gpt-oss:20b` - [gpt-oss 120B](https://ollama.com/library/gpt-oss/tags) — 65 GB download: The big one. Needs a high-memory workstation or Mac. Command: `ollama run gpt-oss:120b` - [DeepSeek-R1 8B](https://ollama.com/library/deepseek-r1/tags) — 5.2 GB download: Open reasoning model family. The 8B fits most laptops and shows its thinking. Command: `ollama run deepseek-r1:8b` - [Qwen3.6 27B](https://ollama.com/library/qwen3.6/tags) — 18–19 GB · 256K ctx: Upgrades in agentic coding and thinking preservation over earlier Qwen models. Command: `ollama run qwen3.6:27b` - [Qwen3-Coder 30B](https://ollama.com/library/qwen3-coder/tags) — 19 GB download: Long-context model built for agentic coding. Plug it into a local coding agent. Command: `ollama run qwen3-coder:30b` - [Devstral Small 2](https://ollama.com/library/devstral-small-2) — 15 GB download: 24B model that uses tools to explore codebases and edit multiple files. Made for software agents. Command: `ollama run devstral-small-2` - [GLM-4.7-Flash](https://ollama.com/library/glm-4.7-flash) — 19 GB download: Pitched by its makers as the strongest model in the 30B class, built for lightweight deployment. Command: `ollama run glm-4.7-flash` - [Phi-4 14B](https://ollama.com/library/phi4) — 9.1 GB download: Microsoft's 14B open model. Strong for its size on a 16 GB machine. Command: `ollama run phi4` - [Phi-4-mini](https://ollama.com/library/phi4-mini) — 2.5 GB download: 3.8B with multilingual support, reasoning, math and function calling. Command: `ollama run phi4-mini` - [Llama 3.2 3B](https://ollama.com/library/llama3.2) — 2.0 GB download: Meta's small model. Fast on almost any laptop. Command: `ollama run llama3.2` - [Llama 3.2 1B](https://ollama.com/library/llama3.2/tags) — 1.3 GB download: Runs on old laptops. Great for quick summaries and rewrites. Command: `ollama run llama3.2:1b` - [Qwen3.5 4B](https://ollama.com/library/qwen3.5/tags) — 3.3–4.0 GB · 256K ctx: Small multimodal model with text + image input and a huge context window. Command: `ollama run qwen3.5:4b` - [Ministral 3 8B](https://ollama.com/library/ministral-3/tags) — 6.0 GB download: Mistral's edge family, made to run on a wide range of hardware. Command: `ollama run ministral-3:8b` - [Qwen3-VL 8B](https://ollama.com/library/qwen3-vl/tags) — 6.2 GB download: Qwen's most powerful vision-language family. Read screenshots, charts and photos offline. Command: `ollama run qwen3-vl:8b` - [GLM-OCR](https://ollama.com/library/glm-ocr) — 2.7 GB download: Multimodal OCR for complex documents. Turn PDFs and scans into text locally. Command: `ollama run glm-ocr` - [Moondream 2](https://ollama.com/library/moondream) — 1.7 GB download: Tiny vision model made for edge devices. Command: `ollama run moondream` - [TranslateGemma 4B](https://ollama.com/library/translategemma) — 3.3 GB download: Open translation model built on Gemma 3. 55 languages, no internet needed. Command: `ollama run translategemma` - [nomic-embed-text](https://ollama.com/library/nomic-embed-text) — 274 MB download: Embedding model with a large context window. The base for chatting with your own files. Command: `ollama run nomic-embed-text` ## Free coding agents (19) - [OpenCode](https://github.com/anomalyco/opencode) — terminal coding agent: "The open source coding agent." Install script, Homebrew or desktop app. Command: `curl -fsSL https://opencode.ai/v2/install | bash` - [Cline](https://github.com/cline/cline) — SDK · IDE · CLI: Autonomous coding agent. Documented support for local models via Ollama / LM Studio. Command: `npm i -g cline` - [Aider](https://github.com/Aider-AI/aider) — pair programmer in your terminal: Connects to almost any LLM, including local models. Apache-2.0. Command: `python -m pip install aider-install` - [Goose](https://github.com/aaif-goose/goose) — runs local models in-process: Loads supported local models directly, no Ollama needed, or connects to 85+ providers. Command: `curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash` - [Crush](https://github.com/charmbracelet/crush) — agent for every terminal: From Charm. Auto-discovers models from Ollama, llama.cpp, LM Studio and more. Command: `brew install charmbracelet/tap/crush` - [Kilo Code](https://github.com/Kilo-Org/kilocode) — all-in-one agentic platform: "The all-in-one agentic engineering platform." CLI via npm, Homebrew or install script. MIT. Command: `npm install -g @kilocode/cli` - [OpenAI Codex CLI](https://github.com/openai/codex) — lightweight terminal agent: OpenAI's coding agent that runs in your terminal. Apache-2.0. Command: `npm install -g @openai/codex` - [Qwen Code](https://github.com/QwenLM/qwen-code) — agent that lives in your terminal: Open-source terminal coding agent from the Qwen team. Command: `npm install -g @qwen-code/qwen-code@latest` - [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) — reads, edits, runs shell: Works out of the box with Kimi models and can use other compatible providers. No Node.js required. Command: `curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash` - [Mistral Vibe](https://github.com/mistralai/mistral-vibe) — minimal CLI agent: Mistral's own command-line coding agent. Command: `curl -LsSf https://mistral.ai/vibe/install.sh | bash` - [OpenHands](https://github.com/OpenHands/OpenHands) — run many agents in one place: Run OpenHands, Claude Code, Codex, OpenCode or any ACP agent locally, in Docker or on VMs. Command: `npm install -g @openhands/agent-canvas` - [mini-swe-agent](https://github.com/SWE-agent/mini-swe-agent) — 100-line agent: The radically simple agent that solves GitHub issues or helps in your command line. Command: `pip install mini-swe-agent` - [Continue](https://marketplace.visualstudio.com/items?itemName=Continue.continue) — CLI · VS Code · JetBrains: Open-source coding agent, Apache-2.0. The team shipped a final 2.0.0 release. - [Tabby](https://github.com/TabbyML/tabby) — self-hosted coding assistant: Self-hosted AI coding assistant: run your own server on your own GPU. Command: `docker run -it --gpus all -p 8080:8080 -v $HOME/.tabby:/data tabbyml/tabby serve --model StarCoder-1B --device cuda --chat-model Qwen2-1.5B-Instruct` - [Plandex](https://github.com/plandex-ai/plandex) — built for large projects: Open-source agent designed for big, real-world codebases. MIT. (Last repo update Oct 2025.) Command: `curl -sL https://plandex.ai/install.sh | bash` - [Qwen3-Coder 30B](https://ollama.com/library/qwen3-coder/tags) — 19 GB · free brain: Long-context agentic coding model. Point Cline, Crush or Aider at it via Ollama. Command: `ollama run qwen3-coder:30b` - [Devstral Small 2](https://ollama.com/library/devstral-small-2) — 15 GB · free brain: 24B model made to explore codebases and edit multiple files for software agents. Command: `ollama run devstral-small-2` - [Qwen3.6 27B](https://ollama.com/library/qwen3.6/tags) — 18–19 GB · free brain: Upgraded agentic coding and thinking preservation. 256K context. Command: `ollama run qwen3.6:27b` - [gpt-oss 20B](https://ollama.com/library/gpt-oss/tags) — 14 GB · free brain: OpenAI open-weight model for reasoning and agentic tasks. The lightest brain here. Command: `ollama run gpt-oss:20b` ## Free AI credits (18) - [Google Cloud](https://cloud.google.com/free) — $300 free credit: New customers get $300 to try Google Cloud products, plus monthly free usage of AI APIs that does not count against the $300. - [Oracle Cloud](https://www.oracle.com/cloud/free/) — US$300 credit · 30 days: Use it on all OCI services for 30 days. If you do nothing after, you keep the Always Free services. - [Microsoft Azure](https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account) — $200 credit · 30 days: Free account gets $200 to use on Azure services within 30 days, plus 65+ always-free services. - [AWS Free Tier](https://aws.amazon.com/free/) — up to $200 in credits: $100 immediately on a new Free plan account, up to $100 more as you explore services. Free plan closes after 6 months or when credits run out. - [Deepgram](https://deepgram.com/pricing) — $200 free credit: No credit card required and it does not expire. Deepgram says it covers roughly 43,000 minutes of Nova-3 transcription. - [AssemblyAI](https://www.assemblyai.com/pricing) — 185 hrs free transcription: Free tier: up to 185 hours of pre-recorded and up to 333 hours of streaming transcription. No credit card required. - [ElevenLabs](https://elevenlabs.io/pricing) — 10k credits / month: Free plan covers text to speech, speech to text, sound effects, voice design and music, every month. - [Gemini API (Google AI Studio)](https://aistudio.google.com) — free tier: Free input and output tokens on a limited set of models, with Google AI Studio access. Upgrade only when you need volume. - [OpenRouter :free models](https://openrouter.ai/models) — 50 free requests / day: Model IDs ending in :free: 20 requests/min and 50/day. Buy at least 10 credits once and the daily cap rises to 1,000. - [Cerebras Inference](https://www.cerebras.ai/pricing) — $5 one-time credit: Add a payment method to get a $5 promo credit, valid 30 days. You are not charged or auto-enrolled in paid usage. - [Cohere](https://dashboard.cohere.com) — 1,000 API calls / month: Trial (evaluation) keys are free. Good for testing Command models and embeddings before paying. - [Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) — 10,000 Neurons / day: Free allocation on both Free and Paid Workers plans. Run open models at the edge without a GPU. - [Kaggle Notebooks](https://www.kaggle.com/code) — 30 GPU hours / week: Free NVIDIA P100 GPUs. The quota resets weekly and is 30 hours or sometimes higher. - [Google Colab](https://colab.research.google.com) — free GPUs & TPUs: Hosted Jupyter notebooks with free-of-charge GPU and TPU access (usage limits apply). - [Lightning AI](https://lightning.ai/pricing) — up to 50 free GPU hours: Free tier starts you with up to 50 GPU hours, then pay-as-you-go. - [Modal](https://modal.com/pricing) — $30 / month free credits: Starter plan is $0 + compute and includes $30 of free credits every month. Serverless GPUs for agents and jobs. - [GitHub Copilot Free](https://github.com/features/copilot/plans) — 2,000 completions / month: Includes access to Haiku 4.5, GPT-5 mini and more. No credit card required. - [v0 by Vercel](https://v0.app) — $5 one-time credit: New users on the one-time Free credit offer get $5 once per personal or team account. ## Quant bot math (70 formulas) Education only, not financial advice. Formulas are the textbook versions; real markets break their assumptions (fat tails, regime changes, costs). Test everything on paper before risking money. ### 01. Returns - [Simple return](https://openvibes.si/quant-math#simple-return): $R_t = \frac{P_t - P_{t-1}}{P_{t-1}} = \frac{P_t}{P_{t-1}} - 1$ — The percentage change from one bar to the next. Bot use: P&L and portfolio returns: simple returns add across assets, so a portfolio return is the weighted sum $R_p = \sum_i w_i R_i$. - [Log return](https://openvibes.si/quant-math#log-return): $r_t = \ln\frac{P_t}{P_{t-1}} = \ln(1 + R_t)$ — The continuously compounded return. Log returns add over time: the return over many bars is the sum of the bar returns. Bot use: Most models (volatility, z-scores, regressions) run on log returns because they are additive in time and closer to symmetric. - [Compounding and annualized return (CAGR)](https://openvibes.si/quant-math#compounding): $\text{CAGR} = \Big(\prod_{t=1}^{n}(1+R_t)\Big)^{N/n} - 1$ — The constant yearly growth rate that turns your start equity into your end equity. N is bars per year (252 trading days, 365 for crypto daily, 8760 for crypto hourly). Bot use: The headline return number in every backtest report, and the numerator of the Calmar ratio. - [Volatility drag](https://openvibes.si/quant-math#volatility-drag): $\mathbb{E}[\text{log growth}] \approx \mu - \tfrac{1}{2}\sigma^2$ — Compound growth is lower than the average return. The bigger the swings, the bigger the gap. Bot use: Why leverage has a ceiling: doubling leverage doubles μ but quadruples σ²/2. It is the reason the Kelly criterion exists. ### 02. Volatility and variance - [Sample variance and standard deviation](https://openvibes.si/quant-math#variance-std): $\begin{gathered}\hat\sigma^2 = \frac{1}{n-1}\sum_{t=1}^{n}(r_t - \bar r)^2 \\[4pt] \hat\sigma = \sqrt{\hat\sigma^2}\end{gathered}$ — The average squared distance from the mean (n−1 corrects the bias of using the sample mean). Bot use: The default risk estimate for each asset and the denominator of the Sharpe ratio and z-scores. - [Annualizing volatility (square-root-of-time)](https://openvibes.si/quant-math#annualized-vol): $\sigma_{\text{annual}} = \sigma_{\text{period}}\sqrt{N}$ — If returns are independent, variance grows linearly with time, so volatility grows with the square root of time. Bot use: Converting a 1-minute or daily vol into the yearly number used in risk limits and option pricing. - [EWMA volatility (RiskMetrics)](https://openvibes.si/quant-math#ewma-vol): $\sigma_t^2 = \lambda\,\sigma_{t-1}^2 + (1-\lambda)\,r_{t-1}^2$ — An exponentially weighted variance: recent returns count more. RiskMetrics used λ = 0.94 for daily data. Bot use: A cheap, always-updating vol estimate for live position sizing and vol targeting. - [GARCH(1,1)](https://openvibes.si/quant-math#garch): $\begin{gathered}\sigma_t^2 = \omega + \alpha\,\varepsilon_{t-1}^2 + \beta\,\sigma_{t-1}^2 \\[4pt] \bar\sigma^2 = \frac{\omega}{1-\alpha-\beta}\end{gathered}$ — Volatility clusters: calm follows calm, storms follow storms. GARCH adds a long-run level that vol reverts to (needs α + β < 1). Bot use: Forecasting tomorrow's vol for sizing and risk, and spotting when the market is in a high-vol regime. ### 03. Mean, z-score and significance - [Z-score](https://openvibes.si/quant-math#z-score): $z_t = \frac{x_t - \mu_t}{\sigma_t}$ — How many standard deviations a value is from its (rolling) mean. Bot use: The standard mean-reversion trigger: enter when |z| > 2, exit when z crosses back near 0. Also used to normalize features. - [Standard error of the mean](https://openvibes.si/quant-math#standard-error): $\text{SE}(\bar r) = \frac{\sigma}{\sqrt{n}}$ — How uncertain your estimate of the average return is. Halving it takes 4× the data. Bot use: Tells you whether the average trade is distinguishable from zero. - [t-statistic of the mean](https://openvibes.si/quant-math#t-stat): $t = \frac{\bar r}{\hat\sigma/\sqrt{n}}$ — Signal-to-noise of the average return. Rule of thumb: |t| > 2 is weak evidence, and with many tested ideas you need far more (around 3). Bot use: A quick significance check on a strategy's per-trade or per-day P&L. - [t-stat of a Sharpe ratio](https://openvibes.si/quant-math#sharpe-t): $t \approx \text{SR}_{\text{annual}}\times\sqrt{\text{years}}$ — A Sharpe ratio is a mean divided by a std, so its significance grows with the square root of the sample length. Bot use: Sanity check for a backtest: annual Sharpe 1 over 4 years gives t ≈ 2, borderline. ### 04. Covariance and correlation - [Covariance](https://openvibes.si/quant-math#covariance): $\operatorname{Cov}(X,Y) = \mathbb{E}\big[(X-\mu_X)(Y-\mu_Y)\big]$ — Positive when two series tend to be above their means at the same time. Bot use: The building block of portfolio risk and of hedge ratios. - [Pearson correlation](https://openvibes.si/quant-math#pearson-correlation): $\rho_{XY} = \frac{\operatorname{Cov}(X,Y)}{\sigma_X\,\sigma_Y} \in [-1, 1]$ — Covariance rescaled to −1…1, so you can compare across assets. Bot use: Choosing pair candidates, checking that new signals are not just old ones, and watching for correlations jumping toward 1 in a crash. - [Portfolio variance](https://openvibes.si/quant-math#portfolio-variance): $\begin{gathered}\sigma_p^2 = w^\top \Sigma\, w = \sum_i\sum_j w_i w_j \Sigma_{ij}\end{gathered}$ — Total risk of a book given weights w and covariance matrix Σ. For two assets: $w_1^2\sigma_1^2 + w_2^2\sigma_2^2 + 2w_1w_2\rho\sigma_1\sigma_2$. Bot use: Risk checks before every rebalance, and the objective in mean-variance optimizers. - [Covariance shrinkage (Ledoit–Wolf)](https://openvibes.si/quant-math#shrinkage): $\hat\Sigma = \delta F + (1-\delta) S, \qquad 0 \le \delta \le 1$ — Blend the noisy sample covariance S with a simple structured target F. Ledoit–Wolf picks δ from the data. Bot use: With many assets and little history, raw S makes optimizers bet on noise. Shrinkage gives stabler weights. ### 05. Regression, beta and alpha - [OLS regression](https://openvibes.si/quant-math#ols): $\hat\beta = (X^\top X)^{-1} X^\top y$ — The coefficients that minimize squared errors. With one regressor: $\hat\beta = \operatorname{Cov}(x,y)/\operatorname{Var}(x)$. Bot use: Hedge ratios, factor exposures and linear signal models. - [Beta](https://openvibes.si/quant-math#beta): $\beta_i = \frac{\operatorname{Cov}(r_i, r_m)}{\operatorname{Var}(r_m)}$ — How much an asset moves per 1% move in the market (or any benchmark). Bot use: Market-neutral bots short β units of the index per unit of the asset to remove market risk. - [CAPM and Jensen's alpha](https://openvibes.si/quant-math#capm-alpha): $\alpha_i = \bar r_i - \big[r_f + \beta_i(\bar r_m - r_f)\big]$ — Return beyond what the market exposure alone would have paid. Bot use: Checks whether a strategy has real edge or is just leveraged beta. - [R²](https://openvibes.si/quant-math#r-squared): $R^2 = 1 - \frac{\sum (y_t - \hat y_t)^2}{\sum (y_t - \bar y)^2}$ — Share of variance the model explains. In markets a tiny R² (1%) can still be a tradable edge. Bot use: Comparing signal models, and checking how much of a book is just factor exposure. ### 06. Stationarity, cointegration and pairs - [Augmented Dickey–Fuller test](https://openvibes.si/quant-math#adf): $\begin{gathered}\Delta y_t = a + \gamma\,y_{t-1} + \sum_{i=1}^{p}\delta_i\,\Delta y_{t-i} + \varepsilon_t \\[4pt] H_0: \gamma = 0 \;\;(\text{unit root})\end{gathered}$ — If γ is significantly negative the series pulls back toward its mean (stationary). Prices usually fail; returns usually pass. Bot use: Screen candidate spreads before trading them as mean-reverting. - [Engle–Granger cointegration](https://openvibes.si/quant-math#engle-granger): $y_t = \alpha + \beta x_t + u_t, \qquad u_t \sim I(0)$ — Two non-stationary prices are cointegrated if some linear combination of them (the spread u) is stationary. Bot use: Pairs trading: long y and short β·x when the spread is low, the reverse when it is high. - [Spread z-score trading rule](https://openvibes.si/quant-math#spread-z): $\begin{gathered}s_t = y_t - \beta x_t, \qquad z_t = \frac{s_t-\mu_s}{\sigma_s} \\[4pt] \text{position}_t = \begin{cases}-1 & z_t > z_{\text{in}}\\ +1 & z_t < -z_{\text{in}}\\ 0 & |z_t| < z_{\text{out}}\\ \text{position}_{t-1} & \text{otherwise}\end{cases}\end{gathered}$ — Sell the spread when it is stretched high, buy it when stretched low, flatten when it returns to normal (otherwise keep yesterday's position). Bot use: The core loop of a stat-arb bot. Typical values: z_in = 2, z_out = 0.5. - [Half-life of mean reversion](https://openvibes.si/quant-math#half-life-ar1): $\begin{gathered}\Delta s_t = c + \lambda\, s_{t-1} + \varepsilon_t \\[4pt] t_{1/2} = -\frac{\ln 2}{\ln(1+\lambda)} \approx -\frac{\ln 2}{\lambda}\end{gathered}$ — How many bars it takes for a deviation to shrink by half. λ must be negative. Bot use: Sets lookback windows and max holding time. A 3-day half-life suits a daily bot; a 3-month one ties up capital. ### 07. Mean reversion: Ornstein–Uhlenbeck - [Ornstein–Uhlenbeck process](https://openvibes.si/quant-math#ou-sde): $dX_t = \theta(\mu - X_t)\,dt + \sigma\,dW_t$ — X drifts toward μ at speed θ while being shaken by noise of size σ. Bot use: The standard model for a pairs spread, a basis, or a funding-rate deviation. - [Exact discretization and fitting](https://openvibes.si/quant-math#ou-discrete): $\begin{gathered}X_{t+\Delta} = \mu + (X_t-\mu)\,e^{-\theta\Delta} + \varepsilon \\[4pt] \operatorname{Var}(\varepsilon) = \frac{\sigma^2}{2\theta}\big(1-e^{-2\theta\Delta}\big)\end{gathered}$ — Sampled at fixed steps, OU is an AR(1): regress $X_{t+1} = a + bX_t$, then $\theta = -\ln b/\Delta$ and $\mu = a/(1-b)$. Bot use: Fit θ, μ, σ from data with one linear regression. - [OU half-life and equilibrium width](https://openvibes.si/quant-math#ou-half-life): $\begin{gathered}t_{1/2} = \frac{\ln 2}{\theta}, \qquad \sigma_{\infty} = \frac{\sigma}{\sqrt{2\theta}}\end{gathered}$ — How fast it comes back, and how wide it swings around μ in the long run. Bot use: Entry bands are usually set in units of σ∞ (e.g. enter at μ ± 2σ∞). ### 08. Momentum and trend - [Moving averages (SMA and EMA)](https://openvibes.si/quant-math#moving-averages): $\begin{gathered}\text{SMA}_t = \frac{1}{n}\sum_{i=0}^{n-1}P_{t-i} \\[4pt] \text{EMA}_t = \alpha P_t + (1-\alpha)\,\text{EMA}_{t-1} \\[4pt] \alpha = \frac{2}{n+1}\end{gathered}$ — Smoothed price. The EMA reacts faster because it weights recent prices more. Bot use: Crossover signal: long when the fast average is above the slow one, $\text{signal} = \operatorname{sign}(\text{MA}_{\text{fast}} - \text{MA}_{\text{slow}})$. - [Time-series momentum with vol scaling](https://openvibes.si/quant-math#tsmom): $w_t = \operatorname{sign}\!\Big(\sum_{i=1}^{L} r_{t-i}\Big)\cdot\frac{\sigma_{\text{target}}}{\hat\sigma_t}$ — Go long if the asset's own past return over L bars is positive, short if negative, and size so every position carries the same risk. Bot use: The classic managed-futures rule (Moskowitz, Ooi and Pedersen, 2012 use a 12-month lookback). - [Cross-sectional momentum](https://openvibes.si/quant-math#xsmom): $\begin{gathered}w_{i,t} \propto \operatorname{rank}\big(R_{i,\,t-L:t-1}\big) - \tfrac{N+1}{2} \\[4pt] \textstyle\sum_i w_{i,t} = 0\end{gathered}$ — Rank assets by past return; buy the winners, short the losers, dollar-neutral. Bot use: Equity and crypto rotation bots. Skipping the most recent bar avoids short-term reversal. ### 09. Kalman filter - [Predict step](https://openvibes.si/quant-math#kalman-predict): $\begin{gathered}\hat x_{t|t-1} = F\,\hat x_{t-1} \\[4pt] P_{t|t-1} = F P_{t-1} F^\top + Q\end{gathered}$ — Roll the estimate forward and grow its uncertainty by the process noise Q. Bot use: Each bar, before seeing the new price. - [Update step](https://openvibes.si/quant-math#kalman-update): $\begin{gathered}K_t = P_{t|t-1}H^\top\big(H P_{t|t-1} H^\top + R\big)^{-1} \\[4pt] \hat x_t = \hat x_{t|t-1} + K_t\big(y_t - H\hat x_{t|t-1}\big) \\[4pt] P_t = (I - K_t H)\,P_{t|t-1}\end{gathered}$ — Blend prediction and new observation, weighted by how much you trust each (the Kalman gain K). Bot use: Dynamic hedge ratio for pairs: state x = β, observation y_t = price of A, H = price of B. The residual $y_t - H\hat x$ is the live spread. ### 10. Performance metrics - [Sharpe ratio](https://openvibes.si/quant-math#sharpe): $\text{SR} = \frac{\mathbb{E}[r - r_f]}{\sigma(r - r_f)}\sqrt{N}$ — Excess return per unit of volatility, annualized with N bars per year. Bot use: The default score for comparing strategies and allocating capital. - [Sortino ratio](https://openvibes.si/quant-math#sortino): $\text{Sortino} = \frac{\mathbb{E}[r] - \tau}{\sqrt{\mathbb{E}\big[\min(0,\, r-\tau)^2\big]}}\sqrt{N}$ — Like Sharpe, but only downside moves (below target τ) count as risk. Bot use: Fairer for strategies with big upside spikes, such as option buying or trend following. - [Maximum drawdown](https://openvibes.si/quant-math#max-drawdown): $\text{MDD} = \max_{t}\Big(1 - \frac{W_t}{\max_{s\le t} W_s}\Big)$ — The worst peak-to-trough loss of the equity curve W. Bot use: Kill switches and risk limits: stop trading if live drawdown exceeds, say, 1.5× the backtest MDD. - [Calmar ratio](https://openvibes.si/quant-math#calmar): $\text{Calmar} = \frac{\text{CAGR}}{\text{MDD}}$ — Yearly growth per unit of worst drawdown (classically measured over 36 months). Bot use: Ranks strategies by how painful they are to hold. - [Information ratio](https://openvibes.si/quant-math#information-ratio): $\text{IR} = \frac{\mathbb{E}[r - b]}{\sigma(r - b)}\sqrt{N}$ — Sharpe of the excess return over a benchmark b (σ(r − b) is the tracking error). Bot use: Scoring a bot that is meant to beat an index or a buy-and-hold baseline. ### 11. Kelly criterion and position sizing - [Kelly for a binary bet](https://openvibes.si/quant-math#kelly-binary): $f^* = p - \frac{1-p}{b} = \frac{bp - q}{b}$ — Bet this fraction of capital when you win b per 1 staked with probability p (q = 1 − p). Bot use: Sizing bets with fixed payoffs: prediction markets, binary options, take-profit/stop-loss setups with a known hit rate. - [Kelly for continuous returns](https://openvibes.si/quant-math#kelly-continuous): $\begin{gathered}f^* = \frac{\mu - r_f}{\sigma^2} \\[4pt] w^* = \Sigma^{-1}(\mu - r_f)\end{gathered}$ — Optimal leverage is excess return over variance; for many assets, the inverse covariance times the excess returns. Bot use: Upper bound on leverage. Full Kelly is very volatile and μ is uncertain, so bots use half Kelly or less. - [Volatility targeting](https://openvibes.si/quant-math#vol-targeting): $\text{size}_t = \frac{\sigma_{\text{target}}}{\hat\sigma_t}\times\text{capital}$ — Scale exposure so the position's expected volatility stays constant. Bot use: Keeps risk steady as markets calm down or blow up; used by most systematic funds. - [Fixed-fractional risk per trade](https://openvibes.si/quant-math#fixed-fractional): $\text{qty} = \frac{\text{risk\%}\times\text{equity}}{|P_{\text{entry}} - P_{\text{stop}}|}$ — Size so that hitting your stop loses a fixed share of equity (e.g. 1%). Bot use: The default for discretionary-style bots with explicit stops. ### 12. Risk: VaR and expected shortfall - [Parametric (normal) VaR](https://openvibes.si/quant-math#parametric-var): $\begin{gathered}\text{VaR}_\alpha = V\,\big(z_\alpha\,\sigma - \mu\big) \\[4pt] z_{0.95} = 1.645, \qquad z_{0.99} = 2.326\end{gathered}$ — The loss you expect to exceed only (1 − α) of the time, assuming normal returns. Bot use: Fast pre-trade risk limits. - [Historical VaR](https://openvibes.si/quant-math#historical-var): $\text{VaR}_\alpha = -\,Q_{1-\alpha}(r)\times V$ — Take the empirical (1 − α) quantile of past returns. No normality assumption. Bot use: Captures fat tails that the normal model misses. - [Expected shortfall (CVaR)](https://openvibes.si/quant-math#expected-shortfall): $\begin{gathered}\text{ES}_\alpha = -\,\mathbb{E}\big[r \mid r \le -\text{VaR}_\alpha\big] \\[4pt] \text{ES}^{\text{normal}}_\alpha = \sigma\,\frac{\varphi(z_\alpha)}{1-\alpha} - \mu\end{gathered}$ — The average loss on the days that are worse than VaR. For a normal at 95%, ES ≈ 2.06σ versus VaR = 1.645σ. Bot use: Better tail measure for strategies that sell insurance (short options, market making). - [Scaling VaR over a horizon](https://openvibes.si/quant-math#var-scaling): $\text{VaR}_{h} \approx \text{VaR}_{1}\sqrt{h}$ — Under independent returns (and μ ≈ 0), h-day VaR grows with √h. Bot use: Converting a 1-day limit into a 10-day one. Breaks down when returns are autocorrelated. ### 13. Order book microstructure and execution - [Mid price and spread](https://openvibes.si/quant-math#mid-spread): $\begin{gathered}m = \frac{P_{\text{bid}} + P_{\text{ask}}}{2} \\[4pt] \text{spread}_{\text{bps}} = \frac{P_{\text{ask}} - P_{\text{bid}}}{m}\times 10^4\end{gathered}$ — The reference price, and the cost of crossing the book. A market round trip pays the full spread. Bot use: Every quote, fill and P&L mark is measured against the mid. - [Order-book imbalance](https://openvibes.si/quant-math#imbalance): $I = \frac{Q_{\text{bid}}}{Q_{\text{bid}} + Q_{\text{ask}}} \in [0,1]$ — Share of resting size on the bid. Near 1: buyers stacked, the next move is more likely up. Bot use: One of the strongest very-short-horizon signals in liquid markets. - [Weighted mid (imbalance-adjusted price)](https://openvibes.si/quant-math#weighted-mid): $P_{\text{w}} = I\,P_{\text{ask}} + (1 - I)\,P_{\text{bid}}$ — Mid price tilted toward the side that is likely to be hit next. Stoikov's micro-price refines this into a proper martingale estimate. Bot use: Fair-value input for market makers and for deciding whether to cross. - [Order-flow imbalance (OFI)](https://openvibes.si/quant-math#ofi): $\begin{gathered}e_n = \mathbf{1}_{\{P^b_n \ge P^b_{n-1}\}}\,q^b_n - \mathbf{1}_{\{P^b_n \le P^b_{n-1}\}}\,q^b_{n-1} \\[4pt] \quad -\, \mathbf{1}_{\{P^a_n \le P^a_{n-1}\}}\,q^a_n + \mathbf{1}_{\{P^a_n \ge P^a_{n-1}\}}\,q^a_{n-1} \\[4pt] \text{OFI} = \textstyle\sum_n e_n\end{gathered}$ — Net pressure from changes at the best bid and ask. Summed over an interval, OFI moves the mid roughly linearly: $\Delta m \approx \beta\,\text{OFI}$ (Cont, Kukanov and Stoikov, 2014). Bot use: Short-term price prediction from L1 book updates. - [VWAP and TWAP](https://openvibes.si/quant-math#vwap-twap): $\begin{gathered}\text{VWAP} = \frac{\sum_i p_i\,q_i}{\sum_i q_i} \\[4pt] \text{TWAP: } q_k = \frac{Q}{K} \text{ every } \frac{T}{K}\end{gathered}$ — VWAP is the volume-weighted average traded price; TWAP slices an order into equal pieces over time. Bot use: Execution benchmarks and the two most common ways to work a large order. - [Slippage and implementation shortfall](https://openvibes.si/quant-math#slippage): $\begin{gathered}\text{slippage}_{\text{bps}} = s\cdot\frac{\bar P_{\text{fill}} - P_{\text{decision}}}{P_{\text{decision}}}\times 10^4 \\[4pt] s = +1 \text{ (buy)}, \quad s = -1 \text{ (sell)}\end{gathered}$ — How much worse you traded than the price when you decided to trade. Positive = cost. Bot use: Measured on every fill; the live-versus-backtest gap usually hides here. - [Square-root market impact](https://openvibes.si/quant-math#square-root-impact): $\frac{\Delta P}{P} \approx Y\,\sigma_{\text{daily}}\sqrt{\frac{Q}{V_{\text{daily}}}}$ — Impact grows with the square root of order size relative to daily volume, with Y of order 1. Trading 4× more costs about 2× more per share. Bot use: Capacity estimates and deciding how many slices or days a big order needs. ### 14. Market making: Avellaneda–Stoikov - [Reservation price](https://openvibes.si/quant-math#reservation-price): $r(s, q, t) = s - q\,\gamma\,\sigma^2\,(T - t)$ — Your personal fair price: the mid s shifted against your inventory q. Long inventory → you value the asset less → quote lower to sell it off. Bot use: Centers the quotes. γ is risk aversion, σ is volatility, T − t is time left in the session. - [Optimal spread](https://openvibes.si/quant-math#optimal-spread): $\delta^a + \delta^b = \gamma\sigma^2(T - t) + \frac{2}{\gamma}\ln\!\Big(1 + \frac{\gamma}{k}\Big)$ — Total quoted spread: an inventory-risk term plus a term from how fast fill probability decays with distance (order arrival intensity $\lambda(\delta) = Ae^{-k\delta}$). Bot use: Quote bid at r − spread/2 and ask at r + spread/2, then requote on every book update. ### 15. Options: Black–Scholes and the Greeks - [Geometric Brownian motion](https://openvibes.si/quant-math#gbm): $\begin{gathered}dS_t = \mu S_t\,dt + \sigma S_t\,dW_t \\[4pt] S_t = S_0\exp\!\Big(\big(\mu - \tfrac{1}{2}\sigma^2\big)t + \sigma W_t\Big)\end{gathered}$ — The standard model of a price: log price is a random walk with drift. Prices stay positive. Bot use: Monte Carlo simulation of paths for pricing and stress tests. - [Black–Scholes price](https://openvibes.si/quant-math#black-scholes): $\begin{gathered}C = S\,N(d_1) - K e^{-rT} N(d_2) \\[4pt] P = K e^{-rT} N(-d_2) - S\,N(-d_1) \\[4pt] d_1 = \frac{\ln(S/K) + (r + \frac{1}{2}\sigma^2)T}{\sigma\sqrt{T}} \\[4pt] d_2 = d_1 - \sigma\sqrt{T}\end{gathered}$ — Fair value of a European call (C) and put (P) under GBM with constant volatility. Bot use: Pricing, implied-vol inversion and Greeks for every option a bot touches. - [Put–call parity](https://openvibes.si/quant-math#put-call-parity): $C - P = S - K e^{-rT}$ — A call minus a put with the same strike and expiry equals a forward. No model needed. Bot use: Arbitrage checks and synthetic positions; a violation (after costs) is free money or a data error. - [The Greeks (call)](https://openvibes.si/quant-math#greeks): $\begin{gathered}\Delta = N(d_1), \qquad \Gamma = \frac{\varphi(d_1)}{S\sigma\sqrt{T}} \\[4pt] \mathcal{V} = S\,\varphi(d_1)\sqrt{T} \\[4pt] \Theta = -\frac{S\,\varphi(d_1)\,\sigma}{2\sqrt{T}} - rKe^{-rT}N(d_2)\end{gathered}$ — Sensitivities: price per $1 move (Δ), Δ change per $1 (Γ), per 1.00 of vol (vega), per year of time (Θ). φ is the normal density. Bot use: Delta hedging (hold −Δ shares per option), gamma and vega limits. - [Implied volatility (Newton's method)](https://openvibes.si/quant-math#implied-vol): $\sigma_{n+1} = \sigma_n - \frac{C_{\text{BS}}(\sigma_n) - C_{\text{market}}}{\mathcal{V}(\sigma_n)}$ — The volatility that makes the model price equal the market price, found by iterating. Bot use: Comparing implied vs realized vol is the core of volatility trading. - [Delta-hedged P&L (gamma vs theta)](https://openvibes.si/quant-math#gamma-pnl): $d\Pi \approx \tfrac{1}{2}\Gamma S^2\big(\sigma_{\text{realized}}^2 - \sigma_{\text{implied}}^2\big)\,dt$ — A delta-hedged long option makes money when the market moves more than implied vol priced in, and bleeds theta otherwise. Bot use: The P&L engine of gamma scalping and vol-arb bots. ### 16. Backtesting without fooling yourself - [No look-ahead: trade on the next bar](https://openvibes.si/quant-math#look-ahead): $\begin{gathered}\text{pnl}_t = w_{t-1}\cdot r_t \\[4pt] w_{t-1} = f(\text{data}_{\le t-1})\end{gathered}$ — A position can only use information available before the return it earns. Bot use: In pandas: compute the signal, then `.shift(1)` before multiplying by returns. - [Multiple testing](https://openvibes.si/quant-math#multiple-testing): $\begin{gathered}P(\text{any false positive}) = 1 - (1-\alpha)^N\end{gathered}$ — Test enough ideas and some will pass by luck. Bot use: Track how many variants you tried; 20 tests at 5% give a 64% chance of a fake winner. - [Standard error of the Sharpe ratio](https://openvibes.si/quant-math#sharpe-se): $\text{SE}(\widehat{\text{SR}}) \approx \sqrt{\frac{1 + \tfrac{1}{2}\widehat{\text{SR}}^2}{T}}$ — For i.i.d. normal returns (Lo, 2002), with SR and T in the same units (e.g. per-period SR, T periods). Bot use: Error bars on a backtest Sharpe. - [Probabilistic Sharpe ratio](https://openvibes.si/quant-math#psr): $\text{PSR}(\text{SR}^*) = \Phi\!\left(\frac{(\widehat{\text{SR}} - \text{SR}^*)\sqrt{T-1}}{\sqrt{1 - \gamma_3\widehat{\text{SR}} + \frac{\gamma_4 - 1}{4}\widehat{\text{SR}}^2}}\right)$ — Probability that the true Sharpe beats a benchmark SR*, adjusting for track length T, skew γ₃ and kurtosis γ₄ (non-excess; per-period SR). Bot use: Minimum bar before allocating capital: e.g. require PSR(0) > 0.95. - [Deflated Sharpe ratio](https://openvibes.si/quant-math#deflated-sharpe): $\begin{gathered}\text{SR}^*_0 = \sqrt{V[\widehat{\text{SR}}_n]}\;\times \\[4pt] \Big((1-\gamma)\,\Phi^{-1}\!\big(1 - \tfrac{1}{N}\big) + \gamma\,\Phi^{-1}\!\big(1 - \tfrac{1}{Ne}\big)\Big) \\[4pt] \text{DSR} = \text{PSR}\big(\text{SR}^*_0\big)\end{gathered}$ — The Sharpe the luckiest of N worthless strategies would show (γ ≈ 0.5772, the Euler–Mascheroni constant). DSR is the PSR against that bar (Bailey and López de Prado, 2014). Bot use: Report DSR, not raw Sharpe, after any parameter sweep. - [Walk-forward validation](https://openvibes.si/quant-math#walk-forward): $\begin{gathered}\text{train } [t_0,\, t_k) \;\to\; \text{test } [t_k + g,\; t_{k+1}) \\[4pt] k \leftarrow k + 1 \;\;(\text{roll forward})\end{gathered}$ — Fit only on the past, test on the next unseen block, roll forward. The gap g (purge/embargo) stops overlapping labels leaking. Bot use: The honest out-of-sample estimate. Shuffled k-fold leaks future information in time series. ### 17. Fees, slippage and latency - [Round-trip cost](https://openvibes.si/quant-math#round-trip-cost): $c_{\text{rt}} = 2\,(f + \tfrac{1}{2}s + \iota)$ — Per round trip you pay the fee f twice, half the spread s twice (entering and exiting at market) and impact ι twice. Everything in bps. Bot use: The hurdle every trade's expected edge must clear. - [Annual cost drag from turnover](https://openvibes.si/quant-math#cost-drag): $r_{\text{net}} \approx r_{\text{gross}} - \text{turnover}_{\text{annual}}\times c$ — Turnover × cost per unit traded comes straight off returns. c here is the one-way cost per unit of notional traded. Bot use: High-frequency signals need tiny costs: 50× annual turnover at 6 bps one-way is 3% a year. - [Break-even hit rate](https://openvibes.si/quant-math#breakeven): $p_{\text{BE}} = \frac{L + c}{W + L}$ — With average win W, average loss L (both positive) and cost c per trade, you need to win more than this share of trades. Bot use: Quick check whether a scalping rule can survive fees. - [Latency cost](https://openvibes.si/quant-math#latency-cost): $\mathbb{E}\,|\Delta P| \approx \sigma_{1\text{s}}\sqrt{\tfrac{2}{\pi}\,\Delta t}$ — For a random walk with per-second volatility σ, the expected absolute move during a delay of Δt seconds grows with √Δt (√(2/π) ≈ 0.8 is the mean of |N(0,1)|). Bot use: Sizing the value of a faster connection, or how stale a quote gets before it reaches the exchange. ### References - [MIT 18.S096: Mathematics with Applications in Finance](https://ocw.mit.edu/courses/18-s096-topics-in-mathematics-with-applications-in-finance-fall-2013/) — free course · MIT OCW: Full MIT course with video lectures: linear algebra, probability, stochastic calculus, time series, portfolio theory and Black–Scholes, taught partly by practitioners. - [3Blue1Brown: Essence of linear algebra](https://www.3blue1brown.com/topics/linear-algebra) — video series: Visual intuition for vectors, matrices, eigenvalues and change of basis, everything under covariance matrices and PCA. - [Khan Academy: Statistics and probability](https://www.khanacademy.org/math/statistics-probability) — free course: Distributions, regression, significance tests and confidence intervals from zero. - [StatQuest](https://www.youtube.com/@statquest) — YouTube: Short, clear videos on statistics and machine learning: p-values, regression, cross-validation. - [Forecasting: Principles and Practice (3rd ed.)](https://otexts.com/fpp3/) — free book: Hyndman and Athanasopoulos's free online textbook on time series: stationarity, ARIMA, exponential smoothing, evaluation. - [An Introduction to Statistical Learning](https://www.statlearning.com/) — free book: The free ISL book (R and Python editions): regression, classification, resampling and model selection. - [QuantEcon lectures](https://python.quantecon.org/) — free lectures: Open-source Python lectures on probability, Markov chains, Kalman filtering, optimization and dynamic programming. - [Kalman and Bayesian Filters in Python](https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python) — free book · GitHub: Roger Labbe's interactive Jupyter book on Kalman filters, built up from intuition. - [Kelly (1956): A New Interpretation of Information Rate](https://www.princeton.edu/~wbialek/rome/refs/kelly_56.pdf) — classic paper · PDF: The original Kelly criterion paper from Bell Labs. - [Thorp: The Kelly criterion and the stock market](https://www.edwardothorp.com/wp-content/uploads/2016/11/TheKellyCriterionAndTheStockMarket.pdf) — paper · PDF: Ed Thorp applies Kelly to investing, from his own site. - [Engle: GARCH 101](https://www.stern.nyu.edu/rengle/GARCH101.PDF) — paper · PDF: Nobel laureate Robert Engle's plain-language introduction to ARCH/GARCH volatility models. - [RiskMetrics Technical Document (1996)](https://www.msci.com/documents/10199/5915b101-4206-4ba0-aee2-3449d5c7e95a) — technical doc · PDF: J.P. Morgan/Reuters document that made VaR and EWMA volatility (λ = 0.94) an industry standard. - [Rockafellar & Uryasev: Optimization of Conditional Value-at-Risk](https://sites.math.washington.edu/~rtr/papers/rtr179-CVaR1.pdf) — paper · PDF: The paper that made CVaR (expected shortfall) easy to optimize with linear programming. - [Gatev, Goetzmann & Rouwenhorst: Pairs Trading](https://www.nber.org/papers/w7032) — NBER working paper: The classic study of a simple distance-based pairs-trading rule and its returns. - [Moskowitz, Ooi & Pedersen: Time Series Momentum](https://w4.stern.nyu.edu/facdir/lpederse/papers/TimeSeriesMomentum.pdf) — paper · PDF: Trend following across 58 futures markets, with the volatility-scaled rule used above. - [Avellaneda & Stoikov: High-frequency trading in a limit order book](https://people.orie.cornell.edu/sfs33/LimitOrderBook.pdf) — paper · PDF: The market-making model behind the reservation price and optimal spread formulas. - [Guéant, Lehalle & Fernandez-Tapia: Dealing with the inventory risk](https://arxiv.org/abs/1105.3115) — arXiv: Closed-form solutions for the Avellaneda–Stoikov problem with inventory limits. - [Cont, Kukanov & Stoikov: The Price Impact of Order Book Events](https://arxiv.org/abs/1011.6402) — arXiv: Defines order-flow imbalance and shows price changes are roughly linear in it. - [Bouchaud: Price Impact](https://arxiv.org/abs/0903.2428) — arXiv: Short review of market impact: why it is concave in volume and what that means for execution. - [Tóth et al.: Anomalous price impact and the critical nature of liquidity](https://arxiv.org/abs/1105.1694) — arXiv: Empirical evidence and a theory for the square-root impact law. - [Bailey & López de Prado: The Sharpe Ratio Efficient Frontier](https://www.davidhbailey.com/dhbpapers/sharpe-frontier.pdf) — paper · PDF: Introduces the probabilistic Sharpe ratio (PSR) and minimum track record length. - [Bailey & López de Prado: The Deflated Sharpe Ratio](https://www.davidhbailey.com/dhbpapers/deflated-sharpe.pdf) — paper · PDF: Corrects a Sharpe ratio for the number of strategies tried and for non-normal returns. - [Bailey, Borwein, López de Prado & Zhu: The Probability of Backtest Overfitting](https://www.davidhbailey.com/dhbpapers/backtest-prob.pdf) — paper · PDF: A method to estimate how likely a backtest's best configuration is overfit. - [Kenneth French Data Library](https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html) — free data: Free daily and monthly factor returns (market, size, value, momentum) to test betas and alphas against. - [statsmodels: adfuller](https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.adfuller.html) — docs: Augmented Dickey–Fuller test reference. - [statsmodels: coint](https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.coint.html) — docs: Engle–Granger cointegration test reference. - [arch (Python)](https://arch.readthedocs.io/) — docs: GARCH-family volatility models, bootstraps and unit-root tests for Python. - [SciPy stats](https://docs.scipy.org/doc/scipy/reference/stats.html) — docs: Distributions, normal CDF/PPF, skew, kurtosis and hypothesis tests. - [NumPy linear algebra](https://numpy.org/doc/stable/reference/routines.linalg.html) — docs: Solvers, inverses and eigen-decompositions for covariance and portfolio math. - [scikit-learn: LedoitWolf](https://scikit-learn.org/stable/modules/generated/sklearn.covariance.LedoitWolf.html) — docs: Ledoit–Wolf shrinkage covariance estimator. - [scikit-learn: TimeSeriesSplit](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.TimeSeriesSplit.html) — docs: Walk-forward splits with an optional gap for time-series validation. - [pandas: windowing operations](https://pandas.pydata.org/docs/user_guide/window.html) — docs: Rolling and exponentially weighted windows for z-scores, moving averages and EWMA vol. - [py_vollib](https://github.com/vollib/py_vollib) — GitHub: Fast Black–Scholes prices, Greeks and implied volatility in Python. - [QuantLib](https://www.quantlib.org/) — open-source library: The standard open-source library for pricing derivatives and fixed income. - [Quantitative Finance Stack Exchange](https://quant.stackexchange.com/) — Q&A: Free Q&A where practitioners answer quant math and modelling questions. ## Optional - [Sitemap](https://openvibes.si/sitemap.xml) - [RSS feed](https://openvibes.si/feed.xml) - [Search index (JSON)](https://openvibes.si/search.json)