Cofos v2 Multilingual Python Code Assistant

Cofos v2 is a 522M-parameter code assistant specialized in Python, with native French/English bilingual support and optional chain-of-thought reasoning. It is the second iteration in the Cofos series by AMEFORGE, built on the proprietary SparseMind architecture.

This model is designed to produce syntactically correct, executable Python code from natural-language instructions in either French or English, with the ability to emit its reasoning before the code when requested.


Model Summary

Field Value
Developer AMEFORGE
Architecture SparseMind v15 (proprietary)
Parameters 522M
Context length 2048 tokens
Vocabulary 16,384 (custom nexusBPE)
Languages French, English
Primary task Python code generation
License Apache 2.0
Status Active development

Intended Use

Primary use cases

  • Python code generation from natural-language prompts (function specs, class designs, algorithm requests)
  • Bilingual coding assistance for developers working in French or English
  • Chain-of-thought reasoning when reasoning steps are useful before the code (toggle via prompt format)
  • Integration as a lightweight code assistant in development pipelines where larger models are impractical

Out-of-scope

This model is not designed for:

  • General conversation or open-ended dialogue
  • Languages other than French and English
  • Code in languages other than Python (some JavaScript and Rust tokens are present in the vocabulary but the model has not been trained for general production in those languages)
  • Tasks requiring large-context reasoning (>2048 tokens)
  • Factual knowledge retrieval, scientific reasoning, or creative writing

Cofos v2 is a specialized coding tool. Use it for what it was built for and pair it with appropriate tools for everything else.


Performance

Evaluated on a held-out set of real Python instruction prompts (no overlap with training data).

Metric Value
Real-syntax-valid (held-out, n=100) 63.0%
Validation loss 3.08
Model size (on disk) ~2.1 GB (fp32)

The model has been observed to generate syntactically valid Python with reasonable semantic alignment to short-to-medium instructions. Performance degrades with very long contexts (>1500 tokens) and on instructions that combine multiple distinct subtasks.


Usage

Loading

from huggingface_hub import hf_hub_download
import torch

# Download checkpoint
checkpoint_path = hf_hub_download(repo_id="AMFORGE/cofos_v2", filename="cofos_model.pt")
tokenizer_path  = hf_hub_download(repo_id="AMFORGE/cofos_v2", filename="cofos_tokenizer.model")

# Loading requires the AMEFORGE inference runtime. Contact AMEFORGE for access
# to the runtime, or use the streaming inference script provided with the model.

Prompt format

Cofos v2 expects a structured prompt format with explicit XML-style tags. The basic pattern is:

<instruction>Write a Python function that ...</instruction>

For chain-of-thought generation, prefix with a <thought> tag:

<instruction>Write a Python function that ...</instruction>
<thought>

The model will then generate its reasoning, followed by the code block.


Training

Cofos v2 was trained from scratch on a curated mix of:

  • Multi-source distilled instruction data with chain-of-thought reasoning (in French and English)
  • Real Python instruction-following data from public datasets
  • A small synthetic component for algorithmic diversity

Training was conducted with the proprietary SparseMind training pipeline, with periodic safety checkpointing to ensure reproducibility and recovery from interruptions.

Tokenizer: AMFORGE/cofos_tok_v2 โ€” a custom SentencePiece model with French-aware coverage, structural XML tags as atomic tokens, and Python keyword/builtin atoms for compact representation of code.


Lineage

cofos_tok_v2 (tokenizer)
       โ†“
cofos_v2 (this model) โ€” code-specialized from scratch

Cofos v2 is a standalone code-specialized model. It is not a derivative of any other published model.


Limitations & Biases

  • Capacity: At 522M parameters, Cofos v2 has limited capacity for complex multi-step reasoning compared to billion-parameter models. Use it for focused coding tasks, not as a general-purpose assistant.
  • Language coverage: The model is bilingual FR/EN. Prompts in other languages will produce degraded output or fall back to broken English/French.
  • Hallucination: As with all autoregressive language models, Cofos v2 can produce code that looks plausible but is incorrect. Always test generated code before use.
  • Training data: While care was taken to use clean, publicly-sourced datasets, the model may reflect biases present in those datasets.
  • No safety alignment: Cofos v2 has not undergone RLHF or any explicit safety alignment beyond pre-training data curation. It should not be deployed in user-facing products without additional safety layers.

Environmental Considerations

Cofos v2 is intentionally small (522M parameters) to minimize the compute footprint of both training and inference. It can run on a single consumer GPU and is suitable for on-device deployment after appropriate optimization.


License

This model is released under the Apache 2.0 license. You are free to use, modify, and redistribute it, including for commercial purposes, subject to the terms of the license.


Citation

If you use Cofos v2 in your work, please cite:

@misc{cofos_v2_2026,
  title  = {Cofos v2: A Multilingual Python Code Assistant},
  author = {{AMEFORGE}},
  year   = {2026},
  url    = {https://huggingface.co/AMFORGE/cofos_v2}
}

Contact

For questions, collaborations, or access to the AMEFORGE inference runtime:

  • Organization: AMEFORGE
  • HuggingFace: @AMFORGE

Cofos is part of a broader family of specialized models being developed by AMEFORGE under the SparseMind architecture program. See the AMFORGE organization page for related work.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results