Skip to content

Instantly share code, notes, and snippets.

View erhangundogan's full-sized avatar
👋

Erhan Gundogan erhangundogan

👋
View GitHub Profile
@erhangundogan
erhangundogan / llm-model-length.md
Created September 15, 2025 15:45
LLM model length calculation

LLM memory usage = model weights + optimizer/kv-cache + activations for max tokens.

With your 8B model (~16–18 GB for FP16), asking for 10,500 tokens will likely exceed 19.5 GB, especially with --gpu-memory-utilization=0.99.

Calculation example:

  • Your model: 8B (~16 GB FP16 weights)
  • Max tokens: 10,500
  • KV-cache VRAM ≈ 10,500 × 0.0007 GB ≈ 7.35 GB additional VRAM
  • Total VRAM needed ≈ 16 GB + 7.35 GB ≈ 23.35 GB → > 19.5 GB, hence the OOM
@erhangundogan
erhangundogan / rust-abstractions.md
Created September 15, 2025 07:45
Rust Abstractions

Option<T>

Represents “something or nothing”. Optional function arguments, nullable values.

fn maybe_double(x: Option<i32>) -> Option<i32> {
    x.map(|v| v * 2)
}
assert_eq!(maybe_double(Some(3)), Some(6));
assert_eq!(maybe_double(None), None);
@erhangundogan
erhangundogan / rust-fundamentals.md
Created September 15, 2025 07:12
Rust Fundamentals

The Rust “Rule‑Book” – 7 Fundamental Principles Everyone Should Know

Why?
Rust is built around a handful of core rules that make it safe, fast, and concurrency‑friendly.
Mastering these 7 principles is enough to write idiomatic, error‑free Rust and to understand why the compiler sometimes complains.

# Principle What it means (in plain English)
1 Ownership & Single‑Owner Every value has exactly one owner. When that owner goes out of scope, the value is dropped (freed).
2 Borrowing & References You can borrow a value instead of moving it. A borrow is either immutable (&amp;T) or mutable (&amp;mut T).

Germany vs. UK – Entrepreneur Decision Matrix

Decision Matrix Table

Factor Germany UK Notes
Company Formation Speed 2 5 UK can be incorporated online in <24h; Germany often takes weeks.
Min. Capital Requirement 2 5 Germany GmbH: €25k (min €12.5k upfront); UK Ltd: £1.
Corporate Tax Burden 3 4 Germany ~30%, UK 25% (small profits 19%).
Stock Option Friendliness 2 5 UK EMI scheme very favorable; Germany improving but still complex.
@erhangundogan
erhangundogan / ai-integrations.md
Last active August 3, 2025 10:33
AI Integrations

AI Integrations – Company List

  • AI21 Labs: Israeli AI research firm built for enterprise NLP, creators of Jurassic‑1/2 models and the Wordtune writing assistant. https://www.ai21.com/
  • AionLabs: AI‑tooling startup (limited public data; possibly involved in developer integrations). Website not found.
  • Alibaba Cloud Intelligence: Alibaba Cloud’s AI‑driven cloud infrastructure and managed AI services. https://www.alibabacloud.com/
  • Amazon Bedrock: AWS-managed foundation model service offering models from Anthropic, AI21, Meta, and Stability AI, plus tools for fine‑tuning and deployment. https://aws.amazon.com/bedrock/
  • Anthropic: AI safety–focused LLM provider best known for Claude models. https://www.anthropic.com/
  • AtlasCloud: (No public company profile available.)
  • Atoma: (No official public profile found.)
  • Avian.io: (Insufficient public-facing documentation available.)
.editorconfig
.env
.lintstagedrc
.nvmrc
.yarnrc.yml
.gitignore
.prettierrc
components.json
eslint.config.mjs
nodemon.config.json
@erhangundogan
erhangundogan / incus.md
Last active August 13, 2025 21:02
Incus
@erhangundogan
erhangundogan / crond.md
Last active July 5, 2025 16:46
Alpine CronJobs

crond/crontabs

setup

# change root for other users
$ vi /etc/crontabs/root
@erhangundogan
erhangundogan / prompt-engineering.md
Created June 27, 2025 08:27
Yet Another Prompt Example

Your instructions as manager

  • You are a manager of a customer service agent.

  • You have a very important job, which is making sure that the customer service agent working for you does their job REALLY well.

  • Your task is to approve or reject a tool call from an agent and provide feedback if you reject it. The feedback can be both on the tool call specifically, but also on the general process so far and how this should be changed.

  • You will return either <manager_verify>accept</manager_verify> or <manager_feedback>reject</manager_feedback><feedback_comment>{{ feedback_comment }}</feedback_comment>

  • To do this, you should first:

  1. Analyze all and to understand the context of the ticket and you own internal thinking/results from tool calls.
@erhangundogan
erhangundogan / promptys.md
Last active June 20, 2025 09:36
Software 3.0, Prompts

You are a sentiment classifier. For every review that appears between the tags <REVIEW> ... </REVIEW> respond with exactly one word, either POSITIVE or NEGATIVE (all-caps, no punctuation, no extra text).

  • Example 1

<REVIEW>I absolutely loved this film. The characters were engaging and the ending was perfect.</REVIEW>

POSITIVE

  • Example 2