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
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:
75
+
76
+
```json
77
+
{
78
+
"mcpServers": {
79
+
"context7": {
80
+
"url": "https://mcp.context7.com/mcp"
81
+
}
82
+
}
83
+
}
84
+
```
85
+
86
+
See the [Context7 README](https://github.com/upstash/context7/blob/master/README.md) for full installation instructions across different IDEs.
87
+
88
+
### Documentation Files
89
+
90
+
You can also add our documentation files directly to your agent's context:
91
+
92
+
-**[llms.md](./llms.md)** — Comprehensive guide for AI agents working with nnsight
93
+
-**[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.
60
118
61
-
---
62
-
63
119
## Accessing Activations
64
120
65
121
```python
@@ -79,8 +135,6 @@ with model.trace("The Eiffel Tower is in the city of"):
79
135
80
136
**Note:** GPT-2 transformer layers return tuples where index 0 contains the hidden states.
81
137
82
-
---
83
-
84
138
## Modifying Activations
85
139
86
140
### In-Place Modification
@@ -106,8 +160,6 @@ with model.trace("Hello"):
106
160
result = model.transformer.h[-1].mlp.output.save()
107
161
```
108
162
109
-
---
110
-
111
163
## Batching with Invokers
112
164
113
165
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