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
feat(docs): add comprehensive guide for AI agents using NNsight
- Introduced a new documentation file `llms.md` that provides detailed guidance for AI agents working with the NNsight library.
- Included sections on core concepts, quick reference, and various functionalities such as tracing, modifying activations, and remote execution.
- Enhanced accessibility of NNsight's features for users by linking to related resources and documentation.
Alternatively, use [Context7](https://github.com/upstash/context7) to provide up-to-date nnsight documentation directly to your LLM. Add `use context7` to your prompts or configure it in your MCP client:
70
+
71
+
```json
72
+
{
73
+
"mcpServers": {
74
+
"context7": {
75
+
"url": "https://mcp.context7.com/mcp"
76
+
}
77
+
}
78
+
}
79
+
```
80
+
81
+
See the [Context7 README](https://github.com/upstash/context7/blob/master/README.md) for full installation instructions across different IDEs.
82
+
83
+
### Documentation Files
84
+
85
+
You can also add our documentation files directly to your agent's context:
86
+
87
+
-**[llms.md](./llms.md)** — Comprehensive guide for AI agents working with nnsight
88
+
-**[NNsight.md](./NNsight.md)** — Deep technical documentation on nnsight's internals
> **💡 Tip:** Always call `.save()` on values you want to access after the trace exits. Without `.save()`, values are garbage collected. You can also use `nnsight.save(value)` as an alternative.
55
113
56
-
---
57
-
58
114
## Accessing Activations
59
115
60
116
```python
@@ -74,8 +130,6 @@ with model.trace("The Eiffel Tower is in the city of"):
74
130
75
131
**Note:** GPT-2 transformer layers return tuples where index 0 contains the hidden states.
76
132
77
-
---
78
-
79
133
## Modifying Activations
80
134
81
135
### In-Place Modification
@@ -101,8 +155,6 @@ with model.trace("Hello"):
101
155
result = model.transformer.h[-1].mlp.output.save()
102
156
```
103
157
104
-
---
105
-
106
158
## Batching with Invokers
107
159
108
160
Process multiple inputs in one forward pass. Each invoke runs its code in a **separate worker thread**:
Copy file name to clipboardExpand all lines: llms.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# CLAUDE.md - NNsight AI Agent Guide
1
+
# llms.md - NNsight AI Agent Guide
2
2
3
3
This document provides comprehensive guidance for AI agents working with the `nnsight` library. NNsight enables interpreting and manipulating the internals states of deep learning models through a deferred execution tracing system.
0 commit comments