Skip to content

Instantly share code, notes, and snippets.

View johnidm's full-sized avatar

Johni Douglas Marangon johnidm

View GitHub Profile
@johnidm
johnidm / README.md
Created October 21, 2025 12:44
Big Query ML Introduction

BigQuery ML BQML is a powerful feature within Google BigQuery that allows users to create, train, and execute machine learning models directly using SQL queries.

This approach aims to democratize machine learning by enabling SQL practitioners to build models with their existing tools, eliminating the need to move large amounts of data to separate ML frameworks or services.

BigQuery ML supports a variety of machine learning models and algorithms, catering to different analytical needs. Here's a breakdown of the types you can use:

Internally Trained Models

These models can be built directly within BigQuery ML using SQL:

@johnidm
johnidm / readme.md
Created October 15, 2025 16:48
Initialize DVC in a repo for datasets and binary model versions

Step-by-step: Initialize DVC in a repo for datasets and binary model versions

Below is a clean, practical workflow to add DVC to an existing Git repo and start versioning your data and model artifacts (e.g., large/binary files). Adjust remote choices (S3, GCS, Azure, SSH, local) to your environment.

Prerequisites:

Verify:

@johnidm
johnidm / readme.md
Last active October 10, 2025 14:00
KServe Models Format

KServe supports a wide variety of model formats across both predictive and generative AI inference.

Predictive AI Model Formats

spaCy models are not natively supported by KServe (as of 2025). However, you can serve spaCy models easily using KServe’s Python model server — the kserve SDK provides a way to deploy custom Python models (like spaCy NLP pipelines, HuggingFace models, or anything else in Python).

🧠 1. TensorFlow: TensorFlow SavedModel format (kserve-tensorflow-serving)

Formats:

@johnidm
johnidm / readme.md
Created September 23, 2025 14:43
Upload Memory Error - FastAPI

🔹 1. Use streaming instead of loading everything into memory

Instead of await file.read(), you can save the file temporarily to disk and then process it:

import tempfile
from fastapi import UploadFile, HTTPException, status

async def process_file(file: UploadFile, mode: str):
    if file.content_type != "application/pdf":
 raise HTTPException(
@johnidm
johnidm / readme.md
Created August 26, 2025 15:07
Add a weights to the fields in PostgreSQL full-text search

You can give different weights to the fields in PostgreSQL full-text search by using setweight() inside your to_tsvector.

SELECT
    id,
    title,
    area,
    tags,
    content,
    url,
@johnidm
johnidm / readme.md
Last active August 6, 2025 13:59
Standart ruff Configuration

Install the dependency

pip install ruff

Foramt files

@johnidm
johnidm / README.md
Created July 5, 2025 14:16
Interview Q&A App Prompts

Prompt One

Design and develop a modern question and answer (Q&A) web application using Next.js and TypeScript. The application should prioritize a clean user experience, efficient data management, and adherence to current web development best practices.

Don't implement user Authentication:

# Core Features:

Question Management:
@johnidm
johnidm / readme.md
Created June 7, 2025 16:01
Using LLM to processo PDF file
@johnidm
johnidm / readme.md
Created May 27, 2025 21:56
Prompt análise Linkedin

Prompt que executa uma analise no seu perfil do Linkedin com o objetivo de melhorar ele.

Passo 01

Salve o seu perfil em PDF.

Passo 02

Fazer o upload do PDF em alguma LLM e executar o prompt abaixo.

@johnidm
johnidm / readme.md
Created April 1, 2025 00:46
Unlock the Power of LLMs with Structured Output

Precise Prompting

from openai import OpenAI


api_key = "sk-proj-..."
client = OpenAI(api_key=api_key)