magnitudedev/magnitude
Open source inference server that runs the best local models for your hardware, plugged into the agent you already use. Works with Pi, OpenCode, Hermes, OpenClaw, Codex, Claude Code, Oh My Pi, and Cline.
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 7 generated files: packages/icn-protocol/src/generated/api.ts, packages/icn-protocol/src/generated/client.ts, packages/icn-protocol/src/generated/index.ts, packages/icn-protocol/src/generated/operations.ts, packages/icn-protocol/src/generated/schemas.ts, packages/providers/src/magnitude/generated-contract/errors.ts, packages/providers/src/magnitude/generated-contract/usage.ts.
Largest clones in the code
- 16 lines in 8 placestsx68 tokensweb/src/components/chat-timeline.tsx:420–435web/src/components/chat-timeline.tsx:452–467web/src/components/chat-timeline.tsx:484–499web/src/components/chat-timeline.tsx:514–529web/src/components/chat-timeline.tsx:542–557and 3 more
420function FileSearchStep({ step }: { step: FileSearchPresentation }): ReactNode { 421 const Icon = TOOL_ICONS[step.icon] 422 return ( 423 <div className="grid [grid-template-columns:16px_minmax(0,_1fr)] [gap:7px] items-center font-sans text-[13px] leading-[18px] [max-width:min(860px,_100%)]"> 424 <Icon 425 size={14} 426 className={`${toneClass(step.tone)} block justify-self-center`} 427 /> 428 <div className="flex items-center [gap:7px] min-w-0"> 429 <spanFirst 10 of 16 lines.
- 7 lines in 8 placesrust53 tokensinference/crates/icn-contracts/src/models.rs:591–597inference/crates/icn-contracts/src/models.rs:720–726inference/crates/icn-contracts/src/models.rs:847–853inference/crates/icn-contracts/src/models.rs:963–969inference/crates/icn-contracts/src/models.rs:980–986and 3 more
591 }, 592} 593 594#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] 595#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] 596#[serde(tag = "_tag", rename_all = "PascalCase", deny_unknown_fields)] 597pub enum ModelInstanceFailure {720 pub sha256: String, 721} 722 723#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] 724#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] 725#[serde(tag = "_tag", rename_all = "PascalCase", deny_unknown_fields)] 726pub enum ModelPackageSource { - 52 lines in 2 placestypescript359 tokenscli/src/utils/file-panel-utils.ts:166–217packages/client-common/src/utils/file-panel-utils.ts:114–167
166} 167 168export function findActiveFileStream( 169 toolHandles: Record<string, ToolHandle> | undefined, 170 targetPath: string, 171): { toolCallId: string; state: FileEditState | FileWriteState } | null { 172 if (!toolHandles) return null 173 174 let result: { toolCallId: string; state: FileEditState | FileWriteState } | null = null 175 for (const [callId, handle] of Object.entries(toolHandles)) {114} 115 116// ── Active file stream detection ───────────────────────────────────────── 117 118export function findActiveFileStream( 119 toolHandles: Record<string, ToolHandle> | undefined, 120 targetPath: string, 121): { toolCallId: string; state: FileEditState | FileWriteState } | null { 122 if (!toolHandles) return null 123First 10 of 52 lines, the second copy on the right.
7 more
- 27 lines in 2 placestypescript349 tokens
- 58 lines in 2 placestypescript337 tokens
- 11 lines in 4 placestsx105 tokens
- 20 lines in 4 placestypescript99 tokens
- 20 lines in 4 placestypescript98 tokens
- 7 lines in 6 placesrust51 tokens
- 15 lines in 2 placestypescript250 tokens
Largest clones over all files, tests and data included
- 13 lines in 15 placestypescripttests52 tokenspackages/agent/src/projections/__tests__/memory-queue-ordering.test.ts:68–80packages/agent/src/projections/__tests__/memory-queue-ordering.test.ts:126–138packages/agent/src/projections/__tests__/memory-queue-ordering.test.ts:233–245packages/agent/src/projections/__tests__/memory-queue-ordering.test.ts:276–288packages/agent/src/projections/__tests__/memory-queue-ordering.test.ts:320–332and 10 more
68it('skill_activated on root idle queues only and flushes in order on turn_started', async () => { 69 const rootFork = await runEvents([ 70 { 71 type: 'session_initialized', 72 timestamp: ts(0), 73 sessionId: 's1', 74 cwd: '/tmp', 75 model: 'test', 76 mode: 'interactive', 77 approvalMode: 'on-request',First 10 of 13 lines.
- 25 lines in 4 placestypescriptgenerated186 tokenspackages/icn-protocol/src/generated/api.ts:36–60packages/icn-protocol/src/generated/api.ts:136–160packages/icn-protocol/src/generated/api.ts:241–265packages/icn-protocol/src/generated/api.ts:342–366
36 ), 37 { status: 200 }, 38) 39.addError( 40 S.suspend((): S.Schema<Schemas.ErrorResponse, Schemas.ErrorResponseEncoded> => Schemas.ErrorResponse), 41 { status: 400 }, 42) 43.addError( 44 S.suspend((): S.Schema<Schemas.ErrorResponse, Schemas.ErrorResponseEncoded> => Schemas.ErrorResponse), 45 { status: 404 },First 10 of 25 lines.
- 10 lines in 10 placestypescripttests61 tokenspackages/event-core/src/addressed/__tests__/collections.test.ts:103–112packages/event-core/src/addressed/__tests__/collections.test.ts:144–153packages/event-core/src/addressed/__tests__/collections.test.ts:194–203packages/event-core/src/addressed/__tests__/collections.test.ts:227–236packages/event-core/src/addressed/__tests__/collections.test.ts:298–307and 5 more
103test('append touches the tail segment until rollover creates the next segment', async () => { 104 await Effect.runPromise(Effect.gen(function* () { 105 const fixture = yield* makeCountingStore() 106 const runtime = yield* makeSegmentRuntime(fixture.store) 107 const sequence = makeAddressedSequence<TestMessage>({ 108 prefix: 'timeline/root/messages', 109 runtime 110 }) 111 112 let index = sequence.empty - 16 lines in 8 placestsx68 tokens
- 16 lines in 8 placestypescripttests64 tokenspackages/agent/src/projections/__tests__/task-tree-rendering.test.ts:79–94packages/agent/src/projections/__tests__/task-tree-rendering.test.ts:175–190packages/agent/src/projections/__tests__/task-tree-rendering.test.ts:271–286packages/agent/src/projections/__tests__/task-tree-rendering.test.ts:315–330packages/agent/src/projections/__tests__/task-tree-rendering.test.ts:358–373and 3 more
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| typescript | 1,069 | 161,483 | 314 | 4,004 | 2.48% |
| rust | 85 | 79,674 | 300 | 3,102 | 3.89% |
| tsx | 144 | 30,798 | 83 | 952 | 3.09% |
| cpp | 1 | 1,945 | 3 | 29 | 1.49% |
| html | 11 | 1,040 | 2 | 17 | 1.63% |
| svelte | 11 | 2,593 | 0 | 0 | 0% |
| python | 11 | 1,738 | 0 | 0 | 0% |
| bash | 9 | 644 | 0 | 0 | 0% |
| css | 5 | 190 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| typescript | 1,514 | 238,417 | 1,020 | 12,526 | 5.25% |
| rust | 85 | 79,674 | 300 | 3,102 | 3.89% |
| tsx | 194 | 37,555 | 123 | 1,451 | 3.86% |
| json | 90 | 13,458 | 35 | 792 | 5.88% |
| yaml | 69 | 1,492 | 12 | 123 | 8.24% |
| toml | 26 | 1,122 | 5 | 129 | 11.5% |
| cpp | 1 | 1,945 | 3 | 29 | 1.49% |
| diff | 3 | 91 | 3 | 34 | 37.36% |
| html | 11 | 1,040 | 2 | 17 | 1.63% |
| markup | 10 | 472 | 1 | 8 | 1.69% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Sep 7, 2026 | #4 | 3,780 (+604) | 2,230 | 401,794 | 1,504 | 4.53% | 2.89% | — | 99d236a |
| Sep 6, 2026 | #8 | 3,301 (+674) | 2,229 | 401,757 | 1,505 | 4.54% | 2.89% | — | 183f48c |
| Sep 5, 2026 | #4 | 2,618 (+391) | 2,149 | 394,787 | 1,499 | 4.61% | 2.95% | — | 0851902 |
| Sep 4, 2026 | #7 | 2,041 (+161) | 2,149 | 394,760 | 1,499 | 4.61% | 2.95% | — | fc61fec |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.