Yazhiniyan commited on
Commit
5ef3875
·
verified ·
1 Parent(s): 0fa65d5

Upload 190 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. Code-agent-main/.env.example +9 -0
  2. Code-agent-main/.gitignore +40 -0
  3. Code-agent-main/LICENSE +21 -0
  4. Code-agent-main/README.md +535 -0
  5. Code-agent-main/YCODE.md +9 -0
  6. Code-agent-main/models/ycode-lm-v2/README.md +44 -0
  7. Code-agent-main/models/ycode-lm-v2/info.json +19 -0
  8. Code-agent-main/models/ycode-lm-v2/model.pt +3 -0
  9. Code-agent-main/models/ycode-lm-v3/README.md +49 -0
  10. Code-agent-main/models/ycode-lm-v3/info.json +19 -0
  11. Code-agent-main/models/ycode-lm-v3/model.pt +3 -0
  12. Code-agent-main/models/ycode-lm-v4/README.md +50 -0
  13. Code-agent-main/models/ycode-lm-v4/info.json +27 -0
  14. Code-agent-main/models/ycode-lm-v4/model-00001-of-00005.pt +3 -0
  15. Code-agent-main/models/ycode-lm-v4/model-00002-of-00005.pt +3 -0
  16. Code-agent-main/models/ycode-lm-v4/model-00003-of-00005.pt +3 -0
  17. Code-agent-main/models/ycode-lm-v4/model-00004-of-00005.pt +3 -0
  18. Code-agent-main/models/ycode-lm-v4/model-00005-of-00005.pt +3 -0
  19. Code-agent-main/models/ycode-lm-v4/model.pt +3 -0
  20. Code-agent-main/models/ycode-lm-v5/README.md +62 -0
  21. Code-agent-main/models/ycode-lm-v5/info.json +125 -0
  22. Code-agent-main/models/ycode-lm-v5/model-00001-of-00103.pt +3 -0
  23. Code-agent-main/models/ycode-lm-v5/model-00002-of-00103.pt +3 -0
  24. Code-agent-main/models/ycode-lm-v5/model-00003-of-00103.pt +3 -0
  25. Code-agent-main/models/ycode-lm-v5/model-00004-of-00103.pt +3 -0
  26. Code-agent-main/models/ycode-lm-v5/model-00005-of-00103.pt +3 -0
  27. Code-agent-main/models/ycode-lm-v5/model-00006-of-00103.pt +3 -0
  28. Code-agent-main/models/ycode-lm-v5/model-00007-of-00103.pt +3 -0
  29. Code-agent-main/models/ycode-lm-v5/model-00008-of-00103.pt +3 -0
  30. Code-agent-main/models/ycode-lm-v5/model-00009-of-00103.pt +3 -0
  31. Code-agent-main/models/ycode-lm-v5/model-00010-of-00103.pt +3 -0
  32. Code-agent-main/models/ycode-lm-v5/model-00011-of-00103.pt +3 -0
  33. Code-agent-main/models/ycode-lm-v5/model-00012-of-00103.pt +3 -0
  34. Code-agent-main/models/ycode-lm-v5/model-00013-of-00103.pt +3 -0
  35. Code-agent-main/models/ycode-lm-v5/model-00014-of-00103.pt +3 -0
  36. Code-agent-main/models/ycode-lm-v5/model-00015-of-00103.pt +3 -0
  37. Code-agent-main/models/ycode-lm-v5/model-00016-of-00103.pt +3 -0
  38. Code-agent-main/models/ycode-lm-v5/model-00017-of-00103.pt +3 -0
  39. Code-agent-main/models/ycode-lm-v5/model-00018-of-00103.pt +3 -0
  40. Code-agent-main/models/ycode-lm-v5/model-00019-of-00103.pt +3 -0
  41. Code-agent-main/models/ycode-lm-v5/model-00020-of-00103.pt +3 -0
  42. Code-agent-main/models/ycode-lm-v5/model-00021-of-00103.pt +3 -0
  43. Code-agent-main/models/ycode-lm-v5/model-00022-of-00103.pt +3 -0
  44. Code-agent-main/models/ycode-lm-v5/model-00023-of-00103.pt +3 -0
  45. Code-agent-main/models/ycode-lm-v5/model-00024-of-00103.pt +3 -0
  46. Code-agent-main/models/ycode-lm-v5/model-00025-of-00103.pt +3 -0
  47. Code-agent-main/models/ycode-lm-v5/model-00026-of-00103.pt +3 -0
  48. Code-agent-main/models/ycode-lm-v5/model-00027-of-00103.pt +3 -0
  49. Code-agent-main/models/ycode-lm-v5/model-00028-of-00103.pt +3 -0
  50. Code-agent-main/models/ycode-lm-v5/model-00029-of-00103.pt +3 -0
Code-agent-main/.env.example ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # YCode needs no API key: it answers with its own built-in model (YCode-LM).
2
+ # Copy this file to .env (or ~/.ycode/.env) only to change settings. Never commit .env.
3
+
4
+ # Which built-in model to use: v2, v3, v4, v5 (default) or a model directory.
5
+ YCODE_LOCAL_MODEL=
6
+
7
+ # Optional, only for Claude (`ycode --provider anthropic`, after `pip install -e ".[claude]"`):
8
+ # ANTHROPIC_API_KEY=
9
+ # YCODE_MODEL=claude-opus-5-5
Code-agent-main/.gitignore ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Secrets
2
+ .env
3
+ .env.*
4
+ !.env.example
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *.egg-info/
10
+ .eggs/
11
+ build/
12
+ dist/
13
+ .pytest_cache/
14
+ .mypy_cache/
15
+ .ruff_cache/
16
+ .coverage
17
+ htmlcov/
18
+
19
+ # Virtual environments
20
+ .venv/
21
+ venv/
22
+ env/
23
+
24
+ # Editors / OS
25
+ .idea/
26
+ .vscode/
27
+ .DS_Store
28
+
29
+ # Local YCode state
30
+ .ycode/history
31
+
32
+ # YCode-LM datasets and trained models (large binaries)
33
+ /data/
34
+ /models/*
35
+ *.bin
36
+ *.pt
37
+ # ...except the published, exported YCode-LM models
38
+ !/models/ycode-lm-*/
39
+ !/models/ycode-lm-*/model.pt
40
+ !/models/ycode-lm-*/model-*-of-*.pt
Code-agent-main/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yazhiniyanMS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
Code-agent-main/README.md ADDED
@@ -0,0 +1,535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YCode
2
+
3
+ ```
4
+ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
5
+ ╚██╗ ██╔╝██╔════╝██╔═══██╗██╔══██╗██╔════╝
6
+ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗
7
+ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝
8
+ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗
9
+ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
10
+ ```
11
+
12
+ YCode is an AI coding agent that runs in your terminal. Start it inside a project, describe a task in plain English, and it works through it: it looks around the repository, makes a short plan, edits files, runs your tests and build, reads any failures, fixes them, and then tells you what changed.
13
+
14
+ **YCode works out of the box with no API key and no training.** By default it answers with **YCode-LM**, its own coding language model, trained from scratch and shipped in this repository (`models/`). Clone, install, and run `ycode`: nothing to sign up for, no key to paste, nothing sent over the network. See [Answering without an API key](#answering-without-an-api-key).
15
+
16
+ YCode-LM is the only model YCode needs. If you also want full autonomous coding (reading, editing and running files in your project, as in the example below), you can optionally plug in Claude: see [Using Claude (optional)](#using-claude-optional). Everything else always runs locally: the tool system, the permission checks and the terminal UI. The model sits behind a small provider interface, so you can add other LLM providers without rewriting the agent.
17
+
18
+ With Claude (`--provider anthropic`), YCode works through whole tasks:
19
+
20
+ ```text
21
+ ycode> Fix the failing add() test
22
+
23
+ ◇ Plan
24
+ ▸ 1. Read calc.py
25
+ ○ 2. Fix add
26
+ ○ 3. Run tests
27
+
28
+ ◇ Reading calc.py
29
+ ✓ Read calc.py (2 of 2 lines)
30
+
31
+ ◇ Editing calc.py
32
+ ✓ Edited calc.py (+1 -1)
33
+ @@ -1,2 +1,2 @@
34
+ def add(a, b):
35
+ - return a - b
36
+ + return a + b
37
+
38
+ ◇ Running `python -m pytest -q`
39
+ ✓ Succeeded (exit code 0, 0.3s)
40
+
41
+ Fixed `add` in calc.py; pytest passes (1 test).
42
+
43
+ Changes:
44
+ M calc.py
45
+
46
+ Commands:
47
+ ✓ python -m pytest -q
48
+
49
+ ✓ YCode completed the task. (5 steps)
50
+ ```
51
+
52
+ ## Features
53
+
54
+ - **Terminal first.** Uses Rich for output: spinners, streamed Markdown, syntax-highlighted diffs. Uses prompt_toolkit for input: persistent history, multiline editing, and tab completion for `/commands`.
55
+ - **Autonomous agent loop.** The model can make many tool calls per task, parallel calls included, until it is done. A configurable step limit (default 50) stops runaway loops.
56
+ - **Planning.** For non-trivial work the model writes a short plan through an `update_plan` tool and keeps it current. For trivial requests it skips the plan.
57
+ - **Verification.** The model picks verification commands from your project type (`npm test`, `pytest`, `cargo test`, ...), reads failures and iterates. It is told never to claim success it did not verify.
58
+ - **Tools:** `read_file`, `write_file`, `edit_file`, `list_directory`, `search_files`, `find_files`, `run_command`, `git_status`, `git_diff`, `git_log`, `git_branch`, `update_plan`.
59
+ - **Security.** Commands are classified as SAFE, REQUIRES_APPROVAL or BLOCKED. Risky ones need an explicit `y`. File access is confined to the workspace, and API keys are stripped from the environment that commands run in.
60
+ - **Repository awareness.** Detects Node.js, TypeScript, JavaScript, React, Next.js, Vue, Python, Java, Kotlin, C/C++, Rust, Go, Flutter/Dart, Ruby and PHP projects, plus the package manager and the likely test and build commands. Large generated directories are ignored.
61
+ - **Diff awareness.** After each task YCode summarizes the changed files and the commands it ran. `/diff` shows the full diff.
62
+ - **Project instructions.** A `YCODE.md` file in the repository is loaded into the agent's instructions.
63
+ - **Layered configuration:** global and per-project TOML files, environment variables and CLI flags.
64
+ - **No API key needed.** The default provider is YCode's own bundled model. It answers Python documentation questions exactly from Python's built-in docs, and writes functions that are checked to compile and define what you asked for. Everything runs offline.
65
+ - **Model-agnostic core.** The agent depends only on `LLMProvider`. There are two implementations: your own local model (default) and Claude (optional).
66
+ - **Your own LLM.** `ycode-lm` builds a byte-level BPE tokenizer and a GPT-style transformer from scratch, pretrains it on code, and instruction-tunes it to answer programming questions. Four trained versions ship with the repository, up to the 1.5B-parameter v5.
67
+
68
+ ## Architecture
69
+
70
+ ```text
71
+ ┌──────────────┐
72
+ │ YCode CLI │ cli.py, commands.py, ui/
73
+ └──────┬───────┘
74
+ │
75
+ ┌──────▼───────┐
76
+ │ Agent Engine │ agent/loop.py, planner.py, context.py, prompts.py
77
+ └──────┬───────┘
78
+ │
79
+ ┌────────▼────────┐
80
+ │ LLM Provider │ llm/base.py (interface), llm/anthropic.py
81
+ └────────┬────────┘
82
+ │
83
+ Claude API
84
+ │
85
+ ┌────────▼────────┐
86
+ │ Tool Execution │ tools/ (+ security/permissions.py)
87
+ └────────┬────────┘
88
+ ┌────────────┼────────────┐
89
+ ▼ ▼ ▼
90
+ Filesystem Terminal Git
91
+ ```
92
+
93
+ ```text
94
+ ycode/
95
+ ├── __main__.py # python -m ycode
96
+ ├── cli.py # argument parsing, REPL, graceful shutdown
97
+ ├── app.py # wires config, context, permissions, tools, provider, agent, UI
98
+ ├── commands.py # /help /clear /status /diff /files /model /plan /approval /exit
99
+ ├── config.py # layered TOML + env + CLI configuration
100
+ ├── errors.py # user-facing error hierarchy (no raw tracebacks)
101
+ ├── agent/
102
+ │ ├── loop.py # the agent loop, step limit, interruption handling
103
+ │ ├── planner.py # Plan model + update_plan tool
104
+ │ ├── context.py # project detection, YCODE.md loading
105
+ │ └── prompts.py # system prompt
106
+ ├── llm/
107
+ │ ├── base.py # provider-neutral messages, ToolSpec, LLMProvider
108
+ │ ├── anthropic.py # Claude via the official anthropic SDK (streaming)
109
+ │ └── local.py # your own YCode-LM model (answer-only, no API key)
110
+ ├── lm/ # YCode-LM: the from-scratch model; assist.py answers docs questions and checks code
111
+ │ ├── tokenizer.py # byte-level BPE tokenizer for code
112
+ │ ├── model.py # GPT transformer: RoPE, RMSNorm, SwiGLU, KV-cache sampling
113
+ │ ├── data.py # corpus collection, instruction-pair extraction, encoding
114
+ │ ├── train.py # pretraining + instruction tuning, checkpoints, resume
115
+ │ ├── optim.py # Muon optimizer (v3) + AdamW wiring
116
+ │ ├── evaluate.py # bits/byte on held-out code, pass@k on executed problems
117
+ │ ├── generate.py # inference (chat + completion, streaming)
118
+ │ └── cli.py # the `ycode-lm` command
119
+ ├── tools/
120
+ │ ├── base.py # Tool, ToolRegistry (validation + dispatch), ToolResult
121
+ │ ├── filesystem.py # read/write/edit/list
122
+ │ ├── search.py # regex content search, glob file search
123
+ │ ├── terminal.py # run_command (timeouts, output capture, Ctrl+C)
124
+ │ └── git.py # git helpers + read-only git tools
125
+ ├── security/
126
+ │ └── permissions.py # command classifier, PathGuard, PermissionManager
127
+ └── ui/
128
+ ├── banner.py # ASCII banner
129
+ ├── console.py # Rich renderer (implements AgentEvents)
130
+ └── prompts.py # prompt_toolkit input with history/multiline
131
+ ```
132
+
133
+ The dependencies point one way. The agent knows nothing about Rich or Anthropic: it talks to an `LLMProvider` and reports progress through `AgentEvents` callbacks. The UI implements those callbacks. Tools don't know about the model.
134
+
135
+ **Adding a provider:** subclass `LLMProvider` in `ycode/llm/`, translate the neutral `UserMessage`/`AssistantMessage`/`ToolResultsMessage` types to your API's format, and register it in `ycode/llm/__init__.py:create_provider`. Assistant messages carry an opaque `provider_data` field. Your provider can use it to replay its own native content exactly, which Claude needs for its thinking blocks.
136
+
137
+ ## Requirements
138
+
139
+ - Python 3.10+
140
+ - About 4 GB of free RAM for the default model, YCode-LM v5 (1.5B parameters). With less, YCode uses the smaller v4 (about 1 GB) automatically.
141
+ - Git, to clone the repository (it contains the trained models) and for the git features
142
+
143
+ That's all. **No API key, no account and no internet connection are needed** to run YCode.
144
+
145
+ ## Installation
146
+
147
+ ```bash
148
+ git clone https://github.com/yazhiniyanMS/Code-agent.git
149
+ cd Code-agent
150
+ python -m venv .venv
151
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
152
+ pip install -e . # includes PyTorch for the built-in model
153
+ ycode # start asking questions: no API key, no training
154
+ ```
155
+
156
+ This installs a `ycode` command. `python -m ycode` works too. Install from the clone (as above) rather than from a bare package: the trained models live in the repository's `models/` folder. To keep them elsewhere, set `YCODE_MODELS_DIR`.
157
+
158
+ Optional extras:
159
+
160
+ ```bash
161
+ pip install -e ".[hf]" # Hugging Face: transformers, huggingface_hub, safetensors, accelerate
162
+ pip install -e ".[claude]" # Claude support (only if you want --provider anthropic)
163
+ pip install -e ".[dev]" # tests
164
+ ```
165
+
166
+ ## Answering without an API key
167
+
168
+ `ycode` uses YCode's own model by default. Every answer goes through three steps:
169
+
170
+ 1. **Documentation questions are answered exactly.** "What does `len()` do?", "How do I use `json.loads`?", "What is `yield`?", "Explain `os.path.join`", "What's the difference between a list and a tuple?": YCode looks the names up in Python's own built-in documentation, which ships with every Python install, and shows the signature and the official description. Only built-in names and standard-library modules are looked up. Your project's code is never imported.
171
+ 2. **"Write a function `name(...)`" requests are checked.** The model writes up to four candidates. YCode keeps the first one that compiles and defines the function you asked for. Candidates are only parsed, never run. The answer says that the name and syntax were checked, not the logic.
172
+ 3. **Everything else** goes to the model as a normal chat turn.
173
+
174
+ ```text
175
+ ycode> What does the zip() function do?
176
+
177
+ zip(*iterables, strict=False) (class)
178
+ Yield tuples until an input is exhausted.
179
+ >>> list(zip('abcdefg', range(3), range(4)))
180
+ [('a', 0, 0), ('b', 1, 1), ('c', 2, 2)]
181
+ ...
182
+ (From Python's built-in documentation.)
183
+ ```
184
+
185
+ **Choosing a model.** YCode picks a model in this order: one you trained yourself (`~/.ycode/models/ycode-lm`), otherwise the bundled **v5**. If less than 4 GB of memory is free, it uses v4 instead. Pick one explicitly with `--local`:
186
+
187
+ ```bash
188
+ ycode # default: YCode-LM v5 (1.5B parameters), loaded in 16-bit: about 3 GB of RAM
189
+ ycode --local v4 # YCode-LM v4 (100M parameters): much faster on a CPU
190
+ ycode --local path/to/dir # any model you trained
191
+ ```
192
+
193
+ You can also set `local_model = "v4"` in `~/.ycode/config.toml` or `YCODE_LOCAL_MODEL=v4`. v5 models code best of all versions (see [the results](#your-own-llm-ycode-lm-no-api-key)), but a 1.5B model is slow on a CPU: expect a few tokens per second, so a long answer can take a minute or more. On a slow machine, v4 is the practical choice.
194
+
195
+ **What to expect.** The bundled models were trained from scratch on a CPU, with a tiny fraction of the data and compute behind commercial assistants. They write well-formed Python, but their own code is often wrong, so test it. The local model also runs in **answer-only mode**: it answers in its reply but cannot read, edit or run files in your project. For autonomous work on a codebase, use Claude.
196
+
197
+ ## Hugging Face (optional)
198
+
199
+ `pip install -e ".[hf]"` installs the Hugging Face libraries: `transformers`, `huggingface_hub`, `safetensors` and `accelerate`. With them, `ycode-lm push-hf` publishes a model to your Hugging Face account, and `ycode-lm autotrain` trains on GPUs while saving checkpoints there.
200
+
201
+ These commands need a Hugging Face **access token** with Write access, created at https://huggingface.co/settings/tokens. Give it to YCode in either of these ways:
202
+
203
+ ```bash
204
+ export HF_TOKEN=hf_... # for this shell (or put HF_TOKEN=... in ~/.ycode/.env)
205
+ hf auth login # or save it once with the Hugging Face CLI
206
+ ```
207
+
208
+ Then, for example:
209
+
210
+ ```bash
211
+ ycode-lm push-hf --model models/ycode-lm-v5 --repo your-name/ycode-lm-v5 --public
212
+ ```
213
+
214
+ The token is only used to upload models. Running YCode never needs it. Keep it secret: never commit it, and don't paste it into a chat.
215
+
216
+ ## Using Claude (optional)
217
+
218
+ YCode never needs Claude. If you want it for autonomous work on a codebase, install the extra with `pip install -e ".[claude]"`, then run `ycode --provider anthropic` or set `provider = "anthropic"` in your config. YCode then reads `ANTHROPIC_API_KEY`. In order of precedence, the places it looks are:
219
+
220
+ 1. Your shell environment: `export ANTHROPIC_API_KEY=sk-ant-...`
221
+ 2. A `.env` file in the project you run YCode in
222
+ 3. `~/.ycode/.env`, which applies to every project
223
+ 4. The `.env` in the YCode checkout itself, which is handy with `pip install -e .`
224
+
225
+ Values that are already set are never overridden. Any of these work too: `ANTHROPIC_AUTH_TOKEN`, an `ant auth login` profile, or workload identity federation. If you ask for Claude and YCode finds no credentials, it shows the banner, prints a clear error and exits with status 1. Without `--provider anthropic`, YCode never asks for a key.
226
+
227
+ YCode never prints your key. It also removes `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` from the environment of commands it runs, so a stray `env` can't leak the key to the model. **Never commit `.env`.** The included `.gitignore` excludes it.
228
+
229
+ ## Your own LLM (YCode-LM, no API key)
230
+
231
+ YCode-LM is a programming language model you train from scratch on your own machine. Nothing is downloaded: the tokenizer, the model architecture and the training loop are all in this repository (`ycode/lm/`), and the data is code you already have.
232
+
233
+ **What it is:**
234
+ - **Tokenizer:** byte-level BPE (`ycode/lm/tokenizer.py`) trained on your corpus. A code-aware pre-tokenizer turns indentation runs, identifiers and operators into compact tokens.
235
+ - **Model:** a decoder-only transformer (`ycode/lm/model.py`) with rotary position embeddings, RMSNorm, SwiGLU MLPs, tied embeddings and a KV cache for fast sampling. **Version 2** (the default) adds grouped-query attention, which shares key/value heads for a 4× smaller KV cache and faster generation, and QK-norm, which keeps attention stable at higher learning rates. v1 checkpoints still load.
236
+ - **Training data:** any code directories you point it at. With no `--source`, it uses the Python standard library, which every Python install has.
237
+ - **Two training stages:**
238
+ 1. *Pretraining:* next-token prediction on code.
239
+ 2. *Instruction tuning (SFT):* teaches the model to answer. The data is generated automatically from the real code in your corpus, so every answer is real code:
240
+ - write a function from its description
241
+ - explain a function
242
+ - complete a function from its signature and docstring
243
+ - write a docstring
244
+ - explain a class
245
+ - **find and fix a bug**: YCode-LM injects realistic one-token bugs (`<` vs `<=`, `+` vs `-`, off-by-one, `and`/`or`, `True`/`False`). The original code is the fix, so these examples are correct by construction.
246
+
247
+ You can add your own pairs as JSONL (`{"prompt": ..., "response": ...}`) with `--sft-data`.
248
+
249
+ **What v2 improves:**
250
+
251
+ | | v1 | v2 |
252
+ | --- | --- | --- |
253
+ | Attention | multi-head | grouped-query (smaller cache) + QK-norm |
254
+ | LR schedule | cosine over steps; cut short by `--minutes` | warmup-stable-decay. Progress is the larger of steps done and time used, so a time-limited run always finishes its decay |
255
+ | End of pretraining | code only | anneals with 20% instruction data during the decay phase, so the model already knows the chat format before SFT |
256
+ | SFT batches | one example per row, padded | several examples packed per row, so no compute is wasted on padding |
257
+ | Data | write/explain pairs | + bug fixing, completion, docstrings, classes; de-duplicated prompts; licence headers stripped |
258
+ | Data prep | single process | tokenization on all CPU cores |
259
+ | Measurement | loss only | `ycode-lm eval`: bits per byte on held-out code + pass@k on 30 executed coding problems |
260
+
261
+ **The included models (no training needed).** The repository ships four trained models. `ycode` uses v5 by default (v4 when memory is short):
262
+
263
+ | Model | Params | Size | Card |
264
+ | --- | --- | --- | --- |
265
+ | **YCode-LM v5** (default) | **1,523M** | 2.9 GB in 103 shards | [`models/ycode-lm-v5`](models/ycode-lm-v5/README.md) |
266
+ | YCode-LM v4 | 100M | 200 MB in 5 shards | [`models/ycode-lm-v4`](models/ycode-lm-v4/README.md) |
267
+ | YCode-LM v3 | 40.8M | 81.8 MB | [`models/ycode-lm-v3`](models/ycode-lm-v3/README.md) |
268
+ | YCode-LM v2 | 7.7M | 15.6 MB | [`models/ycode-lm-v2`](models/ycode-lm-v2/README.md) |
269
+
270
+ ```bash
271
+ ycode --local v4 # or: ycode-lm chat --model models/ycode-lm-v4
272
+ ```
273
+
274
+ **Set up and train:**
275
+
276
+ ```bash
277
+ pip install -e . # PyTorch + NumPy are included
278
+
279
+ # 1. Build the dataset: collect code, train the tokenizer, create instruction pairs.
280
+ # --exclude keeps code out of training so you can evaluate on it later.
281
+ ycode-lm prepare --out data/ --source ~/my-projects --source /usr/lib/python3.11 --exclude '*/holdout/*'
282
+
283
+ # 2. Pretrain on code (bf16 on CPUs with AMX/AVX512-BF16, CUDA or Apple MPS when available)
284
+ ycode-lm train --data data/ --out models/base --preset v2-small --minutes 180
285
+
286
+ # 3. Instruction-tune it so it answers requests
287
+ ycode-lm sft --data data/ --init-from models/base --out ~/.ycode/models/ycode-lm --minutes 40
288
+
289
+ # 4. Measure it (compare several models by repeating --model)
290
+ ycode-lm eval --model ~/.ycode/models/ycode-lm --heldout path/to/unseen/code --samples 5
291
+
292
+ # 5. Use it
293
+ ycode-lm chat # quick Q&A in the terminal
294
+ ycode # inside YCode: your model in ~/.ycode/models/ycode-lm is used automatically
295
+ ycode --local models/chat # or point to any trained model
296
+ ```
297
+
298
+ Other commands: `ycode-lm sample --model models/base --prompt "def quicksort("` (raw code completion), `ycode-lm info`, `ycode-lm export --model DIR --out DIR` (slim bf16 copy for sharing, about 4× smaller than a training checkpoint), and `ycode-lm train --resume` (continue an interrupted run). Ctrl+C during training keeps the last checkpoint. Training options include `--schedule wsd|cosine`, `--anneal-mix`, `--no-pack`, `--compile` (torch.compile) and `--grad-accum`.
299
+
300
+ **Version 3: the 40M-parameter model.** `--preset v3-40m` uses the v2 architecture scaled to 40.8M parameters with a 1024-token context. It trains with the **Muon optimizer** by default: transformer weight matrices are updated with orthogonalized momentum (Newton–Schulz iterations), while embeddings and norms stay on AdamW. On small transformers, Muon reaches a given loss with fewer tokens, which matters most when compute is the bottleneck. Use `--optimizer adamw` to switch back.
301
+
302
+ ```bash
303
+ ycode-lm train --data data/ --out models/v3-base --preset v3-40m --compile --minutes 480
304
+ ycode-lm sft --data data/ --init-from models/v3-base --out ~/.ycode/models/ycode-lm --compile --minutes 60
305
+ ```
306
+
307
+ In an A/B test (same model, data, seed and 600 steps), Muon reached a held-out loss of **4.13** against AdamW's **4.26**, for 14% more wall-clock per step at that tiny size; the overhead shrinks as models grow.
308
+
309
+ A 40M model wants far more data and compute than a CPU can supply. The compute-optimal budget is about 800M training tokens, while 8 hours on a 4-core CPU covers about 50M. On a single consumer GPU, the same run takes hours instead of days.
310
+
311
+ **Measured results (v1 → v5).** All five models were evaluated the same way. Bits per byte is measured on 11 packages none of them saw in training. The code tasks are *executed* against unit tests:
312
+
313
+ | | v1 | v2 | v3 | v4 | v5 |
314
+ | --- | --- | --- | --- | --- | --- |
315
+ | Parameters | 6.9M | 7.7M | 40.8M | 100M | 1,523M |
316
+ | Training | ~41M tokens | ~82M tokens | ~60M tokens (Muon) | grown from v3 + ~24.6M tokens | grown from v4 + ~2.5M tokens (Lion, CPU) |
317
+ | Bits per byte on held-out code | 1.095 | 0.966 | 0.857 | 0.814 | **0.758** |
318
+ | Write a function, pass@1 (30 problems) | 0 / 30 | 0 / 30 | 0 / 30 | **1 / 30** | 0 / 30 |
319
+ | Fix an injected bug, fix@1 (15 functions) | 0 / 15 | **5 / 15** | 4 / 15 | **5 / 15** | 4 / 15 |
320
+
321
+ Each version models real code better than the last; v5's 7% gain over v4 is the largest step so far, but it has not yet turned into solving more tasks (it is badly under-trained for its size). v2–v4 write short, well-formed answers and can find and fix simple bugs ("The bug is in `result = 1`. It should be `result = 0`."), while v1 falls into repetition loops. v4 is the first to write a correct function from a description (`square` → `return x * x`). Writing functions reliably needs much more training data and compute than a CPU provides.
322
+
323
+ **Growing models.** `ycode-lm grow --model v3 --out v4-init --layers 34` deepens a trained model by inserting copies of existing blocks with zeroed output projections. The result computes exactly the same function, so `train --init-from v4-init` continues from everything the small model learned. v4 was built this way. For files over GitHub's 100 MB limit, `export --max-shard-mb 45` splits the weights into shards that load transparently.
324
+
325
+ For long runs on machines that may be interrupted, train in segments: `--until-step N` stops and saves, `--resume` continues with the same LR schedule, and `--save-interval N` saves cheaply between evaluations.
326
+
327
+ **Version 5: 1.5 billion parameters, trained on a CPU.** v5 (`--preset v5-1.5b`, 34 layers × 2048 wide, 32 query / 8 KV heads, 1,523M parameters) is v4 grown 4× in width with `ycode-lm grow --width 2048`, so it starts out computing exactly what v4 computed and keeps everything v4 learned. A 1.5B model normally needs ~18 GB just for fp32 weights, gradients and optimizer state. v5 trains in **15 GB of RAM** with a low-memory mode (`--optimizer lion`):
328
+
329
+ - **Lion optimizer:** the update is the sign of a momentum, so it keeps one state per weight instead of AdamW's two, stored in bf16 (3 GB).
330
+ - **Updates inside backward:** each weight is updated the moment its gradient is ready, and the gradient is freed at once. A full set of gradients (6 GB) never exists.
331
+ - Gradient checkpointing, bf16 autocast without the cast-weight cache (which would be another 3 GB copy), and memory-mapped checkpoint loading.
332
+
333
+ ```bash
334
+ ycode-lm grow --model models/ycode-lm-v4 --out models/v5-base --width 2048 --version 5
335
+ ycode-lm train --data data/ --out models/v5-base --resume --steps 600 --batch-size 4 \
336
+ --optimizer lion --lr 3e-5 --grad-checkpoint --save-interval 20 --until-step 80
337
+ ```
338
+
339
+ On 4 CPU cores this runs at about 55 tokens per second, so a day of training covers only a few million tokens. A 1.5B model would ideally see tens of billions. v5 therefore benefits most from GPUs. With several GPUs, `--shard` splits the weights, gradients and optimizer state across them (FSDP) so models too large for one GPU still train. Muon works on the sharded weights. `ycode-lm autotrain` drives a whole run across time-limited GPU sessions, saving checkpoints to Hugging Face. [`notebooks/kaggle_train_v5.ipynb`](notebooks/kaggle_train_v5.ipynb) does this on free Kaggle GPUs. To publish any model directory, use `ycode-lm push-hf --model DIR --repo you/name`.
340
+
341
+ **Evaluation.** `ycode-lm eval` reports:
342
+ - **Bits per byte** on code the model never saw. Lower is better. It is comparable across tokenizers, so v1, v2 and v3 compare fairly.
343
+ - **pass@1 / pass@k** on 30 small programming problems, plus **fix@1** on 15 functions with one injected bug each. YCode-LM writes each solution or fix, and it is *executed* against unit tests in an isolated subprocess with a timeout. Only evaluate models you trained yourself, because generated code is run.
344
+
345
+ **Model sizes** (`--preset`; parameter counts are for an 8k vocabulary):
346
+
347
+ | Preset | Layers × width | Heads (KV) | Context | Params | Where to train |
348
+ | --- | --- | --- | --- | --- | --- |
349
+ | **`v5-1.5b`** | 34 × 2048 | 32 (8) | 1024 | **1,523M** | grow from v4; CPU with `--optimizer lion` (slow), or GPUs (`--shard` for several) |
350
+ | `v5-385m` | 34 × 1024 | 16 (4) | 1024 | ~385M | grow from v4; a 16 GB GPU |
351
+ | **`v4-100m`** | 34 × 512 | 8 (2) | 1024 | **100.0M** | grow from v3 (`ycode-lm grow`); GPU recommended for training |
352
+ | **`v3-40m`** | 13 × 512 | 8 (2) | 1024 | **40.8M** | GPU ideal; CPU works but slowly (measured ~2.1k tok/s on 4 Xeon cores with bf16 + compile) |
353
+ | `v3-tiny` | 3 × 64 | 4 (2) | 128 | ~0.7M | tests |
354
+ | `v2-tiny` | 2 × 64 | 4 (2) | 128 | ~0.6M | tests / smoke runs |
355
+ | **`v2-small`** (default) | 8 × 256 | 8 (2) | 512 | ~7.7M | laptop CPU, 2–4 h |
356
+ | `v2-base` | 12 × 512 | 8 (2) | 1024 | ~38M | GPU |
357
+ | `v2-medium` | 16 × 768 | 12 (4) | 1024 | ~107M | GPU, many hours |
358
+ | `v2-large` | 24 × 1024 | 16 (4) | 2048 | ~274M | multi-hour GPU runs |
359
+
360
+ The v1 presets (`tiny`, `small`, `base`, `medium`, `large`) are still available.
361
+
362
+ Use `--layers/--heads/--embd/--context` to customize a preset.
363
+
364
+ **Using it in YCode.** The local model is YCode's default provider. Related settings: `local_model` (`v2`–`v5` or a path), `local_max_tokens` and `local_temperature`. Nothing is sent over the network.
365
+
366
+ **Be realistic about quality.** Frontier coding models are trained on trillions of tokens with thousands of GPUs. A few-million-parameter model trained for an hour or two on a CPU learns real Python syntax, idioms and naming conventions, and can write small functions and short explanations. It will also often be wrong, repetitive or confused. Two consequences:
367
+
368
+ - **Answer-only mode.** In YCode, the local model runs in answer-only mode. It hasn't learned the tool-calling protocol, so it cannot read, edit or run files in your project. YCode shows a notice when it starts. Use Claude (`--provider anthropic`) for autonomous coding tasks.
369
+ - **How to make it better:** more and better data (your own repositories), a bigger preset, a GPU and longer training. The loss figures in `train_log.json` show whether it is still improving.
370
+
371
+ ## Usage
372
+
373
+ ```bash
374
+ cd my-project
375
+ ycode # interactive session
376
+ ycode "add a --verbose flag to the CLI" # one-shot: run the task, then exit
377
+ ycode -p "explain src/auth.ts" # same, with -p
378
+ ycode --local v5 # pick a bundled model (v2-v5) or a model directory
379
+ ycode --provider anthropic # optional: use Claude (needs the [claude] extra and ANTHROPIC_API_KEY)
380
+ ycode --provider anthropic -m claude-sonnet-5-5 # pick a Claude model
381
+ ycode --approval-mode strict # approve every write and non-read-only command
382
+ ycode --yes # auto-approve risky commands (blocked ones stay blocked)
383
+ ycode -C ../other-project # run against another directory
384
+ ```
385
+
386
+ In the interactive session:
387
+
388
+ | Key / command | Action |
389
+ | --- | --- |
390
+ | Enter | Send the request |
391
+ | Esc+Enter (or a line ending in `\`) | Insert a newline |
392
+ | Up / Down | History (stored in `~/.ycode/history`) |
393
+ | Ctrl+C | Interrupt the running task; YCode kills any running command and returns to the prompt |
394
+ | Ctrl+C twice / Ctrl+D | Exit |
395
+ | `/help` | List commands |
396
+ | `/status` | Project, branch, modified files, model, steps used, token usage |
397
+ | `/diff [full] [path...]` | Show the git diff, with a stat summary if it is very large |
398
+ | `/files` | Changed files: working tree plus files written this session |
399
+ | `/model [id]` | Show or switch the model for this session |
400
+ | `/plan` | Show the current plan |
401
+ | `/approval [strict\|normal\|auto]` | Show or change the approval mode |
402
+ | `/clear` | Forget the conversation and clear the screen |
403
+ | `/exit`, `/quit` | Quit |
404
+
405
+ Slash commands are handled locally and are never sent to the model. Each request continues the same conversation, so a follow-up like "now add tests for that" works.
406
+
407
+ ## Examples
408
+
409
+ ```text
410
+ ycode> Add dark mode to the settings page
411
+ ycode> Why does `npm run build` fail? Fix it.
412
+ ycode> Write unit tests for src/utils/date.ts and make sure they pass
413
+ ycode> Rename the `User.fullname` field to `full_name` everywhere
414
+ ycode> Explain how requests are authenticated in this project
415
+ ycode> Commit these changes with a good message # git commit asks for approval
416
+ ```
417
+
418
+ ## Security model
419
+
420
+ YCode gives a language model the ability to edit files and run commands, so it treats both as risky.
421
+
422
+ **Command classification** (`ycode/security/permissions.py`). Every command line is split into segments (`&&`, `||`, `;`, `|`), and command substitutions (`$(...)` and backticks) and `bash -c "..."` strings are classified recursively. The most severe result wins.
423
+
424
+ | Level | Examples | Behavior |
425
+ | --- | --- | --- |
426
+ | SAFE | `npm test`, `pytest`, `git status`, `ls`, `cargo build` | Runs immediately |
427
+ | REQUIRES_APPROVAL | `rm`, `mv`, `sudo`, `chmod`, `chown`, `kill`, `git push`, `git reset --hard`, `git clean`, `git commit`, `git checkout -- .`, `npm publish`, `curl … \| sh`, `find -delete`, writes redirected outside the project, reading `.env`/key files | Shows `⚠ YCode wants to run: … Allow? [y/N/a]` |
428
+ | BLOCKED | `rm -rf /`, `rm -rf ~`, fork bombs, `mkfs`, `dd of=/dev/…`, `shutdown`, writes to raw devices | Never runs, even with `--yes` |
429
+
430
+ At the approval prompt, `y` allows the command once and `a` allows that exact command for the rest of the session. Anything else denies it, and the model is told not to retry.
431
+
432
+ **Approval modes:**
433
+ - `normal` (default): SAFE commands run, risky commands ask, blocked commands are refused.
434
+ - `strict`: also asks before every file write and every command that isn't read-only.
435
+ - `auto`: risky commands run without asking. Blocked commands are still refused.
436
+
437
+ **Filesystem confinement.** Every path is resolved, symlinks included, and has to stay inside the project directory. `../`, absolute paths and symlinks that point outside the project are rejected. Writes into `.git/` are always rejected. Reading files that look like secrets (`.env*`, `*.pem`, `id_rsa`, ...) asks first. `allow_outside_workspace = true` in your *global* config lifts the confinement.
438
+
439
+ **Untrusted repositories.** A project's `.ycode/config.toml` can only make settings *stricter*. It cannot switch on `auto` approvals or access outside the workspace, so cloning a repository can't silently loosen your safety settings.
440
+
441
+ **Git.** YCode never commits or pushes on its own. Those commands always need your approval.
442
+
443
+ **Limits.** This is a guardrail, not a sandbox. When the agent runs code it wrote (`python script.py`, `npm test`), that code can do anything your user account can. For untrusted code, run YCode inside a container or VM.
444
+
445
+ ## Configuration
446
+
447
+ Settings are resolved in this order, with later sources winning:
448
+
449
+ 1. Built-in defaults
450
+ 2. Global config: `~/.ycode/config.toml` (move this directory with `YCODE_HOME`)
451
+ 3. Project config: `<project>/.ycode/config.toml` (can only tighten security settings)
452
+ 4. Environment: `YCODE_PROVIDER`, `YCODE_LOCAL_MODEL`, `YCODE_MODELS_DIR`, `YCODE_MODEL`, `YCODE_MAX_STEPS`, `YCODE_MAX_TOKENS`, `YCODE_EFFORT`, `YCODE_APPROVAL_MODE`, `YCODE_THEME`, `YCODE_COMMAND_TIMEOUT`, `YCODE_IGNORE_DIRS`
453
+ 5. Command-line flags
454
+
455
+ ```toml
456
+ # ~/.ycode/config.toml
457
+ provider = "local" # local (default: YCode's own model, no key) | anthropic (Claude)
458
+ local_model = "v5" # v2 | v3 | v4 | v5 | a model directory (default: v5, or v4 when memory is short)
459
+ model = "claude-opus-5-5" # any Claude model ID (provider = "anthropic")
460
+ max_steps = 50 # model calls per task before YCode stops
461
+ max_tokens = 64000 # output token cap per model call
462
+ effort = "high" # low | medium | high | xhigh | max (models that support it)
463
+ approval_mode = "normal" # strict | normal | auto
464
+ theme = "default" # default | mono (no colors)
465
+ command_timeout = 120 # seconds, per command
466
+ max_output_chars = 30000 # command/tool output sent back to the model
467
+ refusal_fallback = true # retry declined requests on Anthropic's recommended fallback model
468
+ # ignore_dirs = [...] # replaces the default ignore list
469
+ extra_ignore_dirs = ["generated", "vendor"] # adds to it
470
+ ```
471
+
472
+ The default model is `claude-opus-5-5`. You can set any model ID, for example `claude-sonnet-5-5`, `claude-fable-5-1`, `claude-haiku-4-5` or `claude-sonnet-4-5`. YCode adapts the request to the model. It turns on adaptive thinking and `effort` only on models that support them, and server-side refusal fallbacks only on Claude Fable 5.1, Opus 5.5, Opus 5 and Sonnet 5.5. If you route through a gateway with `ANTHROPIC_BASE_URL`, YCode sends a plainer request shape.
473
+
474
+ By default these directories are ignored: `node_modules .git dist build .next .nuxt .cache venv .venv env __pycache__ .pytest_cache .mypy_cache .ruff_cache target coverage .gradle .idea .dart_tool .tox .eggs`.
475
+
476
+ ## YCODE.md instructions
477
+
478
+ Put a `YCODE.md` at the root of your repository (or at `.ycode/YCODE.md`) and YCode adds it to the agent's instructions for every task in that project:
479
+
480
+ ```markdown
481
+ # YCode Project Instructions
482
+
483
+ Use TypeScript.
484
+
485
+ Run npm test before finishing.
486
+
487
+ Do not modify generated files.
488
+
489
+ Use functional React components.
490
+ ```
491
+
492
+ The banner and `/status` show when instructions are loaded. Files longer than 20,000 characters are truncated.
493
+
494
+ ## Development
495
+
496
+ ```bash
497
+ pip install -e ".[dev]"
498
+ python -m pytest
499
+ ```
500
+
501
+ Set `YCODE_DEBUG=1` to see full tracebacks for unexpected internal errors. Normal user errors are always shown as short messages, never as tracebacks.
502
+
503
+ Some guidelines:
504
+ - Keep the agent free of UI and provider imports. Communicate through `AgentEvents` and `LLMProvider`.
505
+ - Tools return a `ToolResult` and never raise for expected failures. The registry turns exceptions into error results the model can react to.
506
+ - New command patterns belong in `security/permissions.py`, with tests in `tests/test_security.py`.
507
+
508
+ ## Testing
509
+
510
+ The test suite needs no API key and makes no network calls:
511
+
512
+ - `tests/test_anthropic_provider.py` mocks the Anthropic client: request shape, stream parsing, error mapping and missing credentials.
513
+ - `tests/test_anthropic_wire.py` runs the real `anthropic` SDK against a mock HTTP transport that returns canned server-sent events. It checks the exact JSON YCode sends across a full tool-use round trip.
514
+ - `tests/test_lm.py` covers YCode-LM: tokenizer round-trips (including Unicode), special tokens, a KV-cache check against full recomputation, answer-only loss masking, dataset preparation, pretraining that measurably lowers loss, SFT, resume, checkpoint round trips and the `ycode-lm` CLI end to end. These tests are skipped if PyTorch isn't installed.
515
+ - `tests/test_local_provider.py` checks the local provider: no API key, no tools sent, `--local` from the CLI, and how bundled models are found.
516
+ - `tests/test_assist.py` checks answering without an API: documentation lookups and checked function writing.
517
+ - `tests/test_agent_loop.py` drives the agent with a scripted fake provider: multi-step tasks, parallel tool calls, the step limit, interruption, truncated tool calls and refusals.
518
+ - The other test files cover configuration, the banner, file tools, path security, command classification and approvals, command execution (timeouts, exit codes, secret stripping), git, project detection and YCODE.md, slash commands, and the CLI and REPL.
519
+
520
+ ```bash
521
+ python -m pytest -q
522
+ ```
523
+
524
+ ## Roadmap
525
+
526
+ - YCode-LM: tool-calling training data, so the local model can drive the agent
527
+ - YCode-LM: train v5 much longer on GPUs (`ycode-lm autotrain`, `--shard` are ready), then publish it on Hugging Face
528
+ - YCode-LM: faster CPU inference for v5 (8-bit weights)
529
+ - More providers: OpenAI-compatible, local models through Ollama
530
+ - Session persistence and resume (`ycode --continue`)
531
+ - Context compaction for very long sessions
532
+ - Optional sandboxed command execution (containers)
533
+ - `/undo` that restores files to the state before the last task
534
+ - MCP server support for extra tools
535
+ - A richer TUI mode (Textual) as an optional front-end
Code-agent-main/YCODE.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # YCode Project Instructions
2
+
3
+ This repository is YCode itself (Python 3.10+).
4
+
5
+ - Run `python -m pytest -q` before finishing; all tests must pass without an API key or network.
6
+ - Keep layers separate: `agent/` must not import from `ui/` or a specific provider in `llm/`.
7
+ - Tools return `ToolResult` objects; don't let expected failures raise out of a tool.
8
+ - Any change to command classification in `security/permissions.py` needs a test in `tests/test_security.py`.
9
+ - Never print or log API keys.
Code-agent-main/models/ycode-lm-v2/README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YCode-LM v2 (7.7M parameters)
2
+
3
+ See also the larger [YCode-LM v3 (40.8M)](../ycode-lm-v3/README.md).
4
+
5
+ A small programming language model trained **from scratch** with this repository's `ycode-lm`
6
+ pipeline: its own BPE tokenizer, its own transformer and training loop, no pretrained weights.
7
+ It is published here so `ycode --local` works right after cloning, with no API key and no training.
8
+
9
+ | | |
10
+ | --- | --- |
11
+ | Architecture | decoder-only transformer, 8 layers × 256 wide, 8 query / 2 key-value heads (GQA), QK-norm, RoPE, SwiGLU, RMSNorm |
12
+ | Parameters | 7,738,112 |
13
+ | Context | 512 tokens |
14
+ | Tokenizer | byte-level BPE, 8,192 tokens (embedded in `model.pt`) |
15
+ | Weights | bfloat16 (15.6 MB), converted to float32 on load |
16
+ | Pretraining | 10,000 steps, ~82M tokens of Python (176 MB: the standard library plus installed packages), warmup-stable-decay LR, annealing with 20% instruction data |
17
+ | Instruction tuning | 2,400 packed steps on 109k pairs generated from real code: write and explain functions, complete stubs, write docstrings, explain classes, fix injected bugs |
18
+ | Hardware | 4-core Intel Xeon CPU (bf16, `torch.compile`) |
19
+
20
+ ## Results
21
+
22
+ Measured with `ycode-lm eval` on 11 packages the model never saw (click, anyio, jsonschema,
23
+ markdown_it, starlette, uvicorn, h11, attr, pluggy, filelock, idna):
24
+
25
+ | | v1 (6.9M) | **v2 (this model)** |
26
+ | --- | --- | --- |
27
+ | Bits per byte on held-out code (lower is better) | 1.095 | **0.966** |
28
+ | pass@1 on 30 executed coding problems | 0 / 30 | 0 / 30 |
29
+ | fix@1 on 15 buggy functions (fixes executed against tests) | 0 / 15 | 5 / 15 |
30
+
31
+ It writes fluent, well-formed Python and follows the instruction formats, but its code is usually
32
+ wrong. It is a learning/research model, not a coding assistant. In YCode it runs in answer-only
33
+ mode (no tools).
34
+
35
+ ## Use
36
+
37
+ ```bash
38
+ pip install -e ".[local]"
39
+ ycode --local models/ycode-lm-v2
40
+ ycode-lm chat --model models/ycode-lm-v2
41
+ ycode-lm eval --model models/ycode-lm-v2 --heldout path/to/code/it/never/saw
42
+ ```
43
+
44
+ To train your own (or continue from this one), see "Your own LLM" in the main README.
Code-agent-main/models/ycode-lm-v2/info.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "step": 2400,
3
+ "stage": "sft",
4
+ "val_loss": 0.9569745600223541,
5
+ "version": 2,
6
+ "params": 7738112,
7
+ "dtype": "bf16",
8
+ "config": {
9
+ "vocab_size": 8192,
10
+ "block_size": 512,
11
+ "n_layer": 8,
12
+ "n_head": 8,
13
+ "n_embd": 256,
14
+ "dropout": 0.0,
15
+ "n_kv_head": 2,
16
+ "qk_norm": true,
17
+ "arch_version": 2
18
+ }
19
+ }
Code-agent-main/models/ycode-lm-v2/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c41151d3759a4d8e6cea992d9e1285aa61728c7220f73d6523639f0a9321a541
3
+ size 15585317
Code-agent-main/models/ycode-lm-v3/README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YCode-LM v3 (40.8M parameters)
2
+
3
+ The largest YCode-LM, trained **from scratch** with this repository's `ycode-lm` pipeline: its own
4
+ BPE tokenizer, its own transformer and training loop, no pretrained weights.
5
+
6
+ | | |
7
+ | --- | --- |
8
+ | Architecture | decoder-only transformer, 13 layers × 512 wide, 8 query / 2 key-value heads (GQA), QK-norm, RoPE, SwiGLU, RMSNorm |
9
+ | Parameters | 40,836,608 |
10
+ | Context | 1,024 tokens |
11
+ | Tokenizer | byte-level BPE, 8,192 tokens (shared with v2, embedded in `model.pt`) |
12
+ | Weights | bfloat16 (81.8 MB), converted to float32 on load |
13
+ | Pretraining | 7,300 steps × 8,192 tokens ≈ 60M tokens of Python (same 176 MB corpus as v2), **Muon** optimizer for the transformer matrices + AdamW for embeddings/norms, warmup-stable-decay LR, annealing with 20% instruction data |
14
+ | Instruction tuning | 1,400 packed steps on 87k pairs generated from real code. Answers use compact one-line docstrings and only standalone functions for write/complete tasks |
15
+ | Hardware | 4-core Intel Xeon CPU (bf16, `torch.compile`), about 10 hours in total |
16
+
17
+ ## Results
18
+
19
+ All three models were evaluated the same way with `ycode-lm eval`. Bits per byte is measured on 11
20
+ packages none of them saw in training (click, anyio, jsonschema, markdown_it, starlette, uvicorn, h11,
21
+ attr, pluggy, filelock, idna). The code tasks are executed against unit tests.
22
+
23
+ | | v1 (6.9M) | v2 (7.7M) | **v3 (40.8M)** |
24
+ | --- | --- | --- | --- |
25
+ | Bits per byte on held-out code (lower is better) | 1.095 | 0.966 | **0.857** |
26
+ | Base model before instruction tuning (pretraining held-out loss) | 2.07 nats/token* | 2.063 | **1.805** |
27
+ | Write a function from scratch, pass@1 (30 problems) | 0 / 30 | 0 / 30 | 0 / 30 |
28
+ | Fix an injected bug, fix@1 (15 functions) | 0 / 15 | 5 / 15 | 4 / 15 |
29
+
30
+ \*v1 used a different tokenizer and held-out split, so its per-token loss is not directly comparable.
31
+
32
+ **What this means:**
33
+ - v3 models real code clearly best: it predicts unseen code 11% better than v2 and 22% better than v1.
34
+ - It writes short, well-formed answers and can find and fix simple bugs. For example, given
35
+ `result = 1` in a summing loop it answers "The bug is in `result = 1`. It should be `result = 0`."
36
+ and returns the corrected function.
37
+ - It does **not** yet write correct functions from a description. On bug fixing, v2 and v3 are
38
+ within noise of each other on 15 problems.
39
+ - More data and compute (a GPU) are the way forward. The pipeline supports both unchanged.
40
+
41
+ In YCode it runs in answer-only mode (no tools).
42
+
43
+ ## Use
44
+
45
+ ```bash
46
+ pip install -e ".[local]"
47
+ ycode --local models/ycode-lm-v3
48
+ ycode-lm chat --model models/ycode-lm-v3
49
+ ```
Code-agent-main/models/ycode-lm-v3/info.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "step": 1400,
3
+ "stage": "sft",
4
+ "val_loss": 0.5056432619690895,
5
+ "version": 3,
6
+ "params": 40844416,
7
+ "dtype": "bf16",
8
+ "config": {
9
+ "vocab_size": 8192,
10
+ "block_size": 1024,
11
+ "n_layer": 13,
12
+ "n_head": 8,
13
+ "n_embd": 512,
14
+ "dropout": 0.0,
15
+ "n_kv_head": 2,
16
+ "qk_norm": true,
17
+ "arch_version": 3
18
+ }
19
+ }
Code-agent-main/models/ycode-lm-v3/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:add7e319e66c14eb1ef05d26a1b49b4b7bf591e3031ecc6f5e0f712c806eb8e2
3
+ size 81808535
Code-agent-main/models/ycode-lm-v4/README.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YCode-LM v4 (100M parameters)
2
+
3
+ The 100M-parameter YCode-LM, **grown from YCode-LM v3** rather than trained from scratch:
4
+ v3's 13 trained layers were kept and 21 new layers were inserted between them, each a copy of its
5
+ neighbour with zeroed output projections. The grown model computed exactly what v3 computed, and
6
+ continued pretraining then trained the new layers.
7
+
8
+ | | |
9
+ | --- | --- |
10
+ | Architecture | decoder-only transformer, 34 layers × 512 wide, 8 query / 2 key-value heads (GQA), QK-norm, RoPE, SwiGLU, RMSNorm |
11
+ | Parameters | 100,047,616 |
12
+ | Context | 1,024 tokens |
13
+ | Tokenizer | byte-level BPE, 8,192 tokens (shared with v2/v3) |
14
+ | Weights | bfloat16, **sharded** into `model-0000N-of-00005.pt` files (each < 45 MB, under GitHub's file limit); `model.pt` holds the config, the tokenizer and the shard index |
15
+ | Continued pretraining | 3,000 steps × 8,192 tokens ≈ 24.6M tokens on top of v3, Muon (lr 0.015) + AdamW (lr 1e-3), warmup-stable-decay with annealing |
16
+ | Instruction tuning | 700 packed steps on the corrected 87k-pair instruction set |
17
+ | Hardware | 4-core Intel Xeon CPU, ~760 tokens/s, about 13 hours |
18
+
19
+ ## Results
20
+
21
+ All four models were evaluated the same way with `ycode-lm eval`. Bits per byte is measured on 11
22
+ packages none of them saw in training. The code tasks are executed against unit tests.
23
+
24
+ | | v1 (6.9M) | v2 (7.7M) | v3 (40.8M) | **v4 (100M)** |
25
+ | --- | --- | --- | --- | --- |
26
+ | Bits per byte on held-out code (lower is better) | 1.095 | 0.966 | 0.857 | **0.814** |
27
+ | Write a function from scratch, pass@1 (30 problems) | 0 / 30 | 0 / 30 | 0 / 30 | **1 / 30** |
28
+ | Fix an injected bug, fix@1 (15 functions) | 0 / 15 | 5 / 15 | 4 / 15 | **5 / 15** |
29
+
30
+ **What this means:**
31
+ - v4 models unseen code best of all versions: 5% better than v3 and 26% better than v1.
32
+ - It is the first YCode-LM to write a correct function from a description:
33
+ `square(x)` → `return x * x`. That answer also passes extra tests (0, 5, 1.5, -7). One problem
34
+ out of 30 is a small step, not a reliable skill.
35
+ - It fixed 5 of 15 injected bugs (`add`, `is_even`, `filter_even`, `celsius_to_fahrenheit`,
36
+ `is_palindrome`).
37
+ - **The trade-off:** on the training corpus's own validation split, v4's pretraining loss ended
38
+ slightly *worse* than v3's (1.832 vs 1.805 nats/token). Raising the learning rate again after
39
+ growing disturbed v3's tuned weights, and 24.6M tokens is far too little to fully train 60M new
40
+ parameters. It still generalises better to unseen packages (bits per byte above). More training,
41
+ ideally on a GPU, is the clear next step.
42
+
43
+ ## Use
44
+
45
+ ```bash
46
+ pip install -e ".[local]"
47
+ ycode --local models/ycode-lm-v4
48
+ ```
49
+
50
+ Keep all six `model*.pt` files together. Loading reassembles the shards automatically.
Code-agent-main/models/ycode-lm-v4/info.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "step": 700,
3
+ "stage": "sft",
4
+ "val_loss": 0.5377802371978759,
5
+ "version": 4,
6
+ "params": 100047616,
7
+ "dtype": "bf16",
8
+ "config": {
9
+ "vocab_size": 8192,
10
+ "block_size": 1024,
11
+ "n_layer": 34,
12
+ "n_head": 8,
13
+ "n_embd": 512,
14
+ "dropout": 0.0,
15
+ "n_kv_head": 2,
16
+ "qk_norm": true,
17
+ "arch_version": 4
18
+ },
19
+ "files": [
20
+ "model.pt",
21
+ "model-00001-of-00005.pt",
22
+ "model-00002-of-00005.pt",
23
+ "model-00003-of-00005.pt",
24
+ "model-00004-of-00005.pt",
25
+ "model-00005-of-00005.pt"
26
+ ]
27
+ }
Code-agent-main/models/ycode-lm-v4/model-00001-of-00005.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:961f55773b4f423f96d22b20d5712637108465ad70471d59767174abc236164d
3
+ size 44993885
Code-agent-main/models/ycode-lm-v4/model-00002-of-00005.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64a3035fea4b8f3c67d6157effb4fecbfb611513973becc244ce9e782134f085
3
+ size 43688311
Code-agent-main/models/ycode-lm-v4/model-00003-of-00005.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:068af5d12a43b770056c9e811eb1cf29419184a2053262cc0a145a2bc50915f4
3
+ size 44603673
Code-agent-main/models/ycode-lm-v4/model-00004-of-00005.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2187ef1f0121ec9b240674edd729fb7b2d383d8df78a68795bef0618c5828f0b
3
+ size 44343735
Code-agent-main/models/ycode-lm-v4/model-00005-of-00005.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5853cebc4e0c4022378a80727ab6765f449307fc1f3af12e936d3ec62986a59c
3
+ size 22565529
Code-agent-main/models/ycode-lm-v4/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f150539f8c69c16374cfe712220f49221fc2bbfc3182b1ca24d54b75dc97216
3
+ size 91937
Code-agent-main/models/ycode-lm-v5/README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YCode-LM v5 (1.5B parameters)
2
+
3
+ The 1.5-billion-parameter YCode-LM, **grown from YCode-LM v4** and trained entirely on a CPU.
4
+ v4's 34 layers × 512 channels were widened 4× to 2048 channels: new channels and attention heads
5
+ started with zeroed outputs, so the grown model computed exactly what v4 computed (checked: identical
6
+ loss on the same batches before training). Continued pretraining then trained the new capacity.
7
+
8
+ | | |
9
+ | --- | --- |
10
+ | Architecture | decoder-only transformer, 34 layers × 2048 wide, 32 query / 8 key-value heads (GQA), QK-norm, RoPE, SwiGLU, RMSNorm |
11
+ | Parameters | 1,523,202,304 |
12
+ | Context | 1,024 tokens |
13
+ | Tokenizer | byte-level BPE, 8,192 tokens (shared with v2–v4) |
14
+ | Weights | bfloat16, **sharded** into 103 `model-*-of-00103.pt` files (each < 45 MB, under GitHub's file limit); `model.pt` holds the config, the tokenizer and the shard index |
15
+ | Continued pretraining | 600 steps × 4,096 tokens ≈ 2.5M tokens, Lion (lr 3e-5), warmup-stable-decay with 20% instruction data during the decay |
16
+ | Instruction tuning | 60 packed steps, Lion (lr 1.5e-5) |
17
+ | Hardware | 4-core Intel Xeon CPU, 15 GB of RAM. 55–75 tokens/s on a CPU with AMX bf16 units, 8–9 tokens/s on one without |
18
+
19
+ ## Training a 1.5B model in 15 GB of RAM
20
+
21
+ Weights, gradients and AdamW state for 1.5B parameters take ~24 GB in fp32. v5 used a low-memory
22
+ mode (`ycode-lm train --optimizer lion`):
23
+
24
+ - **Lion** keeps one momentum value per weight (AdamW keeps two), stored in bf16: 3 GB.
25
+ - **Updates inside backward:** each weight is updated as soon as its gradient is ready, and the
26
+ gradient is freed. A full set of gradients (6 GB) never exists.
27
+ - Gradient checkpointing, bf16 autocast without the cast-weight cache, memory-mapped checkpoints.
28
+
29
+ Peak memory was about 12 GB. Training ran in restartable segments that saved checkpoints, and it
30
+ survived three container restarts.
31
+
32
+ ## Results
33
+
34
+ Evaluated with `ycode-lm eval`, the same way as every earlier version. Bits per byte is measured on
35
+ 11 Python packages none of the models saw in training. The code tasks are executed against unit tests.
36
+
37
+ | | v1 (6.9M) | v2 (7.7M) | v3 (40.8M) | v4 (100M) | **v5 (1,523M)** |
38
+ | --- | --- | --- | --- | --- | --- |
39
+ | Bits per byte on held-out code (lower is better) | 1.095 | 0.966 | 0.857 | 0.814 | **0.758** |
40
+ | Write a function from scratch, pass@1 (30 problems) | 0 / 30 | 0 / 30 | 0 / 30 | **1 / 30** | 0 / 30 |
41
+ | Fix an injected bug, fix@1 (15 functions) | 0 / 15 | **5 / 15** | 4 / 15 | **5 / 15** | 4 / 15 |
42
+
43
+ **What this means:**
44
+ - v5 models unseen code best of all versions: **7% better than v4**, the largest step between any two
45
+ versions, after only ~2.5M tokens of extra training.
46
+ - That has not yet turned into solving more tasks. v5 fixed 4 bugs (`total`, `filter_even`,
47
+ `celsius_to_fahrenheit`, `is_palindrome`) and wrote no fully correct function. With 30 and 15 tasks,
48
+ a difference of one is within noise. Its instruction tuning was cut to 60 steps by the slow CPU.
49
+ - A 1.5B model would ideally see tens of billions of training tokens; v5 saw a few million on top of
50
+ v4. It is badly under-trained, and more training (ideally on GPUs: `ycode-lm autotrain`, `--shard`)
51
+ is the clear next step.
52
+ - YCode uses v5 as its default model on machines with at least 4 GB of free memory, and v4 otherwise. v4 is just as good at the benchmark tasks and much faster on a CPU, so `ycode --local v4` is a good choice on slow machines.
53
+
54
+ ## Use
55
+
56
+ ```bash
57
+ pip install -e .
58
+ ycode # v5 is the default; loads in bfloat16: about 3 GB of RAM
59
+ ycode-lm chat --model models/ycode-lm-v5
60
+ ```
61
+
62
+ Keep all 104 `model*.pt` files together. Loading reassembles the shards automatically.
Code-agent-main/models/ycode-lm-v5/info.json ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "step": 60,
3
+ "stage": "sft",
4
+ "val_loss": 0.5093614831566811,
5
+ "version": 5,
6
+ "params": 1523202304,
7
+ "dtype": "bf16",
8
+ "config": {
9
+ "vocab_size": 8192,
10
+ "block_size": 1024,
11
+ "n_layer": 34,
12
+ "n_head": 32,
13
+ "n_embd": 2048,
14
+ "dropout": 0.0,
15
+ "n_kv_head": 8,
16
+ "qk_norm": true,
17
+ "arch_version": 5
18
+ },
19
+ "files": [
20
+ "model.pt",
21
+ "model-00001-of-00103.pt",
22
+ "model-00002-of-00103.pt",
23
+ "model-00003-of-00103.pt",
24
+ "model-00004-of-00103.pt",
25
+ "model-00005-of-00103.pt",
26
+ "model-00006-of-00103.pt",
27
+ "model-00007-of-00103.pt",
28
+ "model-00008-of-00103.pt",
29
+ "model-00009-of-00103.pt",
30
+ "model-00010-of-00103.pt",
31
+ "model-00011-of-00103.pt",
32
+ "model-00012-of-00103.pt",
33
+ "model-00013-of-00103.pt",
34
+ "model-00014-of-00103.pt",
35
+ "model-00015-of-00103.pt",
36
+ "model-00016-of-00103.pt",
37
+ "model-00017-of-00103.pt",
38
+ "model-00018-of-00103.pt",
39
+ "model-00019-of-00103.pt",
40
+ "model-00020-of-00103.pt",
41
+ "model-00021-of-00103.pt",
42
+ "model-00022-of-00103.pt",
43
+ "model-00023-of-00103.pt",
44
+ "model-00024-of-00103.pt",
45
+ "model-00025-of-00103.pt",
46
+ "model-00026-of-00103.pt",
47
+ "model-00027-of-00103.pt",
48
+ "model-00028-of-00103.pt",
49
+ "model-00029-of-00103.pt",
50
+ "model-00030-of-00103.pt",
51
+ "model-00031-of-00103.pt",
52
+ "model-00032-of-00103.pt",
53
+ "model-00033-of-00103.pt",
54
+ "model-00034-of-00103.pt",
55
+ "model-00035-of-00103.pt",
56
+ "model-00036-of-00103.pt",
57
+ "model-00037-of-00103.pt",
58
+ "model-00038-of-00103.pt",
59
+ "model-00039-of-00103.pt",
60
+ "model-00040-of-00103.pt",
61
+ "model-00041-of-00103.pt",
62
+ "model-00042-of-00103.pt",
63
+ "model-00043-of-00103.pt",
64
+ "model-00044-of-00103.pt",
65
+ "model-00045-of-00103.pt",
66
+ "model-00046-of-00103.pt",
67
+ "model-00047-of-00103.pt",
68
+ "model-00048-of-00103.pt",
69
+ "model-00049-of-00103.pt",
70
+ "model-00050-of-00103.pt",
71
+ "model-00051-of-00103.pt",
72
+ "model-00052-of-00103.pt",
73
+ "model-00053-of-00103.pt",
74
+ "model-00054-of-00103.pt",
75
+ "model-00055-of-00103.pt",
76
+ "model-00056-of-00103.pt",
77
+ "model-00057-of-00103.pt",
78
+ "model-00058-of-00103.pt",
79
+ "model-00059-of-00103.pt",
80
+ "model-00060-of-00103.pt",
81
+ "model-00061-of-00103.pt",
82
+ "model-00062-of-00103.pt",
83
+ "model-00063-of-00103.pt",
84
+ "model-00064-of-00103.pt",
85
+ "model-00065-of-00103.pt",
86
+ "model-00066-of-00103.pt",
87
+ "model-00067-of-00103.pt",
88
+ "model-00068-of-00103.pt",
89
+ "model-00069-of-00103.pt",
90
+ "model-00070-of-00103.pt",
91
+ "model-00071-of-00103.pt",
92
+ "model-00072-of-00103.pt",
93
+ "model-00073-of-00103.pt",
94
+ "model-00074-of-00103.pt",
95
+ "model-00075-of-00103.pt",
96
+ "model-00076-of-00103.pt",
97
+ "model-00077-of-00103.pt",
98
+ "model-00078-of-00103.pt",
99
+ "model-00079-of-00103.pt",
100
+ "model-00080-of-00103.pt",
101
+ "model-00081-of-00103.pt",
102
+ "model-00082-of-00103.pt",
103
+ "model-00083-of-00103.pt",
104
+ "model-00084-of-00103.pt",
105
+ "model-00085-of-00103.pt",
106
+ "model-00086-of-00103.pt",
107
+ "model-00087-of-00103.pt",
108
+ "model-00088-of-00103.pt",
109
+ "model-00089-of-00103.pt",
110
+ "model-00090-of-00103.pt",
111
+ "model-00091-of-00103.pt",
112
+ "model-00092-of-00103.pt",
113
+ "model-00093-of-00103.pt",
114
+ "model-00094-of-00103.pt",
115
+ "model-00095-of-00103.pt",
116
+ "model-00096-of-00103.pt",
117
+ "model-00097-of-00103.pt",
118
+ "model-00098-of-00103.pt",
119
+ "model-00099-of-00103.pt",
120
+ "model-00100-of-00103.pt",
121
+ "model-00101-of-00103.pt",
122
+ "model-00102-of-00103.pt",
123
+ "model-00103-of-00103.pt"
124
+ ]
125
+ }
Code-agent-main/models/ycode-lm-v5/model-00001-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afb6784fcfe746bda869bb438cf11a73b6085b06e64d3185b1bb6e67b65124f8
3
+ size 33560525
Code-agent-main/models/ycode-lm-v5/model-00002-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4810a38f8034caed7957c5f012235af1e0a75838ce97442daea8ef7354323ccd
3
+ size 43523441
Code-agent-main/models/ycode-lm-v5/model-00003-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ace4ad13912e6b42be6167df2501b0e86b7645c18ff13ada1fb54036927ac835
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00004-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc9693fc86b58bd3876e8744e66eaec6ae54bffe018481d0e82fabad62725739
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00005-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eda1e06ef093890df14b6ba39cd1bcf34fa58efdcfbb94e51dc099581d35a1a2
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00006-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9984c157d39719c6946b0d6bbed7406070a985ca50990a07989b1b5a8946beb1
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00007-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bab4af1b31d732ddab6ff5b9867892ee53f45eb5d1a82f23308d57a29f11f2ff
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00008-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ddec4cd6da1d5dde02cbf4aa97b8bc7d7dbe9d8693a34e4cad4c059252e7b74
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00009-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f37c8f1dc7e9fbd5e10be412f7cfb29b491bcf90ec751f4637abbd157a3351a
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00010-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1164afe87f1a4293be3a18765d9595885f7c3f4c8928c5f87dc8ebc9e9f1ca07
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00011-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c753815abcedeca1841ae02838c0d249131b71278add0790bff0a01b95b651c
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00012-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b550d0cb07c6e6af2b9f163bebb042a717dfe2c3a673ea88040707c8c775632e
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00013-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7a77ef7b3924df87a6a05e04f10e6f42d4dbdac163199d51f3d14f495f1a4f7
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00014-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a876ecc507ec7e3c6740aa754c0e85bbccf969588d3860afbdb42f801fe7e7f0
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00015-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2fd7fe47fba754513b2b57eef76b4f9a988ac190e520bec6533ea9c0ab862f0
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00016-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c6efcd1a8b4b2d8782d3db4c9bb1d26a8b4406ccb97e6ced7ddb49e6377b9f9
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00017-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e54dbc95b695c00a36e2a8d9cb873c1efdf212e818f869387ae133ef8c8ca59
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00018-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:777d6e9c09225e9861ee3fea5d6e680e8900487b5b9afdae760aecbb82f7b938
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00019-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a9c40570e3dd449056a205ff8b6b9ed857579b730e9dd13cd542910864b5845
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00020-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7781407201ec22454a9dfe1e0df55679ab7782888252bf74eeb408219b0796db
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00021-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb5d8f51e0c86aefe23951dc4b1522c01e549a3b6e7e3a310052134c85744a6c
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00022-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42cfbe77e58237ef5cff76b34561f369f696af4920c47349192fae5b5c6a5d32
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00023-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b3e9f260378cbab9af16c6b89ab4f68c1b2e81a464118e6def83ff5f70d92ea
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00024-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a7f934228bf51343e73a8d56e937812ff1dbe28c2fcf11db622525680645115
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00025-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bfc8feb483b56a20953aaa674dcc7cda637666cbe74229c1331e5c61a559414d
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00026-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:056341c06293ded4b744b9c4fca012a195492c128ac9b44b83282f0fdfb67db9
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00027-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6951910520f56ceb6909987c90e095a0d4128e51b6659dbad1416ff08447dca8
3
+ size 22546116
Code-agent-main/models/ycode-lm-v5/model-00028-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:610348ff139ac765a969eca2448778122c6f02b700cb3454091e830cbac366f5
3
+ size 43527802
Code-agent-main/models/ycode-lm-v5/model-00029-of-00103.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:644716475242a6f01044f9461d30b992e23e0743df9b86832bdbdcb5dd871df8
3
+ size 22546116