Instructions to use aksern/compctx-0.8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aksern/compctx-0.8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aksern/compctx-0.8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aksern/compctx-0.8b") model = AutoModelForCausalLM.from_pretrained("aksern/compctx-0.8b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aksern/compctx-0.8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aksern/compctx-0.8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aksern/compctx-0.8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aksern/compctx-0.8b
- SGLang
How to use aksern/compctx-0.8b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "aksern/compctx-0.8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aksern/compctx-0.8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "aksern/compctx-0.8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aksern/compctx-0.8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aksern/compctx-0.8b with Docker Model Runner:
docker model run hf.co/aksern/compctx-0.8b
compctx-0.8b
A compact model that turns AI agent execution traces into structured memory notes.
compctx takes an agent's work log and compresses it into a concise, structured summary of the task, constraints, completed actions, failures, decisions, and next steps.
It is designed for agent memory systems where preserving useful execution context matters more than generating conversational responses.
Overview
- Base model: Qwen/Qwen3.5-0.8B
- Architecture:
Qwen3_5ForCausalLM - Parameters: 752M
- Modality: Text-only
- Fine-tuning: Supervised fine-tuning (SFT) with LoRA
- LoRA configuration: rank 128, alpha 128
- Weights: LoRA merged into the base model
The original multimodal architecture was converted into a text-only causal language model. The trained language-model weights were transferred, and the LoRA adapter was converted and merged into the resulting checkpoint.
Output format
The model produces notes using a fixed structure:
Goal: <what the user wants, one sentence>
Constraints: <rules and limits, or "none">
State:
- [done] <completed action and its result>
- [failed] <action and exact error>
- [planned] <intended action without a confirmed result>
Decisions: <approach chosen or rejected, and why>
Next: <next unfinished step, or "unclear">
The model distinguishes between completed actions, failures, and planned work. It is instructed to use only information present in the trace and avoid inventing missing details.
Usage
The tokenizer's chat template includes the system prompt and a few-shot demonstration. Provide a single user message containing the agent trace:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "aksern/compctx-0.8b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
trace = """
[TRACE] [2026-10-30 06:24:00] [AGENT: Orchestrator]
User Prompt: "Find the errors in the file script.py and fix them."
[SPAN] [Thinking Process]
"To solve the task, I first need to read the contents of the file script.py. I will use the view_file tool."
[SPAN] [Tool Call: view_file]
Arguments: {"path": "script.py"}
Response: "def main():\n print('Hello' + 5)"
[SPAN] [Thinking Process]
"There is a TypeError in the code: you cannot add a string and a number together. You need to replace 5 with '5' or use an f-string. I am invoking the patch_file tool."
[SPAN] [Tool Call: patch_file]
Arguments: {"path": "script.py", "edit": "print(f'Hello {5}')"}
Response: "File patched successfully."
[TRACE END] Agent completed the task.
"""
messages = [
{"role": "user", "content": trace},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(
prompt,
return_tensors="pt",
add_special_tokens=False,
).to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
)
result = tokenizer.decode(
output[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True,
)
print(result)
The chat template automatically:
- Adds the system instructions.
- Includes the few-shot example used during training.
- Wraps the input in
<trace>tags. - Adds the assistant generation prefix.
Input: one user message containing a plain-text agent trace.
Output: a structured memory note.
Intended use
- Compressing AI agent execution logs.
- Preserving task progress between agent sessions.
- Extracting completed actions and unresolved errors.
- Creating compact context for long-running agent workflows.
- Building lightweight memory components for tool-using agents.
Limitations
- Not a general-purpose conversational assistant.
- Designed around the specific structured output format above.
- Accuracy depends on the information available in the input trace.
- May omit details when the input exceeds its context or output budget.
Training
Fine-tuned from Qwen3.5-0.8B using supervised fine-tuning and LoRA.
The training objective was to transform agent execution traces into structured memory notes while preserving exact technical details such as paths, commands, identifiers, and error messages.
The resulting adapter was merged into a standalone text-only checkpoint.
License
This model is based on Qwen3.5-0.8B. Check the base model's license and applicable terms before redistribution or commercial use. The license for this model is OpenMDW-1.1
- Downloads last month
- 233