소스 정보
- 저장소
- firstbatchxyz/kai
- 최근 소스 활동
- 2026년 6월 19일 14:08
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/firstbatchxyz/kai --skill aws-cli명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | aws-cli |
| description | Manage AWS services for ML workflows including S3, ECR, SageMaker, and EC2 |
| version | 1.0.0 |
| author | kai-agent |
| metadata | {"kai":{"tags":["kai","compute","aws","s3","ecr","sagemaker","ec2","ml","inference"]}} |
Skill for managing AWS services commonly used in ML and inference workflows: S3 for storage, ECR for container images, SageMaker for managed inference, and EC2 for GPU instances.
This skill uses the following environment variables:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGION (e.g., us-east-1)If they are not set, ask your admin to add them in Agent Settings.
Optionally, AWS_SESSION_TOKEN is used for temporary credentials (STS/SSO).
# AWS CLI v2
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip && sudo ./aws/install
# Python SDK
pip install boto3
# Upload a directory
aws s3 sync ./model-weights/ s3://your-bucket/models/llama-3.1-8b-awq/
# Upload a single file
aws s3 cp ./benchmark_results.json s3://your-bucket/results/benchmark_results.json
# Download a directory
aws s3 sync s3://your-bucket/models/llama-3.1-8b-awq/ ./model-weights/
# Download a single file
aws s3 cp s3://your-bucket/datasets/calibration.jsonl ./calibration.jsonl
aws s3 ls s3://your-bucket/models/ --recursive --human-readable
import boto3
s3 = boto3.client("s3")
# Automatic multipart upload for large files
from boto3.s3.transfer import TransferConfig
config = TransferConfig(
multipart_threshold=1024 * 1024 * 100, # 100 MB
max_concurrency=10,
multipart_chunksize=1024 * 1024 * 100,
)
s3.upload_file(
"./model.safetensors",
"your-bucket",
"models/llama-3.1-8b/model.safetensors",
Config=config,
)
aws s3 presign s3://your-bucket/models/llama-3.1-8b-awq/model.safetensors --expires-in 3600
url = s3.generate_presigned_url(
"get_object",
Params={"Bucket": "your-bucket", "Key": "models/model.safetensors"},
ExpiresIn=3600,
)
# Delete objects older than 30 days in the tmp/ prefix
aws s3api put-bucket-lifecycle-configuration \
--bucket your-bucket \
--lifecycle-configuration '{
"Rules": [{
"ID": "cleanup-tmp",
"Prefix": "tmp/",
"Status": "Enabled",
"Expiration": {"Days": 30}
}]
}'
aws ecr create-repository --repository-name inference-server --region us-east-1
# Authenticate Docker to ECR
aws ecr get-login-password --region us-east-1 | \
docker login --username AWS --password-stdin <account-id>.dkr.ecr.us-east-1.amazonaws.com
# Build
docker build -t inference-server:latest .
# Tag
docker tag inference-server:latest \
<account-id>.dkr.ecr.us-east-1.amazonaws.com/inference-server:latest
# Push
docker push <account-id>.dkr.ecr.us-east-1.amazonaws.com/inference-server:latest
aws ecr list-images --repository-name inference-server
docker pull <account-id>.dkr.ecr.us-east-1.amazonaws.com/inference-server:latest
import boto3
sagemaker = boto3.client("sagemaker")
# Create model
sagemaker.create_model(
ModelName="llama3-8b-vllm",
PrimaryContainer={
"Image": "<account-id>.dkr.ecr.us-east-1.amazonaws.com/inference-server:latest",
"ModelDataUrl": "s3://your-bucket/models/llama-3.1-8b-awq/model.tar.gz",
"Environment": {
"MODEL_NAME": "meta-llama/Llama-3.1-8B-Instruct",
"QUANTIZATION": "awq",
},
},
ExecutionRoleArn="arn:aws:iam::<account-id>:role/SageMakerRole",
)
# Create endpoint config
sagemaker.create_endpoint_config(
EndpointConfigName="llama3-8b-config",
ProductionVariants=[{
"VariantName": "primary",
"ModelName": "llama3-8b-vllm",
"InstanceType": "ml.g5.2xlarge",
"InitialInstanceCount": 1,
}],
)
# Create endpoint
sagemaker.create_endpoint(
EndpointName="llama3-8b-endpoint",
EndpointConfigName="llama3-8b-config",
)
runtime = boto3.client("sagemaker-runtime")
response = runtime.invoke_endpoint(
EndpointName="llama3-8b-endpoint",
ContentType="application/json",
Body='{"prompt": "Explain batching:", "max_tokens": 256}',
)
print(response["Body"].read().decode())
aws sagemaker list-endpoints --status-equals InService
aws sagemaker delete-endpoint --endpoint-name llama3-8b-endpoint
aws sagemaker delete-endpoint-config --endpoint-config-name llama3-8b-config
aws sagemaker delete-model --model-name llama3-8b-vllm
| Instance | GPU | VRAM | Use case |
|---|---|---|---|
| ml.g5.xlarge | 1x A10G | 24 GB | Quantized models up to 13B |
| ml.g5.2xlarge | 1x A10G | 24 GB | Same GPU, more CPU/RAM |
| ml.g5.12xlarge | 4x A10G | 96 GB | Multi-GPU, 70B quantized |
| ml.p4d.24xlarge | 8x A100 (40 GB) | 320 GB | Large models, high throughput |
| ml.p5.48xlarge | 8x H100 (80 GB) | 640 GB | Maximum performance |
aws ec2 run-instances \
--image-id ami-0abcdef1234567890 \
--instance-type g5.xlarge \
--key-name your-key \
--security-group-ids sg-xxxxx \
--subnet-id subnet-xxxxx \
--block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":200}}]' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=inference-dev}]'
aws ec2 describe-instances \
--filters "Name=instance-type,Values=g5.*,p4d.*,p5.*" \
"Name=instance-state-name,Values=running" \
--query 'Reservations[*].Instances[*].[InstanceId,InstanceType,LaunchTime,PublicIpAddress]' \
--output table
aws ec2 stop-instances --instance-ids i-xxxxx
aws ec2 start-instances --instance-ids i-xxxxx
aws ec2 terminate-instances --instance-ids i-xxxxx
| Instance | GPU | VRAM | On-demand $/hr (approx) |
|---|---|---|---|
| g5.xlarge | 1x A10G | 24 GB | $1.01 |
| g5.12xlarge | 4x A10G | 96 GB | $5.67 |
| g6.xlarge | 1x L4 | 24 GB | $0.80 |
| p4d.24xlarge | 8x A100 (40 GB) | 320 GB | $32.77 |
| p5.48xlarge | 8x H100 (80 GB) | 640 GB | $98.32 |
aws ec2 run-instances \
--instance-type g5.xlarge \
--instance-market-options '{"MarketType":"spot","SpotOptions":{"MaxPrice":"0.50"}}' \
--image-id ami-0abcdef1234567890 \
--key-name your-key
Spot instances cost 60-90% less but can be interrupted. Good for benchmarking and batch inference, not production serving.
import boto3
sts = boto3.client("sts")
identity = sts.get_caller_identity()
print(f"Account: {identity['Account']}, User: {identity['Arn']}")
s3 = boto3.client("s3")
buckets = s3.list_buckets()
for b in buckets["Buckets"]:
print(b["Name"])
models/llama3-8b/v2/model.safetensors).InvocationsPerInstance to handle traffic spikes.SOC 직업 분류 기준