Skip to content

Instantly share code, notes, and snippets.

View qlawmarq's full-sized avatar
🏠
Working from home

qlawmarq

🏠
Working from home
View GitHub Profile

主要AI/LLMモデル比較表(2025年8月時点)

モデル コンテキストウィンドウ 出力トークン 価格(百万トークンあたり) 最適化・得意分野 情報源
OpenAI GPT-5 272K(入力)
400K(合計)
128K 入力: $1.25
出力: $10
統合推論システム、コーディング、マルチモーダル openai.com
GPT-5 mini 272K(入力) 128K 入力: $0.25
出力: $2
リアルタイム体験、推論 openai.com
GPT-5 nano 272K(入力) 128K 入力: $0.05
出力: $0.40
軽量タスク、最高コスト効率 openai.com
GPT-4o 128K 16.4K 入力: $2.50
出力: $10
マルチモーダル、リアルタイム音声・画像 openai.com
GPT-4o mini 128K 16.4K 入力: $0.15
出力: $0.60
高速・軽量タスク、コスト効率 openai.com
GPT-4 8K/32K 4K 入力: $30出力: $60 汎用的推論、レガシー [openai.com](https://platform.openai.co
@qlawmarq
qlawmarq / github-actions-deployer-for-google-cloud-run.yml
Created December 18, 2023 03:42
GitHub Actions: Deployer for Google Cloud Run
#####
#
# GitHub Actions will deploy your app to Cloud Run in Google Cloud Platform (GCP) when you push to master or main branch.
#
# 1. Set up your GCP project and Cloud Run service account
# 2. Ensure your service account has permissions to push images to Artifact Registry and deploy to Cloud Run.
# 3. Create a key.json file for the service account and add it to your GitHub repo as a secret. (In this example, the secret name is GCP_DEPLOYER_KEY)
# 4. Enable the Cloud Run API and Artifact Registry API in your GCP project
# 5. Add this file as .github/workflows/deployer.yml
# 6. Add a Dockerfile to your repo to build your app
@qlawmarq
qlawmarq / clone-k8s-deployment.sh
Created July 18, 2023 05:00
Clone kubernetes(k8s) deployment
# The following is an example of a command to clone an development(ex-app-development) as an production(ex-app-production).
kubectl get deployment ex-app-development -o json \
| jq '.metadata.name = "ex-app-production"' \
| kubectl apply -f -
@qlawmarq
qlawmarq / sqlchain.py
Last active June 8, 2023 00:56
Chat with SQL database (MySQL)
from langchain.llms import OpenAI
from langchain import OpenAI, SQLDatabase, SQLDatabaseChain
from langchain.prompts.prompt import PromptTemplate
import os
def chat_with_mysql_database(prompt: str):
"""
Args:
prompt (str): Question to ask e.g. "Generate an SQL query to retrieve all users"
Returns:
@qlawmarq
qlawmarq / search-github-starred-repo-by-gpt.ipynb
Last active May 16, 2023 06:07
Search GitHub Starred repo by LlamaIndex (GPT Index)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@qlawmarq
qlawmarq / Ramlethal-Valentine-clap.gif
Last active May 4, 2023 09:30
Ramlethal Valentine clap gif
Ramlethal-Valentine-clap.gif
@qlawmarq
qlawmarq / bridget-guilty-gear.gif
Last active May 4, 2023 08:55
bridget-guilty-gear
bridget-guilty-gear.gif
@qlawmarq
qlawmarq / generate_random_string.py
Created February 28, 2023 01:39
Generate Random Strings and Passwords in Python
import random
import string
def generate_random_string():
selects = random.sample(string.ascii_uppercase, 3) + random.sample(
string.digits, 3) + random.sample(string.ascii_lowercase, 3)
random.shuffle(selects)
unique_code = ''.join(selects)
print(unique_code)
return unique_code
@qlawmarq
qlawmarq / delete-old-gae.yml
Last active August 23, 2024 09:15
Remove old versions of Google App Engine with GitHub Actions
name: Remove old versions of Google App Engine
#####
#
# Add this file to .github/workflows/delete-old-gae.yml then GitHub Actions will remove old versions of Google App Engine.
#
#####
on:
workflow_dispatch:
@qlawmarq
qlawmarq / google_app_engine_deployer.yml
Last active December 18, 2023 02:41
GitHub Actions: Deployer for Node.js app to Google App Engine
name: Deployer
#####
#
# Add this file to .github/workflows/google_app_engine_deployer.yml, then GitHub Actions will detect any updates on master/main branch and deploy changes.
# This example uses Node.js 18. You can choose any language you like.
# The build command is also `npm run build', change it as you like.
#
# 1. Set up service account for deployment and create key.json and set it to env variable
# 2. Create your app.yaml if you never deploy the app to GAE