Cohere logo

North Mini Code

Northv1.0Current
byCohereCohere(ai lab)
Released June 9, 2026
Context262.1K tokens
Price (In / Out)Free / Free
CategoryLarge Language Model
Max Output65.5K tokens

About North Mini Code

North Mini Code is Cohere's open-weight Mixture-of-Experts model for agentic coding, repository-level software engineering, terminal workflows, tool use, and local deployment.

Capabilities

reasoningagentic codingtool usestructured outputmultilinguallocal deployment

Input Modalities

text

Output Modalities

text

Technical Details

API Identifier
north-mini-code-1-0
Category
Large Language Model
Context Window
262,144 tokens
Max Output Tokens
65,536 tokens

Tags

codingreasoningopen-weightstool-usemixture-of-experts

Run this model yourself

Local and cloud setup for North Mini Code, with exact configurations, sources and clear evidence limits.

Find a model for your hardware
Local hardwareDocumented setupSources checked Oct 17, 2026

Run complete native North Mini Code with retained reasoning and inert tools on a CPU workstation

Load all 49 publisher-native North Mini Code 1.0 shards as CPU FP32 with released eager attention and experts. A private fixed-schema harness runs a grounded text question and a two-stage tool conversation with retained native reasoning, a fixed authored directory listing and no shell execution. Each full untruncated history is bounded to 3,072 input tokens and up to 1,024 generated tokens inside a 4,096-token sequence. The 256 GiB RAM and 400 GiB disk planning allocation has unknown fit, speed and quality.

Hardware
Intel Xeon w5-2465X / ASUS W790E-SAGE SE,256GiB RAM,400GiB free disk
Runtime
Complete native North Mini Code CPU with Command4 parsing Transformers 5.11.0; Torch 2.11.0 CPU; Cohere Melody 0.15.2; Python 3.12 · CPU
Model format
Safetensors · Full native BF16 checkpoint loaded as CPU FP32; all 128 experts retained, not active-parameter storage · Unquantized native BF16 weights; reader explicitly loads the complete model as CPU FP32
Workload
4,096 token context · 1 concurrent

Based on source documentation; this setup has not been executed by OpenTools. Memory: unknown. No compatible measurement available.

Read the complete setup guide

Before you start

  • Use an existing Intel Xeon w5-2465X / ASUS W790E-SAGE SE workstation with Ubuntu 24.04 x86_64, 256 GiB RAM, 400 GiB free disk and 16 allocated CPU threads. This is a chosen allocation, not a measured minimum.
  • Python 3.12, exact Torch 2.11.0 CPU and released Transformers 5.11.0 with native eager attention and experts; Cohere Melody 0.15.2 parses Command4 reasoning/actions. No custom kernels, CUDA, remote model code or model conversion is selected. Record resolved transitive and system dependencies and stop on installation checks.
  • Read the exact publisher Apache 2 declaration and the archived Apache 2 license text; no native LICENSE file is present in the model listing. This is a model-specific research walkthrough, not legal or production suitability clearance.
  • Only fixed text and inert fixture-tool jobs are accepted. The tool returns an authored dictionary, never host filesystem or shell results. Reasoning and tool results may contain sensitive data in a different application; keep this private educational endpoint on trusted loopback.
  • The frozen North Mini Code canonical is mapped to this publisher-native checkpoint for the documented recipe, not provider serving byte equivalence. Card 256K, config 500000 positions, example 320000 and this 4096-token allocation are distinct scopes. No large-context fit claim is made.

Exact model and requirements

Artifact:
Cohere Labs / North Mini Code 1.0 complete native 49-part Cohere2Moe checkpoint · checkpoint CohereLabs/North-Mini-Code-1.0
Publisher revision:
d11e61a842617a22dc328552fa5bb86231ee4f37
Artifact digest:
Every native weight part and component is pinned separately by the mandatory complete 57-file manifest; no invented whole-composition digest.
Download size:
56.78 GiB
Memory requirement (unknown):
Unknown — Complete FP32 load, cache, expert routing, temporary tensors, environment and OS peak are unmeasured.
System RAM / disk:
Unknown / Unknown
Placement:
single device. All 49 on-disk Safetensors parts form one complete model on one CPU host; no tensor or pipeline sharding. One CPU host, full native model and all experts; no accelerator, quantization, remote-code or component deletion.
KV cache:
Native CPU FP32 grouped-query attention cache with 32 query heads and 4 KV heads. Native 49 layers use global/sliding attention according to the pinned configuration; exact cache/process peak is unmeasured.
Workload:
4,096 token context; Unknown; Unknown; concurrency 1; batch 1; cache cold; repetitions Unknown.
Tokenizer:
Exact native North tokenizer and full publisher standalone Jinja · d11e61a842617a22dc328552fa5bb86231ee4f37
Sampling / reasoning:
Publisher-recommended temperature 1.0 and top-p 0.95 with do_sample=True; author disables top-k filtering with top_k=0, uses one sequence and caps each turn at 1024 new IDs. True native END_OF_TURN ID 255001 is required; capped or malformed output is rejected. Native reasoning=True leaves START_THINKING open in the generation prefix. The harness requires its exact closure followed by one native text or action block and true END_OF_TURN, independently checks Melody cmd4 parsing, and retains complete reasoning and parsed tool calls in subsequent native history. Fixed fixture tool results are dictionaries rendered by the native template; tools are inert and no terminal command is executed.
Runtime prerequisites:
Ubuntu 24.04 x86_64; See prerequisites above.

Official artifact · License

The exact publisher model card and official Cohere North documentation declare Apache License 2.0. The native file listing does not contain an actual LICENSE file; this limitation is retained and the declaration is not represented as a separately fetched native grant. Review the publisher declaration and Apache 2 text yourself; preserve notices, attribution, modifications and applicable patent/termination obligations. No legal clearance, terms acceptance or provider endpoint byte-equivalence is claimed.

  • Complete native serialized weights total 60,970,901,384 bytes across 49 parts. API metadata separately counts 30,484,303,872 BF16 elements; loading those as FP32 implies 121,937,215,488 bytes of floating parameter storage alone, not a measured resident or peak requirement.
  • The card calls this 30B total / 3B active MoE. Active parameters are not the storage or RAM requirement; every expert and weight part remains loaded.
  • 256 GiB RAM, 400 GiB free disk and 16 threads are author-selected planning allocations copied from exact reviewed hardware references. Full loading copies, cache, dependency environment and OS add unknown overhead; no fit or throughput is promised.

One-time setup and hardware

hardware
Unknown — Existing desktop purchase price and incremental hardware cost depend on the reader; unknown.
Existing desktop purchase price and incremental hardware cost depend on the reader; unknown. Tax: unknown.
setup
Unknown — Initial provisioning/build time and labor cost are unknown.
Initial provisioning/build time and labor cost are unknown. Tax: unknown.

Recurring costs

electricity
Unknown — Actual wall power, electricity rate and powered hours are unknown; no TDP-to-wall-power conversion.
Actual wall power, electricity rate and powered hours are unknown; no TDP-to-wall-power conversion. Tax: unknown.
storage
Unknown — Incremental cost of local disk capacity is unknown. The 400 GiB free-disk walkthrough allocation is an author choice, not a measured requirement.
Incremental local 400 GiB available disk cost is unknown; this is an allocation, not a measured minimum. Tax: unknown.
egress
Unknown — Data transfer price, allowances and traffic volume are unknown.
Data transfer price, allowances and traffic volume are unknown. Tax: unknown.
administration
Unknown — Maintenance labor rate and hours are unknown.
Maintenance labor rate and hours are unknown. Tax: unknown.

Install the runtime

  1. 1. Install the pinned native CPU environment

    Use a dedicated reader environment. Exact CPU Torch and Melody wheel metadata hashes are pinned; no binary was downloaded by the author. Other direct releases satisfy archived constraints; transitive/system resolutions are recorded rather than called a complete lock.

    Command
    set -e
    sudo apt-get update
    sudo apt-get install -y python3.12 python3.12-venv curl ca-certificates openssl
    mkdir -p "$HOME/north-mini-code-native"
    cd "$HOME/north-mini-code-native"
    python3.12 -m venv .venv
    .venv/bin/python -m pip install 'https://download-r2.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl#sha256=f82e2ae20c1545bb03997d1cc3143d94e14b800038669ee1aca45808a9acc338' 'https://files.pythonhosted.org/packages/ff/4c/53405b9cf76a82c910291da7869a382fbaa57350c60361c36a5bf0b4b3b4/cohere_melody-0.15.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=36564b555f1fd58ba6c4d92c7f251e765480571e8477bb3a86716e314211438a'
    .venv/bin/python -m pip install transformers==5.11.0 huggingface-hub==1.5.0 tokenizers==0.22.2 regex==2025.10.22 numpy==2.2.3 safetensors==0.5.3
    .venv/bin/python -m pip check
    .venv/bin/python -m pip freeze > installed-requirements.txt

    Expected result: Exact direct versions and dependency checks succeed; stop on error and retain the actual resolved environment.

Download the model

  1. 1. Write and verify the complete native manifest

    The compressed text below contains all 57 exact native file names, sizes and SHA-256 or Git blob identities. It is text metadata, not weights or tokenizer bytes. Reader downloads occur only in the next step.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    .venv/bin/python - <<'PYMANIFEST'
    import base64,zlib,pathlib,hashlib
    b=zlib.decompress(base64.b64decode('eNq9Wk1vXrtx3t9fYXgdu5wvktNdkWSXdNFtUVwMyaGtW9sybKFoG+S/96GCfgD1dY4CHMuwZEnveT1zOM8Xef7006tXr7/k58fXf//q9W8f3+eX/EOMr3/3j49fnt6/+ePDp4c3v31c+Ybelte/+ctr/+3h68Pjp/P6RZSVoitXasG8pnA34x02Rq8slKlb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CZVjJYglxCX7xf79XPOh/jw89Pjv6LYnz/G51+ps7a/4eHEBv4cFC0GQNAncHwOOemZT8fZbm/RYUn+So3PtT38Z375tQcnOxMYjF68m6MHlOoLZIgJAK3gprGCIWGR1j6PNwCzCN9ny6DghW09P3nmTrj1YRer/v4Tld1NX35jz9FY9ziPK/Fa52kccHwdCTSmVYfQBnHGf28x4/O//PTnn/4L/vwt2w=='))
    assert hashlib.sha256(b).hexdigest()=='644a6967e2cc8206ca0593babfbe3e655d4c96d4c78d855b6f2eaa96f85b5b92'
    pathlib.Path('artifact-manifest.json').write_bytes(b)
    PYMANIFEST

    Expected result: The exact full manifest is reconstructed and SHA-256 verified.

  2. 2. Download all complete pinned native components

    Reader-only downloads verify every file before native imports. Both LFS content SHA-256 and Git blob SHA-1 are distinguished. Never remove shards or use mutable main to bypass a mismatch.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat > reader-download.py <<'PYDOWNLOAD'
    import hashlib,json,pathlib,urllib.request
    root=pathlib.Path('model');root.mkdir(exist_ok=True)
    m=json.load(open('artifact-manifest.json'));base='https://huggingface.co/'+m['repo']+'/resolve/'+m['revision']+'/'
    for r in m['files']:
     p=root/r['path'];p.parent.mkdir(parents=True,exist_ok=True)
     if not p.exists():
      tmp=p.with_name(p.name+'.partial')
      with urllib.request.urlopen(base+r['path'],timeout=120) as src,tmp.open('wb') as dst:
       for b in iter(lambda:src.read(1048576),b''):dst.write(b)
      tmp.replace(p)
     if p.stat().st_size!=r['bytes']:raise SystemExit('wrong size '+r['path'])
     h=hashlib.sha256()if r['algorithm']=='sha256'else hashlib.sha1()
     if r['algorithm']=='git-sha1':h.update(b'blob '+str(r['bytes']).encode()+b'\0')
     with p.open('rb')as src:
      for b in iter(lambda:src.read(1048576),b''):h.update(b)
     if h.hexdigest()!=r['digest']:raise SystemExit('wrong digest '+r['path'])
    weights={r['path']for r in m['files']if r['path'].endswith('.safetensors')}
    assert len(weights)==49 and set(json.load(open(root/'model.safetensors.index.json'))['weight_map'].values())==weights
    assert sum(r['bytes']for r in m['files']if r['path']in weights)==60970901384
    print('All 57 pinned files and complete 49-part native weights verified.')
    PYDOWNLOAD
    .venv/bin/python reader-download.py

    Expected result: All 57 files, complete 49-shard index membership and 60,970,901,384 serialized weight bytes match before model loading.

Configure

  1. 1. Create the private key only when absent

    Use a reader-generated stable secret, refuse an empty existing file and keep it private. The author does not generate or execute any key.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    umask 077
    if [ ! -e .api-key ]; then openssl rand -hex 32 > .api-key; fi
    test -s .api-key
    chmod 600 .api-key

    Expected result: The reader has a private 64-character hexadecimal key; startup checks its exact format.

  2. 2. Write native adapter section 1

    Reader-authored bounded native source; write every section in order without edits. No native import occurs while writing.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat > native_server.py <<'PYSERVER'
    """Reader-authored fixed North native CPU research harness; tools never execute."""
    import hashlib,hmac,json,pathlib,re,math,http.server,socket
    ROOT=pathlib.Path(__file__).resolve().parent
    MAX_INPUT=3072;MAX_NEW=1024;EOS=255001
    CONTROL={0,1,2,3}|set(range(255000,262144))
    TOOLS=[{'type':'function','function':{'name':'fixture_files','description':'Return the fixed authored fixture directory listing; never inspect the host filesystem.','parameters':{'type':'object','properties':{},'required':[],'additionalProperties':False}}}]
    FIXTURE={'files':['src/main.py','tests/test_main.py','settings.json'],'source':'authored fixed fixture, not a host directory listing'}
    class Invalid(ValueError):pass
    def require(ok,message):
     if not ok:raise Invalid(message)
    def integer(x):return type(x)is int
    def clean(x,empty=False):
     require(type(x)is str and (empty or bool(x.strip())) and len(x)<=32768,'invalid text')
     require(not any(c in x for c in ['<|','|>','<PAD>','<MASK_TOKEN>','<BOS_TOKEN>','<EOS_TOKEN>','<UNK>']),'control text')
     return x
    def strict_json(b):
     def pairs(rows):
      d={}
      for k,v in rows:
       require(k not in d,'duplicate JSON key');d[k]=v
      return d
     return json.loads(b,object_pairs_hook=pairs,parse_constant=lambda _:(_ for _ in()).throw(Invalid('nonfinite JSON')))
    def validate_turn(ids,text,decoder,melody,expected,input_count):
     require(type(ids)is list and 1<len(ids)<=MAX_NEW and all(integer(x)and 0<=x<262144 for x in ids),'raw IDs')
     require(ids[-1]==EOS and ids.count(EOS)==1,'true final END_OF_TURN required')
     require(integer(input_count)and 0<input_count<=MAX_INPUT,'input count')
     # Native generation prompt already ends in START_THINKING. Require exactly
     # its closure, then exactly one text/action block, then terminal native EOS.
     inner=ids[:-1];special=[x for x in inner if x in CONTROL]
     pair=(255012,255013)if expected=='text'else(255014,255015)
     require(special==[255011,*pair],'native control order/count')
     require(inner.index(255011)<inner.index(pair[0])<inner.index(pair[1])and inner[-1]==pair[1],'native boundary positions')
     require(inner.index(pair[0])==inner.index(255011)+1,'unexpected inter-block text')
     require(type(text)is str and decoder(inner)==text,'exact native decode equality')
     thought,body=text.split('<|END_THINKING|>',1);clean(thought,empty=True)
     start,end=('<|START_TEXT|>','<|END_TEXT|>')if expected=='text'else('<|START_ACTION|>','<|END_ACTION|>')
     require(body.startswith(start)and body.endswith(end),'decoded native boundaries')
     content=body[len(start):-len(end)];clean(content)
     parsed=melody('<|START_THINKING|>'+text)
     require(parsed['reasoning']==thought or (thought=='' and parsed['reasoning'] is None),'Melody reasoning mismatch')
     if expected=='text':
      require(parsed['content']==content and parsed['tool_calls']==[],'Melody final mismatch')
      return {'role':'assistant','content':content,'reasoning':thought}, {'input_tokens':input_count,'output_tokens':len(ids),'total_tokens':input_count+len(ids)}
     calls=strict_json(content);require(type(calls)is list and len(calls)==1,'one inert tool call')
     tc=calls[0];require(type(tc)is dict and set(tc)=={'tool_call_id','tool_name','parameters'}and tc['tool_call_id']=='0'and tc['tool_name']=='fixture_files'and type(tc['parameters'])is dict and tc['parameters']=={},'inert fixture tool schema')
     require(parsed['content']in(None,'')and parsed['tool_calls']==[{'id':'0','name':'fixture_files','arguments':{}}],'Melody tool mismatch')
     return {'role':'assistant','content':None,'reasoning':thought,'tool_calls':[{'id':'0','type':'function','function':{'name':'fixture_files','arguments':{}}}]},{'input_tokens':input_count,'output_tokens':len(ids),'total_tokens':input_count+len(ids)}
    def check_files():
     m=json.load(open(ROOT/'artifact-manifest.json'));require(m['repo']=='CohereLabs/North-Mini-Code-1.0'and m['revision']=='d11e61a842617a22dc328552fa5bb86231ee4f37'and len(m['files'])==57,'manifest identity')
     for r in m['files']:
      p=ROOT/'model'/r['path'];require(p.is_file()and p.stat().st_size==r['bytes'],'missing/size '+r['path'])
      h=hashlib.sha256()if r['algorithm']=='sha256'else hashlib.sha1()
      if r['algorithm']=='git-sha1':h.update(b'blob '+str(r['bytes']).encode()+b'\0')
      with p.open('rb')as f:
       for c in iter(lambda:f.read(1048576),b''):h.update(c)
      require(h.hexdigest()==r['digest'],'digest '+r['path'])
     weights={r['path']for r in m['files']if r['path'].endswith('.safetensors')};idx=json.load(open(ROOT/'model/model.safetensors.index.json'))
     require(len(weights)==49 and set(idx['weight_map'].values())==weights,'complete native index')
     require(sum(r['bytes']for r in m['files']if r['path']in weights)==60970901384,'complete native bytes')
    PYSERVER

    Expected result: The exact source section is appended; all sections are required.

  3. 3. Write native adapter section 2

    Reader-authored bounded native source; write every section in order without edits. No native import occurs while writing.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat >> native_server.py <<'PYSERVER'
    def make_engine():
     check_files() # Verify all components BEFORE importing any native package.
     import torch,transformers,cohere_melody,importlib.metadata
     require(torch.__version__=='2.11.0+cpu'and transformers.__version__=='5.11.0'and importlib.metadata.version('cohere_melody')=='0.15.2','exact released environment')
     torch.set_num_threads(16)
     tok=transformers.AutoTokenizer.from_pretrained(ROOT/'model',local_files_only=True,trust_remote_code=False)
     require(tok.bos_token_id==2 and tok.eos_token_id==EOS and tok.pad_token_id==0,'native tokenizer IDs')
     require(tok.chat_template==(ROOT/'model/chat_template.jinja').read_text(),'exact native full template')
     for s,i in [('<|END_THINKING|>',255011),('<|START_TEXT|>',255012),('<|END_TEXT|>',255013),('<|START_ACTION|>',255014),('<|END_ACTION|>',255015)]:require(tok.convert_tokens_to_ids(s)==i,'native boundary identity')
     model,info=transformers.AutoModelForCausalLM.from_pretrained(ROOT/'model',local_files_only=True,trust_remote_code=False,dtype=torch.float32,attn_implementation='eager',experts_implementation='eager',output_loading_info=True)
     require(set(info)=={'missing_keys','unexpected_keys','mismatched_keys','error_msgs'}and all(not v for v in info.values()),'strict complete native loading diagnostics')
     model=model.cpu().float().eval()
     require(type(model).__name__=='Cohere2MoeForCausalLM'and len(model.model.layers)==49,'native architecture')
     for p in model.parameters():require(p.device.type=='cpu'and(not p.is_floating_point()or(p.dtype==torch.float32 and bool(torch.isfinite(p).all()))),'parameter CPU/FP32/finite')
     def parse(s):
      r=cohere_melody.PyFilter.cmd4().process_full_text(s)
      return {'reasoning':r.reasoning,'content':r.content,'tool_calls':[{'id':t.id,'name':t.name,'arguments':strict_json(t.arguments)}for t in r.tool_calls]}
     class Engine:
      def turn(self,history,expected):
       prompt=tok.apply_chat_template(history,tools=TOOLS if any('fixture' in(str(x))for x in history)else None,tokenize=False,add_generation_prompt=True,reasoning=True)
       require(prompt.endswith('<|START_THINKING|>')and prompt.startswith(tok.bos_token),'native generation prefix')
       x=tok(prompt,return_tensors='pt',add_special_tokens=False);n=int(x.input_ids.shape[-1]);require(0<n<=MAX_INPUT,'full untruncated native history exceeds input budget')
       require(int(x.input_ids[0,0])==2 and int((x.input_ids==2).sum())==1,'exact one native BOS')
       with torch.inference_mode():out=model.generate(**x,do_sample=True,temperature=1.0,top_p=.95,top_k=0,max_new_tokens=MAX_NEW,eos_token_id=EOS,pad_token_id=0,num_return_sequences=1,use_cache=True)
       require(out.ndim==2 and out.shape[0]==1 and torch.equal(out[0,:n],x.input_ids[0]),'native prompt preservation')
       ids=out[0,n:].tolist();text=tok.decode(ids[:-1],skip_special_tokens=False,clean_up_tokenization_spaces=False)
       a,u=validate_turn(ids,text,lambda v:tok.decode(v,skip_special_tokens=False,clean_up_tokenization_spaces=False),parse,expected,n)
       return a,u
     return Engine()
    def run_job(engine,job):
     require(job in('text','tool'),'fixed job')
     if job=='text':
      history=[{'role':'user','content':'A fixed example has three test files and adds five more. How many test files are there? Explain briefly.'}];a,u=engine.turn(history,'text');history.append(a)
      return {'history':history,'turn_usage':[u],'tool_execution':False,'quality':'unmeasured; inspect the answer against eight'}
     history=[{'role':'user','content':'Use the fixture_files tool exactly once to inspect the fixed authored fixture listing, then name the JSON file. Do not access a real filesystem.'}]
     a,u=engine.turn(history,'tool');history.append(a);history.append({'role':'tool','tool_call_id':'0','content':FIXTURE});b,v=engine.turn(history,'text');history.append(b)
     return {'history':history,'turn_usage':[u,v],'tool_execution':False,'quality':'unmeasured; inspect final answer against settings.json; all thought/history retained'}
    PYSERVER

    Expected result: The exact source section is appended; all sections are required.

  4. 4. Write native adapter section 3

    Reader-authored bounded native source; write every section in order without edits. No native import occurs while writing.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat >> native_server.py <<'PYSERVER'
    def create_server(engine,key,port=9012):
     require(type(key)is str and re.fullmatch('[0-9a-f]{64}',key)is not None,'reader private key')
     class Handler(http.server.BaseHTTPRequestHandler):
      protocol_version='HTTP/1.0'
      def log_message(self,*a):pass
      def reply(self,status,data):
       b=json.dumps(data,allow_nan=False).encode();self.send_response(status);self.send_header('Content-Type','application/json');self.send_header('Content-Length',str(len(b)));self.end_headers();self.wfile.write(b)
      def auth(self):
       values=self.headers.get_all('Authorization',[])
       if len(values)!=1 or not hmac.compare_digest(values[0].encode('utf-8'),('Bearer '+key).encode()):self.reply(401,{'error':'unauthorized'});return False
       return True
      def do_GET(self):
       if not self.auth():return
       if self.path!='/health':self.reply(404,{'error':'not_found'});return
       self.reply(200,{'ready':True,'checkpoint':'CohereLabs/North-Mini-Code-1.0','revision':'d11e61a842617a22dc328552fa5bb86231ee4f37','complete_shards':49,'input_limit':MAX_INPUT,'output_cap':MAX_NEW,'tool_execution':False})
      def do_POST(self):
       if not self.auth():return
       if self.path!='/v1/fixed-north':self.reply(404,{'error':'not_found'});return
       if self.headers.get_all('Transfer-Encoding',[]):self.reply(400,{'error':'transfer_encoding_forbidden'});return
       ls=self.headers.get_all('Content-Length',[])
       if len(ls)!=1 or re.fullmatch('[0-9]{1,6}',ls[0])is None:self.reply(411,{'error':'content_length_required'});return
       n=int(ls[0])
       if not 1<=n<=128:self.reply(413,{'error':'body_limit'});return
       if self.headers.get('Content-Type','').lower()!='application/json':self.reply(415,{'error':'json_required'});return
       try:
        self.connection.settimeout(5);raw=self.rfile.read(n);require(len(raw)==n,'short body');d=strict_json(raw.decode('utf-8'));require(type(d)is dict and set(d)=={'job'}and type(d['job'])is str and d['job']in('text','tool'),'fixed request schema')
       except(Exception):self.reply(400,{'error':'invalid_request'});return
       try:self.reply(200,run_job(engine,d['job']))
       except Exception:self.reply(422,{'error':'native_boundary_or_budget_failure','action':'stop; inspect native output locally without treating it as a valid final answer'})
     return http.server.HTTPServer(('127.0.0.1',port),Handler)
    if __name__=='__main__':
     key=(ROOT/'.api-key').read_text().strip();require(re.fullmatch('[0-9a-f]{64}',key)is not None,'private key')
     engine=make_engine();create_server(engine,key).serve_forever()
    PYSERVER

    Expected result: The exact source section is appended; all sections are required.

  5. 5. Verify the complete adapter

    Compile syntax without executing native imports and verify the exact whole source digest.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    .venv/bin/python -m py_compile native_server.py
    sha256sum --check <<'SHA256'
    82f951b821ced805fccbcf7945313c6f0c9fc213f064534f84595e7c48d6b8ad  native_server.py
    SHA256

    Expected result: Syntax and exact complete-wrapper SHA-256 pass.

Start the model

  1. 1. Start full native North on CPU

    All 49 native parts and every expert are loaded locally as FP32; eager implementations use standard Torch operators. Missing, unexpected, mismatched or error load diagnostics are fatal. Startup scans parameter dtype/device/finiteness; this can be slow and memory-intensive. Source qualification is not an executed loading or fit result.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1
    .venv/bin/python native_server.py

    Expected result: After actual successful native startup, the serial service listens only at 127.0.0.1:9012. Any initialization failure prevents the listener.

Connect to your endpoint

http://127.0.0.1:9012/v1/fixed-north

Trusted workstation loopback only; run all shown checks on this machine.

Access: loopback. Use the stable private Bearer key for health and generation. Send a JSON object with job set to text or tool. Responses contain complete retained history, native input/output/total counts per turn and an explicit false tool_execution flag. Arbitrary prompts, tools, paths, URLs and shell commands are not accepted. This custom fixed-schema educational endpoint is not OpenAI-compatible.

Verify the setup

  1. 1. Run native text and complete inert-tool conversations

    Use a second server terminal. The text fixture asks three plus five; manually inspect against eight. The tool fixture returns an authored fixed listing; inspect the final response against settings.json and retained reasoning in both assistant turns. These are meaningful human checks, not promised model quality or executable coding results.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    NORTH_KEY="$(cat .api-key)"
    curl --fail http://127.0.0.1:9012/health -H "Authorization: Bearer $NORTH_KEY"
    for JOB in text tool; do
     curl --fail http://127.0.0.1:9012/v1/fixed-north -H "Authorization: Bearer $NORTH_KEY" -H 'Content-Type: application/json' -d "{\"job\":\"$JOB\"}" -o "$JOB-result.json"
    done
    curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:9012/health
    unset NORTH_KEY
    .venv/bin/python - <<'PYRESULT'
    import json
    for job in ('text','tool'):
     d=json.load(open(job+'-result.json'))
     assert d['tool_execution'] is False
     assert len(d['turn_usage'])==(1 if job=='text'else 2)
     for u in d['turn_usage']:
      assert all(type(u[k]) is int for k in ('input_tokens','output_tokens','total_tokens'))
      assert 0<u['input_tokens']<=3072 and 0<u['output_tokens']<=1024
      assert u['total_tokens']==u['input_tokens']+u['output_tokens']<=4096
     assert d['history'][-1]['role']=='assistant' and d['history'][-1]['content'].strip()
     print(job,d)
    print('Inspect grounded answers and all retained reasoning/history; record failures honestly.')
    PYRESULT

    Expected result: Authorized fixed jobs succeed only after actual reader execution; unauthenticated health returns 401. Native grammar, final EOS and Melody consistency failures return structured 422, not a valid answer.

Performance evidence

No compatible measurement available. Documented support and estimated memory do not establish response speed.

Limits and troubleshooting

  • Complete native North Mini Code 1.0 is a text-only Cohere2Moe model with 30B total / 3B active parameters, 128 experts, top-eight routing and one initial dense layer. All 49 native parts and every expert remain present; active parameters are not storage or memory fit.
  • Native 49-layer global/sliding layout uses sliding window 4096, 32 query heads and 4 KV heads; the explicit eager CPU path preserves the full architecture. No image or Maple model facts are transferred.
  • Publisher card 256K context / 64K output, config 500000 positions and vLLM example 320000 are distinct. The tokenizer sentinel model_max_length is not a native supported context limit. This recipe deliberately selects 4096 total with 3072 input and 1024 generated IDs per turn, without truncating complete retained history.
  • The native full Jinja renders reasoning by default, opens START_THINKING in the generation prefix, retains assistant reasoning with tool calls and final turns, and wraps dictionary tool results under native results index zero. The reader uses the exact snapshot, not another Command model template.
  • Native turn, role, thought, text, action and tool-result boundary IDs 255000–255004 and 255010–255027 are marked special false in tokenizer metadata; the NEW_FILE and FIM IDs 255005–255009 are marked special true. skip_special_tokens cannot sanitize the false-marked controls. Raw IDs and exact decoded boundaries are checked; role/tool-result/pad/mask/BOS/alternate-EOS and malformed ordering are rejected rather than silently stripped.
  • Cohere Melody 0.15.2 Command4 parsing is checked against independently bounded native text/action grammar. Native END_OF_TURN 255001 must terminate exactly once. A 1024-ID length cap without true EOS is a failure; no tool execution or shell agent is provided.
  • The tool job preserves the complete generated reasoning and native tool-call mapping, appends the authored fixed dictionary as a native tool result, then generates the final answer with that full history. The single fixture function cannot inspect the host, execute commands or reach a network. Broader real agent/tool workflows remain open.
  • Native temperature 1.0 and top-p 0.95 are retained; top-k is explicitly disabled by the author and maximum output/concurrency are bounded. Neither fake tests nor source support establish answer quality, coding benchmark performance, calibration or safety.
  • API BF16 scalar count implies 121,937,215,488 bytes in FP32 parameter storage alone. 256 GiB RAM and 400 GiB disk are planning allocations; load copies, cache, eager routing and OS overhead are unmeasured. No fit, speed or active-parameter shortcut claim.
  • The serial stdlib server enforces private authentication, body/framing and fixed jobs, but has no native inference deadline, TLS, multiuser resilience or production guarantee. Keep it on trusted loopback and stop on malformed native output.
  • Exact direct package versions and CPU Torch/Melody wheel identities are pinned; transitive and apt packages resolve at reader install and must be recorded. The author downloaded no weights, tokenizer/BPE or binaries, and ran no native imports or inference. Fake tests exercise transport/protocol only.
  • The publisher card and official documentation declare Apache 2; native repository listing has no actual LICENSE file. Declaration, runtime source licenses and legal suitability are distinct. The frozen provider identity is not asserted byte-equivalent to this native deployment; all broader family/backend/context workflows remain open and required totals stay null.
Artifact, load-diagnostic, dtype or environment failure
Stop and restore all 57 pinned native files and exact CPU releases. Do not delete experts or shards, ignore mismatches, enable remote code or substitute a different model.
Native control, EOS, Melody or tool-schema rejection
Save the reader error and inspect the exact native output locally. Do not strip control tokens, change token IDs, fabricate a final answer or execute proposed tools. The fixed inert tool name and empty parameters must match exactly.
Full history exceeds 3072 input positions or output hits its cap
Stop and record the bounded workflow failure. Preserve complete reasoning/tool history; do not silently truncate it or call incomplete output final. A larger source-qualified configuration needs separate memory/context planning.
401 or body/framing rejection
Use the stable private key, application/json and only the job field with text or tool. No arbitrary prompt, upload, URL, file or command is accepted.
Native CPU exhaustion or poor answer
Stop and preserve the actual error and installed environment. Planning capacity and fake tests are not fit or quality evidence. Inspect grounded answers manually without transferring publisher benchmarks.

Stop the model

  1. 1. Stop the private CPU service

    Press Ctrl-C in its server terminal, then check that the listener is gone.

    Command
    set -e
    curl -s -o /dev/null -w '%{http_code}\n' --max-time 3 http://127.0.0.1:9012/health || true

    Expected result: After Ctrl-C, the local private listener no longer responds.

Uninstall

  1. 1. Remove only the dedicated North workspace

    Preserve desired reader results first; then remove this explicitly named environment, model, helper and key.

    Command
    set -e
    rm -rf -- "$HOME/north-mini-code-native"

    Expected result: The dedicated North workspace is removed. Shared system packages remain.

Sources and verification

Sources checked Oct 17, 2026. Verification source

Compare this configuration
Cloud serverDocumented setupSources checked Oct 17, 2026

Run complete native North Mini Code with retained reasoning and inert tools on a private CPU VM

Load all 49 publisher-native North Mini Code 1.0 shards as CPU FP32 with released eager attention and experts. A private fixed-schema harness runs a grounded text question and a two-stage tool conversation with retained native reasoning, a fixed authored directory listing and no shell execution. Each full untruncated history is bounded to 3,072 input tokens and up to 1,024 generated tokens inside a 4,096-token sequence. The 256 GiB RAM and 400 GiB disk planning allocation has unknown fit, speed and quality.

Hardware
AWS r7i.8xlarge CPU,256GiB RAM,400GiB gp3,16 allocated threads
Runtime
Complete native North Mini Code CPU with Command4 parsing Transformers 5.11.0; Torch 2.11.0 CPU; Cohere Melody 0.15.2; Python 3.12 · CPU
Model format
Safetensors · Full native BF16 checkpoint loaded as CPU FP32; all 128 experts retained, not active-parameter storage · Unquantized native BF16 weights; reader explicitly loads the complete model as CPU FP32
Workload
4,096 token context · 1 concurrent

Based on source documentation; this setup has not been executed by OpenTools. Memory: unknown. No compatible measurement available.

Read the complete setup guide

Before you start

  • Use an existing authorized AWS r7i.8xlarge in us-east-1 with Ubuntu 24.04 x86_64, 256 GiB RAM, 400 GiB gp3 disk and 16 allocated CPU threads. Retain existing SSH access and keep service port 9012 closed.
  • Python 3.12, exact Torch 2.11.0 CPU and released Transformers 5.11.0 with native eager attention and experts; Cohere Melody 0.15.2 parses Command4 reasoning/actions. No custom kernels, CUDA, remote model code or model conversion is selected. Record resolved transitive and system dependencies and stop on installation checks.
  • Read the exact publisher Apache 2 declaration and the archived Apache 2 license text; no native LICENSE file is present in the model listing. This is a model-specific research walkthrough, not legal or production suitability clearance.
  • Only fixed text and inert fixture-tool jobs are accepted. The tool returns an authored dictionary, never host filesystem or shell results. Reasoning and tool results may contain sensitive data in a different application; keep this private educational endpoint on trusted loopback.
  • The frozen North Mini Code canonical is mapped to this publisher-native checkpoint for the documented recipe, not provider serving byte equivalence. Card 256K, config 500000 positions, example 320000 and this 4096-token allocation are distinct scopes. No large-context fit claim is made.

Exact model and requirements

Artifact:
Cohere Labs / North Mini Code 1.0 complete native 49-part Cohere2Moe checkpoint · checkpoint CohereLabs/North-Mini-Code-1.0
Publisher revision:
d11e61a842617a22dc328552fa5bb86231ee4f37
Artifact digest:
Every native weight part and component is pinned separately by the mandatory complete 57-file manifest; no invented whole-composition digest.
Download size:
56.78 GiB
Memory requirement (unknown):
Unknown — Complete FP32 load, cache, expert routing, temporary tensors, environment and OS peak are unmeasured.
System RAM / disk:
Unknown / Unknown
Placement:
single device. All 49 on-disk Safetensors parts form one complete model on one CPU host; no tensor or pipeline sharding. One CPU host, full native model and all experts; no accelerator, quantization, remote-code or component deletion.
KV cache:
Native CPU FP32 grouped-query attention cache with 32 query heads and 4 KV heads. Native 49 layers use global/sliding attention according to the pinned configuration; exact cache/process peak is unmeasured.
Workload:
4,096 token context; Unknown; Unknown; concurrency 1; batch 1; cache cold; repetitions Unknown.
Tokenizer:
Exact native North tokenizer and full publisher standalone Jinja · d11e61a842617a22dc328552fa5bb86231ee4f37
Sampling / reasoning:
Publisher-recommended temperature 1.0 and top-p 0.95 with do_sample=True; author disables top-k filtering with top_k=0, uses one sequence and caps each turn at 1024 new IDs. True native END_OF_TURN ID 255001 is required; capped or malformed output is rejected. Native reasoning=True leaves START_THINKING open in the generation prefix. The harness requires its exact closure followed by one native text or action block and true END_OF_TURN, independently checks Melody cmd4 parsing, and retains complete reasoning and parsed tool calls in subsequent native history. Fixed fixture tool results are dictionaries rendered by the native template; tools are inert and no terminal command is executed.
Runtime prerequisites:
Ubuntu 24.04 x86_64; See prerequisites above.

Official artifact · License

The exact publisher model card and official Cohere North documentation declare Apache License 2.0. The native file listing does not contain an actual LICENSE file; this limitation is retained and the declaration is not represented as a separately fetched native grant. Review the publisher declaration and Apache 2 text yourself; preserve notices, attribution, modifications and applicable patent/termination obligations. No legal clearance, terms acceptance or provider endpoint byte-equivalence is claimed.

  • Complete native serialized weights total 60,970,901,384 bytes across 49 parts. API metadata separately counts 30,484,303,872 BF16 elements; loading those as FP32 implies 121,937,215,488 bytes of floating parameter storage alone, not a measured resident or peak requirement.
  • The card calls this 30B total / 3B active MoE. Active parameters are not the storage or RAM requirement; every expert and weight part remains loaded.
  • 256 GiB RAM, 400 GiB free disk and 16 threads are author-selected planning allocations copied from exact reviewed hardware references. Full loading copies, cache, dependency environment and OS add unknown overhead; no fit or throughput is promised.

One-time setup and hardware

hardware
Not applicable — AWS hardware acquisition is included in compute rental; no purchased GPU required. Any separate hardware cost is not applicable.
AWS hardware acquisition is included in compute rental; no purchased GPU required. Any separate hardware cost is not applicable. Tax: unknown.
setup
Unknown — Initial provisioning/build time and labor cost are unknown.
Initial provisioning/build time and labor cost are unknown. Tax: unknown.

Recurring costs

compute
$2.12 / hour
Exact AWS published us-east-1 Linux On-Demand row: USD 2.1168 per billed instance-hour. Eight hours USD 16.9344; 24 hours USD 50.8032 compute. Idle running hours bill. Storage, transfer, taxes and administration are separate; capacity unknown. Region: us-east-1. SKU: r7i.8xlarge Linux On-Demand. Tax: excluded. Price dated Oct 15, 2026. Price source
storage
$0.08 / GB month
Existing dated us-east-1 gp3 quote USD 0.08 per GB-month, with GB defined as 1024^3 bytes. Selected 400 GiB costs USD 32 per full month, prorated by provisioned duration, at baseline 3000 IOPS / 125 MB/s. Retained resources and snapshots bill separately. Region: us-east-1. SKU: EBS gp3 baseline 3000 IOPS / 125 MB/s. Tax: excluded. Price dated Oct 16, 2026. Price source
egress
Unknown — Data transfer price, allowances and traffic volume are unknown.
Data transfer price, allowances and traffic volume are unknown. Tax: unknown.
administration
Unknown — Maintenance labor rate and hours are unknown.
Maintenance labor rate and hours are unknown. Tax: unknown.

Install the runtime

  1. 1. Install the pinned native CPU environment

    Use a dedicated reader environment. Exact CPU Torch and Melody wheel metadata hashes are pinned; no binary was downloaded by the author. Other direct releases satisfy archived constraints; transitive/system resolutions are recorded rather than called a complete lock.

    Command
    set -e
    sudo apt-get update
    sudo apt-get install -y python3.12 python3.12-venv curl ca-certificates openssl
    mkdir -p "$HOME/north-mini-code-native"
    cd "$HOME/north-mini-code-native"
    python3.12 -m venv .venv
    .venv/bin/python -m pip install 'https://download-r2.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl#sha256=f82e2ae20c1545bb03997d1cc3143d94e14b800038669ee1aca45808a9acc338' 'https://files.pythonhosted.org/packages/ff/4c/53405b9cf76a82c910291da7869a382fbaa57350c60361c36a5bf0b4b3b4/cohere_melody-0.15.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=36564b555f1fd58ba6c4d92c7f251e765480571e8477bb3a86716e314211438a'
    .venv/bin/python -m pip install transformers==5.11.0 huggingface-hub==1.5.0 tokenizers==0.22.2 regex==2025.10.22 numpy==2.2.3 safetensors==0.5.3
    .venv/bin/python -m pip check
    .venv/bin/python -m pip freeze > installed-requirements.txt

    Expected result: Exact direct versions and dependency checks succeed; stop on error and retain the actual resolved environment.

Download the model

  1. 1. Write and verify the complete native manifest

    The compressed text below contains all 57 exact native file names, sizes and SHA-256 or Git blob identities. It is text metadata, not weights or tokenizer bytes. Reader downloads occur only in the next step.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    .venv/bin/python - <<'PYMANIFEST'
    import base64,zlib,pathlib,hashlib
    b=zlib.decompress(base64.b64decode('eNq9Wk1vXrtx3t9fYXgdu5wvktNdkWSXdNFtUVwMyaGtW9sybKFoG+S/96GCfgD1dY4CHMuwZEnveT1zOM8Xef7006tXr7/k58fXf//q9W8f3+eX/EOMr3/3j49fnt6/+ePDp4c3v31c+Ybelte/+ctr/+3h68Pjp/P6RZSVoitXasG8pnA34x02Rq8slKlb2l+u3A8f8isu+2d88+rVn54/48ef4+n9ebN/+v0//O6Pv3/7cT2/+vlX4z+enq+got3+56fx4d3jl4en9x/PVe8ent58fR/0vxeth3f59en8bvY9ymYaPWcl3+7UqioN3Uvww1obaZ/++vnSP//m23XN9/H081N+/PwhnvLtLw+ffolvVMji7eUVsuzsWiqPqRRZQoqEzu02u3fNmovmFv0rFT5+2g/v3v7yFavy/ypjUX55YVXbatxkbR+juPYyNKI47qS0XQxFVmXf3y/sXX7KL/GEafn5uzWS1JeXKOaxp1qNGTvGmDJrk9JGkyi5ufZiOTp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8JWC9zck+3mCgPMW5JXLLHy/xus++beDkiY0XGTPmgK9kElk7RymNsICwBK3pnugq4oX8CBYZHe7ugcp/gPSr0McG6B8wlSfWIOzZ2KFJyU8ivLe4LFcDM+sjUahUgNYej4qtn6xE/0BOX6fuJhS4HMnSek7VsY4B0SOnNI7xe6CLhGyvHX0neIFUWBVhy24mhn1fo0f58SESkIqAA9oIJLu4EYAhBvWoTKEkHp3MsRIYyjNtjlgBkgOS1zt5H6NZ1KExV2z44YbBaNi1E8D5re4DHjJc6xNTfbKPcIYXAzbj7SPoFyvcpfer/FTu+LezqDCYKcj6GW2tubmCXo6shEw7w1sDKZSSEloP8EYFB0kl9fkfo1XlBd9r1XBrsmb9jzy4dMdjl61QlsiTr7aPBBipaaerX0wc4HEX82M+gNy/NgTd/7s1fd9trWIaswTcWm6VYE2IrBD7REnSbLw2NrABA1e38Ov+i69X+OrIgxuRe3Zw8BhCSVhsVIBD8hfLinn7BrmUhbFoLJWAPpxNl31cmbU+zWeQb7wHmMRcvB5RoXrBH2RwChS6ecsa9h5RGotzN1EOkFYloTzb4G1vLrDrfdrvJU1K6zWKjlowR9tZMSNud6wLYAEAANcWA8GSadnVESUcypJVjF/Vx2kXtV4xCGkC+kvp65jgMeGTa9DkUPOYyznkHo4rbah6GenqwAxmKtFsC7VaDKbnQOheekRif9b+duHTyv//deeqIMOa/0bnpnUAa/e+jpPRfB5ssOgFp7qSCZVjJYglxCX7xf79XPOh/jw89Pjv6LYnz/G51+ps7a/4eHEBv4cFC0GQNAncHwOOemZT8fZbm/RYUn+So3PtT38Z375tQcnOxMYjF68m6MHlOoLZIgJAK3gprGCIWGR1j6PNwCzCN9ny6DghW09P3nmTrj1YRer/v4Tld1NX35jz9FY9ziPK/Fa52kccHwdCTSmVYfQBnHGf28x4/O//PTnn/4L/vwt2w=='))
    assert hashlib.sha256(b).hexdigest()=='644a6967e2cc8206ca0593babfbe3e655d4c96d4c78d855b6f2eaa96f85b5b92'
    pathlib.Path('artifact-manifest.json').write_bytes(b)
    PYMANIFEST

    Expected result: The exact full manifest is reconstructed and SHA-256 verified.

  2. 2. Download all complete pinned native components

    Reader-only downloads verify every file before native imports. Both LFS content SHA-256 and Git blob SHA-1 are distinguished. Never remove shards or use mutable main to bypass a mismatch.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat > reader-download.py <<'PYDOWNLOAD'
    import hashlib,json,pathlib,urllib.request
    root=pathlib.Path('model');root.mkdir(exist_ok=True)
    m=json.load(open('artifact-manifest.json'));base='https://huggingface.co/'+m['repo']+'/resolve/'+m['revision']+'/'
    for r in m['files']:
     p=root/r['path'];p.parent.mkdir(parents=True,exist_ok=True)
     if not p.exists():
      tmp=p.with_name(p.name+'.partial')
      with urllib.request.urlopen(base+r['path'],timeout=120) as src,tmp.open('wb') as dst:
       for b in iter(lambda:src.read(1048576),b''):dst.write(b)
      tmp.replace(p)
     if p.stat().st_size!=r['bytes']:raise SystemExit('wrong size '+r['path'])
     h=hashlib.sha256()if r['algorithm']=='sha256'else hashlib.sha1()
     if r['algorithm']=='git-sha1':h.update(b'blob '+str(r['bytes']).encode()+b'\0')
     with p.open('rb')as src:
      for b in iter(lambda:src.read(1048576),b''):h.update(b)
     if h.hexdigest()!=r['digest']:raise SystemExit('wrong digest '+r['path'])
    weights={r['path']for r in m['files']if r['path'].endswith('.safetensors')}
    assert len(weights)==49 and set(json.load(open(root/'model.safetensors.index.json'))['weight_map'].values())==weights
    assert sum(r['bytes']for r in m['files']if r['path']in weights)==60970901384
    print('All 57 pinned files and complete 49-part native weights verified.')
    PYDOWNLOAD
    .venv/bin/python reader-download.py

    Expected result: All 57 files, complete 49-shard index membership and 60,970,901,384 serialized weight bytes match before model loading.

Configure

  1. 1. Create the private key only when absent

    Use a reader-generated stable secret, refuse an empty existing file and keep it private. The author does not generate or execute any key.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    umask 077
    if [ ! -e .api-key ]; then openssl rand -hex 32 > .api-key; fi
    test -s .api-key
    chmod 600 .api-key

    Expected result: The reader has a private 64-character hexadecimal key; startup checks its exact format.

  2. 2. Write native adapter section 1

    Reader-authored bounded native source; write every section in order without edits. No native import occurs while writing.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat > native_server.py <<'PYSERVER'
    """Reader-authored fixed North native CPU research harness; tools never execute."""
    import hashlib,hmac,json,pathlib,re,math,http.server,socket
    ROOT=pathlib.Path(__file__).resolve().parent
    MAX_INPUT=3072;MAX_NEW=1024;EOS=255001
    CONTROL={0,1,2,3}|set(range(255000,262144))
    TOOLS=[{'type':'function','function':{'name':'fixture_files','description':'Return the fixed authored fixture directory listing; never inspect the host filesystem.','parameters':{'type':'object','properties':{},'required':[],'additionalProperties':False}}}]
    FIXTURE={'files':['src/main.py','tests/test_main.py','settings.json'],'source':'authored fixed fixture, not a host directory listing'}
    class Invalid(ValueError):pass
    def require(ok,message):
     if not ok:raise Invalid(message)
    def integer(x):return type(x)is int
    def clean(x,empty=False):
     require(type(x)is str and (empty or bool(x.strip())) and len(x)<=32768,'invalid text')
     require(not any(c in x for c in ['<|','|>','<PAD>','<MASK_TOKEN>','<BOS_TOKEN>','<EOS_TOKEN>','<UNK>']),'control text')
     return x
    def strict_json(b):
     def pairs(rows):
      d={}
      for k,v in rows:
       require(k not in d,'duplicate JSON key');d[k]=v
      return d
     return json.loads(b,object_pairs_hook=pairs,parse_constant=lambda _:(_ for _ in()).throw(Invalid('nonfinite JSON')))
    def validate_turn(ids,text,decoder,melody,expected,input_count):
     require(type(ids)is list and 1<len(ids)<=MAX_NEW and all(integer(x)and 0<=x<262144 for x in ids),'raw IDs')
     require(ids[-1]==EOS and ids.count(EOS)==1,'true final END_OF_TURN required')
     require(integer(input_count)and 0<input_count<=MAX_INPUT,'input count')
     # Native generation prompt already ends in START_THINKING. Require exactly
     # its closure, then exactly one text/action block, then terminal native EOS.
     inner=ids[:-1];special=[x for x in inner if x in CONTROL]
     pair=(255012,255013)if expected=='text'else(255014,255015)
     require(special==[255011,*pair],'native control order/count')
     require(inner.index(255011)<inner.index(pair[0])<inner.index(pair[1])and inner[-1]==pair[1],'native boundary positions')
     require(inner.index(pair[0])==inner.index(255011)+1,'unexpected inter-block text')
     require(type(text)is str and decoder(inner)==text,'exact native decode equality')
     thought,body=text.split('<|END_THINKING|>',1);clean(thought,empty=True)
     start,end=('<|START_TEXT|>','<|END_TEXT|>')if expected=='text'else('<|START_ACTION|>','<|END_ACTION|>')
     require(body.startswith(start)and body.endswith(end),'decoded native boundaries')
     content=body[len(start):-len(end)];clean(content)
     parsed=melody('<|START_THINKING|>'+text)
     require(parsed['reasoning']==thought or (thought=='' and parsed['reasoning'] is None),'Melody reasoning mismatch')
     if expected=='text':
      require(parsed['content']==content and parsed['tool_calls']==[],'Melody final mismatch')
      return {'role':'assistant','content':content,'reasoning':thought}, {'input_tokens':input_count,'output_tokens':len(ids),'total_tokens':input_count+len(ids)}
     calls=strict_json(content);require(type(calls)is list and len(calls)==1,'one inert tool call')
     tc=calls[0];require(type(tc)is dict and set(tc)=={'tool_call_id','tool_name','parameters'}and tc['tool_call_id']=='0'and tc['tool_name']=='fixture_files'and type(tc['parameters'])is dict and tc['parameters']=={},'inert fixture tool schema')
     require(parsed['content']in(None,'')and parsed['tool_calls']==[{'id':'0','name':'fixture_files','arguments':{}}],'Melody tool mismatch')
     return {'role':'assistant','content':None,'reasoning':thought,'tool_calls':[{'id':'0','type':'function','function':{'name':'fixture_files','arguments':{}}}]},{'input_tokens':input_count,'output_tokens':len(ids),'total_tokens':input_count+len(ids)}
    def check_files():
     m=json.load(open(ROOT/'artifact-manifest.json'));require(m['repo']=='CohereLabs/North-Mini-Code-1.0'and m['revision']=='d11e61a842617a22dc328552fa5bb86231ee4f37'and len(m['files'])==57,'manifest identity')
     for r in m['files']:
      p=ROOT/'model'/r['path'];require(p.is_file()and p.stat().st_size==r['bytes'],'missing/size '+r['path'])
      h=hashlib.sha256()if r['algorithm']=='sha256'else hashlib.sha1()
      if r['algorithm']=='git-sha1':h.update(b'blob '+str(r['bytes']).encode()+b'\0')
      with p.open('rb')as f:
       for c in iter(lambda:f.read(1048576),b''):h.update(c)
      require(h.hexdigest()==r['digest'],'digest '+r['path'])
     weights={r['path']for r in m['files']if r['path'].endswith('.safetensors')};idx=json.load(open(ROOT/'model/model.safetensors.index.json'))
     require(len(weights)==49 and set(idx['weight_map'].values())==weights,'complete native index')
     require(sum(r['bytes']for r in m['files']if r['path']in weights)==60970901384,'complete native bytes')
    PYSERVER

    Expected result: The exact source section is appended; all sections are required.

  3. 3. Write native adapter section 2

    Reader-authored bounded native source; write every section in order without edits. No native import occurs while writing.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat >> native_server.py <<'PYSERVER'
    def make_engine():
     check_files() # Verify all components BEFORE importing any native package.
     import torch,transformers,cohere_melody,importlib.metadata
     require(torch.__version__=='2.11.0+cpu'and transformers.__version__=='5.11.0'and importlib.metadata.version('cohere_melody')=='0.15.2','exact released environment')
     torch.set_num_threads(16)
     tok=transformers.AutoTokenizer.from_pretrained(ROOT/'model',local_files_only=True,trust_remote_code=False)
     require(tok.bos_token_id==2 and tok.eos_token_id==EOS and tok.pad_token_id==0,'native tokenizer IDs')
     require(tok.chat_template==(ROOT/'model/chat_template.jinja').read_text(),'exact native full template')
     for s,i in [('<|END_THINKING|>',255011),('<|START_TEXT|>',255012),('<|END_TEXT|>',255013),('<|START_ACTION|>',255014),('<|END_ACTION|>',255015)]:require(tok.convert_tokens_to_ids(s)==i,'native boundary identity')
     model,info=transformers.AutoModelForCausalLM.from_pretrained(ROOT/'model',local_files_only=True,trust_remote_code=False,dtype=torch.float32,attn_implementation='eager',experts_implementation='eager',output_loading_info=True)
     require(set(info)=={'missing_keys','unexpected_keys','mismatched_keys','error_msgs'}and all(not v for v in info.values()),'strict complete native loading diagnostics')
     model=model.cpu().float().eval()
     require(type(model).__name__=='Cohere2MoeForCausalLM'and len(model.model.layers)==49,'native architecture')
     for p in model.parameters():require(p.device.type=='cpu'and(not p.is_floating_point()or(p.dtype==torch.float32 and bool(torch.isfinite(p).all()))),'parameter CPU/FP32/finite')
     def parse(s):
      r=cohere_melody.PyFilter.cmd4().process_full_text(s)
      return {'reasoning':r.reasoning,'content':r.content,'tool_calls':[{'id':t.id,'name':t.name,'arguments':strict_json(t.arguments)}for t in r.tool_calls]}
     class Engine:
      def turn(self,history,expected):
       prompt=tok.apply_chat_template(history,tools=TOOLS if any('fixture' in(str(x))for x in history)else None,tokenize=False,add_generation_prompt=True,reasoning=True)
       require(prompt.endswith('<|START_THINKING|>')and prompt.startswith(tok.bos_token),'native generation prefix')
       x=tok(prompt,return_tensors='pt',add_special_tokens=False);n=int(x.input_ids.shape[-1]);require(0<n<=MAX_INPUT,'full untruncated native history exceeds input budget')
       require(int(x.input_ids[0,0])==2 and int((x.input_ids==2).sum())==1,'exact one native BOS')
       with torch.inference_mode():out=model.generate(**x,do_sample=True,temperature=1.0,top_p=.95,top_k=0,max_new_tokens=MAX_NEW,eos_token_id=EOS,pad_token_id=0,num_return_sequences=1,use_cache=True)
       require(out.ndim==2 and out.shape[0]==1 and torch.equal(out[0,:n],x.input_ids[0]),'native prompt preservation')
       ids=out[0,n:].tolist();text=tok.decode(ids[:-1],skip_special_tokens=False,clean_up_tokenization_spaces=False)
       a,u=validate_turn(ids,text,lambda v:tok.decode(v,skip_special_tokens=False,clean_up_tokenization_spaces=False),parse,expected,n)
       return a,u
     return Engine()
    def run_job(engine,job):
     require(job in('text','tool'),'fixed job')
     if job=='text':
      history=[{'role':'user','content':'A fixed example has three test files and adds five more. How many test files are there? Explain briefly.'}];a,u=engine.turn(history,'text');history.append(a)
      return {'history':history,'turn_usage':[u],'tool_execution':False,'quality':'unmeasured; inspect the answer against eight'}
     history=[{'role':'user','content':'Use the fixture_files tool exactly once to inspect the fixed authored fixture listing, then name the JSON file. Do not access a real filesystem.'}]
     a,u=engine.turn(history,'tool');history.append(a);history.append({'role':'tool','tool_call_id':'0','content':FIXTURE});b,v=engine.turn(history,'text');history.append(b)
     return {'history':history,'turn_usage':[u,v],'tool_execution':False,'quality':'unmeasured; inspect final answer against settings.json; all thought/history retained'}
    PYSERVER

    Expected result: The exact source section is appended; all sections are required.

  4. 4. Write native adapter section 3

    Reader-authored bounded native source; write every section in order without edits. No native import occurs while writing.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    cat >> native_server.py <<'PYSERVER'
    def create_server(engine,key,port=9012):
     require(type(key)is str and re.fullmatch('[0-9a-f]{64}',key)is not None,'reader private key')
     class Handler(http.server.BaseHTTPRequestHandler):
      protocol_version='HTTP/1.0'
      def log_message(self,*a):pass
      def reply(self,status,data):
       b=json.dumps(data,allow_nan=False).encode();self.send_response(status);self.send_header('Content-Type','application/json');self.send_header('Content-Length',str(len(b)));self.end_headers();self.wfile.write(b)
      def auth(self):
       values=self.headers.get_all('Authorization',[])
       if len(values)!=1 or not hmac.compare_digest(values[0].encode('utf-8'),('Bearer '+key).encode()):self.reply(401,{'error':'unauthorized'});return False
       return True
      def do_GET(self):
       if not self.auth():return
       if self.path!='/health':self.reply(404,{'error':'not_found'});return
       self.reply(200,{'ready':True,'checkpoint':'CohereLabs/North-Mini-Code-1.0','revision':'d11e61a842617a22dc328552fa5bb86231ee4f37','complete_shards':49,'input_limit':MAX_INPUT,'output_cap':MAX_NEW,'tool_execution':False})
      def do_POST(self):
       if not self.auth():return
       if self.path!='/v1/fixed-north':self.reply(404,{'error':'not_found'});return
       if self.headers.get_all('Transfer-Encoding',[]):self.reply(400,{'error':'transfer_encoding_forbidden'});return
       ls=self.headers.get_all('Content-Length',[])
       if len(ls)!=1 or re.fullmatch('[0-9]{1,6}',ls[0])is None:self.reply(411,{'error':'content_length_required'});return
       n=int(ls[0])
       if not 1<=n<=128:self.reply(413,{'error':'body_limit'});return
       if self.headers.get('Content-Type','').lower()!='application/json':self.reply(415,{'error':'json_required'});return
       try:
        self.connection.settimeout(5);raw=self.rfile.read(n);require(len(raw)==n,'short body');d=strict_json(raw.decode('utf-8'));require(type(d)is dict and set(d)=={'job'}and type(d['job'])is str and d['job']in('text','tool'),'fixed request schema')
       except(Exception):self.reply(400,{'error':'invalid_request'});return
       try:self.reply(200,run_job(engine,d['job']))
       except Exception:self.reply(422,{'error':'native_boundary_or_budget_failure','action':'stop; inspect native output locally without treating it as a valid final answer'})
     return http.server.HTTPServer(('127.0.0.1',port),Handler)
    if __name__=='__main__':
     key=(ROOT/'.api-key').read_text().strip();require(re.fullmatch('[0-9a-f]{64}',key)is not None,'private key')
     engine=make_engine();create_server(engine,key).serve_forever()
    PYSERVER

    Expected result: The exact source section is appended; all sections are required.

  5. 5. Verify the complete adapter

    Compile syntax without executing native imports and verify the exact whole source digest.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    .venv/bin/python -m py_compile native_server.py
    sha256sum --check <<'SHA256'
    82f951b821ced805fccbcf7945313c6f0c9fc213f064534f84595e7c48d6b8ad  native_server.py
    SHA256

    Expected result: Syntax and exact complete-wrapper SHA-256 pass.

  6. 6. Optional private SSH tunnel

    On your own client, use existing SSH access to forward loopback. Generate no new cloud credential and keep the native service private.

    Command
    set -e
    ssh -N -L 9012:127.0.0.1:9012 ubuntu@YOUR_EXISTING_INSTANCE_HOST

    Expected result: Existing SSH authentication opens a private tunnel; use the stable service key on the client.

Start the model

  1. 1. Start full native North on CPU

    All 49 native parts and every expert are loaded locally as FP32; eager implementations use standard Torch operators. Missing, unexpected, mismatched or error load diagnostics are fatal. Startup scans parameter dtype/device/finiteness; this can be slow and memory-intensive. Source qualification is not an executed loading or fit result.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1
    .venv/bin/python native_server.py

    Expected result: After actual successful native startup, the serial service listens only at 127.0.0.1:9012. Any initialization failure prevents the listener.

Connect to your endpoint

http://127.0.0.1:9012/v1/fixed-north

The service binds VM loopback only. Run the checks over your existing SSH session; optional private tunnel uses the same endpoint. Do not expose port 9012.

Access: loopback. Use the stable private Bearer key for health and generation. Send a JSON object with job set to text or tool. Responses contain complete retained history, native input/output/total counts per turn and an explicit false tool_execution flag. Arbitrary prompts, tools, paths, URLs and shell commands are not accepted. This custom fixed-schema educational endpoint is not OpenAI-compatible.

Verify the setup

  1. 1. Run native text and complete inert-tool conversations

    Use a second server terminal. The text fixture asks three plus five; manually inspect against eight. The tool fixture returns an authored fixed listing; inspect the final response against settings.json and retained reasoning in both assistant turns. These are meaningful human checks, not promised model quality or executable coding results.

    Command
    set -e
    cd "$HOME/north-mini-code-native"
    NORTH_KEY="$(cat .api-key)"
    curl --fail http://127.0.0.1:9012/health -H "Authorization: Bearer $NORTH_KEY"
    for JOB in text tool; do
     curl --fail http://127.0.0.1:9012/v1/fixed-north -H "Authorization: Bearer $NORTH_KEY" -H 'Content-Type: application/json' -d "{\"job\":\"$JOB\"}" -o "$JOB-result.json"
    done
    curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:9012/health
    unset NORTH_KEY
    .venv/bin/python - <<'PYRESULT'
    import json
    for job in ('text','tool'):
     d=json.load(open(job+'-result.json'))
     assert d['tool_execution'] is False
     assert len(d['turn_usage'])==(1 if job=='text'else 2)
     for u in d['turn_usage']:
      assert all(type(u[k]) is int for k in ('input_tokens','output_tokens','total_tokens'))
      assert 0<u['input_tokens']<=3072 and 0<u['output_tokens']<=1024
      assert u['total_tokens']==u['input_tokens']+u['output_tokens']<=4096
     assert d['history'][-1]['role']=='assistant' and d['history'][-1]['content'].strip()
     print(job,d)
    print('Inspect grounded answers and all retained reasoning/history; record failures honestly.')
    PYRESULT

    Expected result: Authorized fixed jobs succeed only after actual reader execution; unauthenticated health returns 401. Native grammar, final EOS and Melody consistency failures return structured 422, not a valid answer.

Performance evidence

No compatible measurement available. Documented support and estimated memory do not establish response speed.

Limits and troubleshooting

  • Complete native North Mini Code 1.0 is a text-only Cohere2Moe model with 30B total / 3B active parameters, 128 experts, top-eight routing and one initial dense layer. All 49 native parts and every expert remain present; active parameters are not storage or memory fit.
  • Native 49-layer global/sliding layout uses sliding window 4096, 32 query heads and 4 KV heads; the explicit eager CPU path preserves the full architecture. No image or Maple model facts are transferred.
  • Publisher card 256K context / 64K output, config 500000 positions and vLLM example 320000 are distinct. The tokenizer sentinel model_max_length is not a native supported context limit. This recipe deliberately selects 4096 total with 3072 input and 1024 generated IDs per turn, without truncating complete retained history.
  • The native full Jinja renders reasoning by default, opens START_THINKING in the generation prefix, retains assistant reasoning with tool calls and final turns, and wraps dictionary tool results under native results index zero. The reader uses the exact snapshot, not another Command model template.
  • Native turn, role, thought, text, action and tool-result boundary IDs 255000–255004 and 255010–255027 are marked special false in tokenizer metadata; the NEW_FILE and FIM IDs 255005–255009 are marked special true. skip_special_tokens cannot sanitize the false-marked controls. Raw IDs and exact decoded boundaries are checked; role/tool-result/pad/mask/BOS/alternate-EOS and malformed ordering are rejected rather than silently stripped.
  • Cohere Melody 0.15.2 Command4 parsing is checked against independently bounded native text/action grammar. Native END_OF_TURN 255001 must terminate exactly once. A 1024-ID length cap without true EOS is a failure; no tool execution or shell agent is provided.
  • The tool job preserves the complete generated reasoning and native tool-call mapping, appends the authored fixed dictionary as a native tool result, then generates the final answer with that full history. The single fixture function cannot inspect the host, execute commands or reach a network. Broader real agent/tool workflows remain open.
  • Native temperature 1.0 and top-p 0.95 are retained; top-k is explicitly disabled by the author and maximum output/concurrency are bounded. Neither fake tests nor source support establish answer quality, coding benchmark performance, calibration or safety.
  • API BF16 scalar count implies 121,937,215,488 bytes in FP32 parameter storage alone. 256 GiB RAM and 400 GiB disk are planning allocations; load copies, cache, eager routing and OS overhead are unmeasured. No fit, speed or active-parameter shortcut claim.
  • The serial stdlib server enforces private authentication, body/framing and fixed jobs, but has no native inference deadline, TLS, multiuser resilience or production guarantee. Keep it on trusted loopback and stop on malformed native output.
  • Exact direct package versions and CPU Torch/Melody wheel identities are pinned; transitive and apt packages resolve at reader install and must be recorded. The author downloaded no weights, tokenizer/BPE or binaries, and ran no native imports or inference. Fake tests exercise transport/protocol only.
  • The publisher card and official documentation declare Apache 2; native repository listing has no actual LICENSE file. Declaration, runtime source licenses and legal suitability are distinct. The frozen provider identity is not asserted byte-equivalent to this native deployment; all broader family/backend/context workflows remain open and required totals stay null.
Artifact, load-diagnostic, dtype or environment failure
Stop and restore all 57 pinned native files and exact CPU releases. Do not delete experts or shards, ignore mismatches, enable remote code or substitute a different model.
Native control, EOS, Melody or tool-schema rejection
Save the reader error and inspect the exact native output locally. Do not strip control tokens, change token IDs, fabricate a final answer or execute proposed tools. The fixed inert tool name and empty parameters must match exactly.
Full history exceeds 3072 input positions or output hits its cap
Stop and record the bounded workflow failure. Preserve complete reasoning/tool history; do not silently truncate it or call incomplete output final. A larger source-qualified configuration needs separate memory/context planning.
401 or body/framing rejection
Use the stable private key, application/json and only the job field with text or tool. No arbitrary prompt, upload, URL, file or command is accepted.
Native CPU exhaustion or poor answer
Stop and preserve the actual error and installed environment. Planning capacity and fake tests are not fit or quality evidence. Inspect grounded answers manually without transferring publisher benchmarks.

Stop the model

  1. 1. Stop the private CPU service

    Press Ctrl-C in its server terminal, then check that the listener is gone. Close any optional SSH tunnel separately; this does not stop EC2 billing.

    Command
    set -e
    curl -s -o /dev/null -w '%{http_code}\n' --max-time 3 http://127.0.0.1:9012/health || true

    Expected result: After Ctrl-C, the local private listener no longer responds.

Uninstall

  1. 1. Remove only the dedicated North workspace

    Preserve desired reader results first; then remove this explicitly named environment, model, helper and key.

    Command
    set -e
    rm -rf -- "$HOME/north-mini-code-native"

    Expected result: The dedicated North workspace is removed. Shared system packages remain.

Shut down cloud resources

  1. 1. Stop compute and review retained resources

    After stopping the service and tunnel, stop or terminate the existing instance in the AWS console and verify its state. Stopped compute and retained gp3 storage have different billing; remove unneeded retained volumes/snapshots/IP resources deliberately after preserving results.

    Expected result: Verify the actual instance state and remaining billable storage/resources; a stopped Python process is not an EC2 shutdown.

Sources and verification

Sources checked Oct 17, 2026. Verification source

Compare this configuration

Benchmarks

Performance scores for North Mini Code across standard benchmarks.

Artificial Analysis Intelligence Index v4.1Artificial Analysis · Aug 2026
20 index
GPQA DiamondArtificial Analysis
75.7%
SciCodeArtificial Analysis
38.8%
Terminal-Bench 2.1Artificial Analysis
35.6%

Pricing

Token pricing for North Mini Code API usage.

Input Tokens

Free

per million tokens

Output Tokens

Free

per million tokens

Cohere's official model documentation states North Mini Code is free for trial and production API keys until rate limits are reached; Model Vault production deployment is also supported.

Competing Models

Same pricing tier — direct alternatives to North Mini Code

Efficiency
Cohere logo
Cohereai lab

Own your AI

1 MCP Servers5 ModelsFounded 2019Toronto, Ontario, Canada
View full profile

AI Models by Cohere

AI models from the same organization.

ModelContext WindowPrice (In / Out per M)
Command ACurrent256K$2.50 / $10.00
Command R7B (12-2024)Current128K$0.04 / $0.15
Command R+ (08-2024)Current128K$2.50 / $10.00
Command R (08-2024)Current128K$0.15 / $0.60

MCP Servers by Cohere

Connect this tool to AI assistants via the Model Context Protocol.

Related News

Latest coverage and updates.