2  LLM

library(rtemis.llm)
  .:rtemis.llm v.0.8.0 🌊 aarch64-apple-darwin20

2.1 Create an LLM object

create_ functions allow you to create LLM objects based on the endpoint you want to use:

  • create_Ollama() for Ollama
  • create_OpenAI() for OpenAI and OpenAI-compatible endpoints
  • create_Anthropic() for Claude and Anthropic-compatible endpoints

Learn more about Ollama here

Let’s create an Ollama LLM object for local, private LLM use:

llm <- create_Ollama(
  model_name = "gemma4:e4b",
  system_prompt = "You are an expert designer with in-depth knowledge of color theory",
  temperature = 0.7,
  name = "Designer"
)
llm
<Ollama>
         Name: Designer
        Model: gemma4:e4b
System Prompt: You are an expert designer with in-depth knowledge of color theory
  Temperature: 0.7
 

2.2 Generate a response

res <- generate(llm, "What color goes well with teal? Respond with a few bullet points.")
2026-04-24 08:33:44 [gemma4:e4b] working... [generate]
2026-04-24 08:34:25 [gemma4:e4b] done. [generate]
res
[Response] Teal is an incredibly versatile color—it sits perfectly between the calming depths of blue and the natural vibrancy of green. Because of its inherent balance, it can be styled for almost any mood, from serene and coastal to rich and dramatic.

The best pairing depends entirely on the *effect* you want to achieve (e.g., calm, energetic, sophisticated). Here are several options, categorized by the mood they create:

### 🌿 For a Natural, Grounded, or Earthy Look (Low Contrast)
These colors harmonize beautifully with teal, creating a sophisticated, organic palette that feels calming and timeless.

*   **Cream or Off-White:** Unlike stark, bright white (which can sometimes feel too harsh), cream or ivory softens the entire palette. It allows the rich jewel tone of the teal to pop without overwhelming the space.
*   **Beige or Tan:** These warm neutrals pull out the earthy undertones of teal, making the combination feel grounded, reminiscent of natural materials like sand or linen.
*   **Wood Tones:** Medium-to-dark oak or walnut wood pairing with teal creates a classic, library-like ambiance that is inherently sophisticated and rich.

### 🔥 For High Contrast and Energy (Complementary Pairing)
If you want the teal to be the cool, dominant tone, pairing it with warm, vibrant accents will make the colors "pop" dramatically.

*   **Coral or Peach:** This is a phenomenal pairing. The soft warmth of coral acts as a perfect complementary accent to the cool blue-green of teal, creating an uplifting, Mediterranean, or retro vibe.
*   **Mustard Yellow or Gold Ochre:** Yellows are naturally complementary to blue/green. A deep, muted mustard yellow adds an unexpected pop of energy while still feeling sophisticated, perfect for an accent pillow or piece of art.
*   **Terracotta or Rust:** These burnt, reddish-brown tones are grounding and warm. They provide a rich, autumnal contrast that is more muted than coral, making it ideal for dramatic, cozy spaces.

### 💎 For Deep Luxury and Harmony (Analogous & Deep Tones)
If you want the look to feel expensive, dramatic, and cohesive, stick to deep, saturated tones that share a similar cool temperature.

*   **Navy Blue:** Pairing teal with a deep navy creates an incredibly rich, nautical, and dramatic look. The slight difference in tone provides depth without creating a jarring contrast.
*   **Emerald Green:** Using a deeper, more saturated green (like emerald) creates an analogous, monochromatic pairing. This is extremely luxurious and sophisticated, making the space feel cohesive and jewel-toned.
*   **Charcoal Gray:** A deep, cool gray acts as a perfect neutral alternative to black. It grounds the space and allows the vibrancy of the teal to shine without the harshness of stark black.

***

**✨ Expert Designer Tip:** When in doubt, use **Metallic Gold or Aged Brass** as your accent. Metallics are universally flattering and, when paired with teal, instantly elevate the look, giving it a polished, luxurious, and intentional feel. 

2.3 Batch generation

  1. Create an LLM object:
llm <- create_Ollama(
  model_name = "gemma4:e4b",
  system_prompt = "Return the hex code for the following color in format #RRGGBB"
)
x <- c("ocean teal", "california poppy orange", "bougainvillea pink")
  1. Use map to batch generate responses to multiple prompts:
hex <- map(x, llm)
2026-04-24 08:34:25 [gemma4:e4b] working... [map]
⠙ [2/3] ■■■■■■■■■■■■■■■■■■■■■            ETA:  4s
2026-04-24 08:34:40 [gemma4:e4b] done. [map]
hex
[[1]]
[Response] #008080 

[[2]]
[Response] #FF9900 

[[3]]
[Response] #D9539B 

Extract the assistant responses as a character vector:

responses(hex)
[1] "#008080" "#FF9900" "#D9539B"
© 2026 E.D. Gennatas