You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/intro.mdx
+16-22Lines changed: 16 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,26 @@ Which means, in order to evaluate Offensive Security agents, we need to develop
16
16
17
17
## Basic Example
18
18
19
+
Before you start, ensure you have the `dreadnode` package installed (see [installation](/install)). You can authenticate to a platform using the CLI, which is the recommended way to get started.
20
+
21
+
```bash
22
+
# Authenticate to platform.dreadnode.io
23
+
dreadnode login
24
+
25
+
# For self-hosted platforms, specify the server URL
26
+
dreadnode login --server http://self-hosted
27
+
```
28
+
29
+
<Note>
30
+
For complete authentication and configuration guidance, see the [Configuration](/usage/config) documentation.
31
+
</Note>
32
+
19
33
The most basic use of Strikes is a run with some logged data:
20
34
21
35
```python
22
36
import asyncio
23
37
import dreadnode
24
38
25
-
# Initialize with default settings
26
-
dreadnode.configure()
27
-
28
39
NAMES= ["Nick", "Will", "Brad", "Brian"]
29
40
30
41
# Create a new task
@@ -42,7 +53,7 @@ async def main() -> None:
42
53
)
43
54
44
55
# Log inputs
45
-
dn.log_input("names", NAMES)
56
+
dreadnode.log_input("names", NAMES)
46
57
47
58
# Run your tasks
48
59
greetings = [
@@ -51,7 +62,7 @@ async def main() -> None:
51
62
]
52
63
53
64
# Save outputs
54
-
dn.log_output("greetings", greetings)
65
+
dreadnode.log_output("greetings", greetings)
55
66
56
67
# Track metrics
57
68
dreadnode.log_metric("accuracy", 0.65, step=0)
@@ -63,19 +74,6 @@ async def main() -> None:
63
74
asyncio.run(main())
64
75
```
65
76
66
-
<Note>
67
-
We'll assume you have installed the `dreadnode` package and have your environment variables set up. Make sure you have `DREADNODE_API_KEY=...` set to your Platform API key.
68
-
69
-
For more information on `dreadnode.configure()`, review the [Configuration](/usage/config) topic.
70
-
71
-
If you call `dreadnode.configure()` without any token and your environment variables are not set, you'll receive a warning in the console, so keep an eye out! You can still run any of your code without sending data to the Dreadnode Platform.
72
-
</Note>
73
-
74
-
<Tip>
75
-
**Server Configuration**
76
-
By default, the SDK connects to the hosted Dreadnode platform at `https://platform.dreadnode.io`. If you're using a self-hosted instance, you must configure the server URL explicitly in your `dreadnode.configure()` call or via the `DREADNODE_SERVER` environment variable. See the [Configuration](/usage/config) guide for details.
77
-
</Tip>
78
-
79
77
This code should be very familiar if you've used an ML-experimentation library before, and all the functions you're familiar with work exactly like you would expect.
80
78
81
79
Under the hood, this code did a few things:
@@ -114,8 +112,6 @@ Runs are the core unit of work in Strikes. They provide the context for all your
114
112
```python
115
113
import dreadnode
116
114
117
-
dreadnode.configure()
118
-
119
115
with dreadnode.run("my-experiment"):
120
116
# Everything that happens here is part of the run
121
117
# All data collected is associated with this run
@@ -147,8 +143,6 @@ Tasks are units of work within runs. They help you structure your code and provi
0 commit comments