Subconscious GLM 5.2
Subconscious GLM 5.2 is a long-context language model optimized for fast, efficient, multi-step agent workloads.
Model details
Example usage
Subconscious GLM-5.2 is an open-source, MIT-licensed frontier coding model optimized for long-horizon agentic workflows and developer operations.Key Features
Massive Context: Supports up to a 1M token context window to digest entire multi-file codebases in a single request.
Advanced Reasoning: Features a native, configurable "Thinking Mode" that explicitly decomposes complex STEM logic and software engineering problems before responding.
Smart Memory: Integrates directly with Subconscious Cache, shifting context engineering to the model layer so agents can self-manage long-term memory streams efficiently.
Open & Cost-Effective: Offers an open-weights alternative to closed commercial APIs, dropping operational costs by up to 90% while remaining fully OpenAI-API compatible.
For full implementation details, benchmarks, and deployment guides, visit the Subconscious Documentation.
1import os
2from openai import OpenAI
3
4# Initialize the client pointing to the Subconscious API base URL
5client = OpenAI(
6 base_url=url = os.environ["MODEL_API_URL"],
7 api_key=os.environ['MODEL_API_KEY']
8)
9
10# Execute an agentic task leveraging self-managed context and Subconscious Cache
11response = client.chat.completions.create(
12 model="subconscious/glm-5.2",
13 messages=[
14 {
15 "role": "system",
16 "content": "You are a frontier software engineering agent equipped with self-managed context capabilities."
17 },
18 {
19 "role": "user",
20 "content": "Analyze our repository's architectural bottleneck and execute a multi-step debugging plan."
21 }
22 ],
23 extra_body={
24 "thinking_effort": "max" # Optimize for complex, long-horizon reasoning depth
25 }
26)
27
28print(response.choices[0].message.content)1{
2 "id": "chatcmpl-cccc",
3 "object": "chat.completion",
4 "created": 1785288300,
5 "model": "subconscious/glm-5.2",
6 "choices": [
7 {
8 "index": 0,
9 "message": {
10 "role": "assistant",
11 "content": "<RESPONSE CONTENT HERE>"
12 },
13 "logprobs": null,
14 "finish_reason": "stop"
15 }
16 ],
17 "usage": {
18 "prompt_tokens": 1420,
19 "completion_tokens": 850,
20 "total_tokens": 2270,
21 "prompt_tokens_details": {
22 "cached_tokens": 1280
23 }
24 }
25}