AI › Module 2 › Lesson 1
Models APIs
Models and APIs literacy names tokens, temperature, system prompts, and API keys — read LLM behavior on YOUR $AI_LAB toy before live integration.
Visual · t32_models_apis
Models APIs literacy. $AI_LAB only. Original Cyberlium.
Opening
Every completion has a model story — literacy reads parameters and API boundaries on toys you own, not stranger endpoints with scraped keys.
LLM APIs expose model selection (GPT, Claude, Llama variants), token limits, temperature and top-p sampling, system vs user vs assistant roles, streaming, and rate limits. API keys authenticate your account — literacy names the objects before hardening integrations. Cyberlium maps models and APIs on YOUR $AI_LAB toy chatbot — document fictional model names and parameter notes on paper. Next: Context and Tools.
1. LLM API objects (named)
Model: capability tier and context window size. System prompt: developer-set behavior guardrails. User message: end-user input. Temperature: randomness control — lower for factual tasks. API key: authenticates requests to provider account.
On $AI_LAB, sketch one toy chatbot API call with plain-language purpose for each role and parameter.
Command guide
Try these commands — LLM API objects (named)
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
OpenAI API docs — https://platform.openai.com/docs/introduction (LLM API literacy) Hugging Face models — https://huggingface.co/docs/hub/models (model hub context) NIST AI RMF — https://www.nist.gov/itl/ai-risk-management-framework
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install python3 sudo apt install curl
macOS:
Command — copy this
brew install python3
Windows: Download https://python.org/downloads/ Built-in (PowerShell: Invoke-WebRequest)
═══ LINUX / macOS ═══
Command — copy this
export AI_LAB=${AI_LAB:-$HOME/cyberlium-lab/t32-ai}
python3 - <<'PY'
concepts = ['Model: weights + tokenizer → text completion/chat', 'API: HTTP request with messages → response', 'Context window: max tokens in prompt + completion', 'Temperature: randomness of sampling']
print('LLM basics literacy (no stranger API calls):')
for i, c in enumerate(concepts, 1): print(f' {i}. {c}')
PYCommand — copy this
curl -sS https://platform.openai.com/docs/introduction | head -8
Primary tools to practice this lesson: python3, curl. Reference sites: OpenAI API docs (https://platform.openai.com/docs/introduction); Hugging Face models (https://huggingface.co/docs/hub/models); NIST AI RMF (https://www.nist.gov/itl/ai-risk-management-framework). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. Why API literacy precedes security hardening
OWASP LLM findings cite excessive agency, prompt injection, and insecure output handling — analysts who cannot read API request structure mis-triage. Hardening starts with naming current parameters before adding guards.
Students inventory API usage on personal toy chatbot — never import stranger API keys or employer prod endpoints without scope.
3. Lab boundary
Forbidden: using scraped API keys on stranger accounts. Allowed: models and APIs card — four objects defined with $AI_LAB fictional bot name.
Ship: models and APIs card for YOUR toy chatbot. Next: Context and Tools.
4. What you ship: models and APIs card for $AI_LAB
Model, roles, temperature, key hygiene with lab examples. $AI_LAB named. chmod 600.
5. What you record before the next lesson
Date. Models APIs card. $AI_LAB named. File t32-m02-l01-models-apis.txt chmod 600.
6. Wrong vs right: stranger SaaS vs YOUR toy LLM
Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.
Wrong
Paste live API key in notes. Copy stranger endpoint config without scope.
Right
Write models and APIs card for YOUR $AI_LAB toy chatbot. Next: Context and Tools.
Mission: map API objects on YOUR lab toy
1) Name model, system prompt, user message, temperature in one sentence each. 2) Sketch one API request flow for lab toy. 3) Note why keys stay out of git. 4) chmod 600.
Stuck? Ask Cyberlium AI Mentor
Context window limits matter — literacy first, then trust boundaries.
Knowledge Check
APPLY: Models and APIs on Cyberlium are practiced as:
Multiple choice
Knowledge Check
APPLY: True or False: System prompts set developer guardrails separate from user input.
True or False
Knowledge Check
APPLY: Models APIs literacy avoids:
Multiple choice