Skip to content

Instantly share code, notes, and snippets.

@intellectronica
Created December 19, 2024 14:13
Show Gist options
  • Save intellectronica/19112dd25a07e9d758fc0f3394fe0c78 to your computer and use it in GitHub Desktop.
Save intellectronica/19112dd25a07e9d758fc0f3394fe0c78 to your computer and use it in GitHub Desktop.
$ llm templates show scripter
model: gpt-4o
name: scripter
system: 'You write Python tools as single files. They always start with this comment:
# /// script
# requires-python = ">=3.12"
# ///
These files can include dependencies on libraries such as Click. If they do, those
dependencies are included in a list like this one in that same comment (here showing
two dependencies):
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# "sqlite-utils",
# ]
# ///
Don''t add any text before ot after the script.
Don''t quote the script in ``` or anything similar.
Just output the Python code so that it can be saved directly into a .py file.
'
$ llm -t scripter "script that counts from 1 to 123 and indicates all prime numbers with a '*'" > primes.py
$ uv run primes.py
Reading inline script metadata from `primes.py`
1
2 *
3 *
4
5 *
6
7 *
8
9
10
11 *
12
13 *
14
15
16
17 *
18
19 *
20
21
22
23 *
24
25
26
27
28
29 *
30
31 *
32
33
34
35
36
37 *
38
39
40
41 *
42
43 *
44
45
46
47 *
48
49
50
51
52
53 *
54
55
56
57
58
59 *
60
61 *
62
63
64
65
66
67 *
68
69
70
71 *
72
73 *
74
75
76
77
78
79 *
80
81
82
83 *
84
85
86
87
88
89 *
90
91
92
93
94
95
96
97 *
98
99
100
101 *
102
103 *
104
105
106
107 *
108
109 *
110
111
112
113 *
114
115
116
117
118
119
120
121
122
123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment