Uploaded November 2026 | Updated December 2026, 1 day ago
This talk is for Python developers moving agents from prototype to production. It explains four architecture patterns for reducing inference cost and task completion time for agents using managed, open-weight models, drawing on real long-context, tool-using workloads.
1. Model qualification: Build a representative evaluation set, define task-specific quality and latency requirements, and select the serving configuration with the lowest measured cost per successfully completed task. Model size, throughput, generation length, retries, and failure rate are treated as parts of the same decision.
2. Context design: Separate stable and volatile context, serialize prompts and tool definitions, and structure conversation history to maximize safe prefix-cache reuse. Observed cached tokens are measured, not inferred.
3. Runtime routing: Route only across models that have passed the quality gate. Use task type, complexity, risk, conversation phase, and generation budget to select the fastest and most economical qualified model, with explicit fallback and escalation policies.
4. Targeted adaptation: Fine-tune or distill a smaller model when the workload is repeated, measurable, and stable. Compare the fixed cost of data preparation, training, evaluation, and deployment with the recurring savings from lower latency, lower inference cost, shorter prompts, or fewer retries.
The four patterns are connected through a Python reference architecture using OpenAI-compatible endpoints, deterministic prompt construction, task evaluation, routing policies, fallbacks, and request-level telemetry. A common scorecard tracks task success, structured-output validity, latency, cached tokens, retries, and inference cost.
Attendees will learn how to choose between closed APIs, local models, and managed open inference; how to apply the four patterns in a practical order; and how to measure whether an optimization improves the cost and response time of successful task completion without reducing quality. The session is scoped to 25 minutes and uses architecture diagrams, short code examples, and a single running case rather than a live demo.
Outline (25 minutes + 5 minutes Q&A)
1. Why open weights and managed cloud inference (4 minutes): Compare closed APIs, local models, self-managed serving, and managed open inference.
2. Pattern 1, model qualification (4 minutes): Define quality gates and identify the optimal balance of quality, cost and latency.
3. Pattern 2, context design and prefix reuse (4 minutes): Implement stable prefixes, deterministic serialization, prefix caching, and request-level cache measurement.
4. Pattern 3, runtime routing (4 minutes): Select the fastest and most economical qualified model for each task, with fallback and escalation policies.
5. Pattern 4, targeted adaptation (4 minutes): Evaluate when adaptation changes the inference economics enough to justify its fixed costs.
6. Python reference architecture (3 minutes): Connect prompt construction, evaluation, routing, endpoints, fallbacks, and telemetry.
7. Decision framework and takeaways (1 minute): Apply the patterns in order and select the appropriate deployment model.
8. Token Factory and invitation (1 minute): Explore Nebius Token Factory as a managed implementation of the architecture and explain how attendees can try it.
9. Q&A (5 minutes).
pydata.org
PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R.
PyData conferences aim to be accessible and community-driven, with novice to advanced level presentations. PyData tutorials and talks bring attendees the latest project features along with cutting-edge use cases.
00:00 Welcome!
00:10 Help us add time stamps or captions to this video! See the description for details.
Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: github.com/numfocus/YouTubeVideoTimestamps
This talk is for Python developers moving agents from prototype to production. It explains four architecture patterns for reducing inference cost and task completion time for agents using managed, open-weight models, drawing on real long-context, tool-using workloads.
1. Model qualification: Build a representative evaluation set, define task-specific quality and latency requirements, and select the serving configuration with the lowest measured cost per successfully completed task. Model size, throughput, generation length, retries, and failure rate are treated as parts of the same decision.
2. Context design: Separate stable and volatile context, serialize prompts and tool definitions, and structure conversation history to maximize safe prefix-cache reuse. Observed cached tokens are measured, not inferred.
3. Runtime routing: Route only across models that have passed the quality gate. Use task type, complexity, risk, conversation phase, and generation budget to select the fastest and most economical qualified model, with explicit fallback and escalation policies.
4. Targeted adaptation: Fine-tune or distill a smaller model when the workload is repeated, measurable, and stable. Compare the fixed cost of data preparation, training, evaluation, and deployment with the recurring savings from lower latency, lower inference cost, shorter prompts, or fewer retries.
The four patterns are connected through a Python reference architecture using OpenAI-compatible endpoints, deterministic prompt construction, task evaluation, routing policies, fallbacks, and request-level telemetry. A common scorecard tracks task success, structured-output validity, latency, cached tokens, retries, and inference cost.
Attendees will learn how to choose between closed APIs, local models, and managed open inference; how to apply the four patterns in a practical order; and how to measure whether an optimization improves the cost and response time of successful task completion without reducing quality. The session is scoped to 25 minutes and uses architecture diagrams, short code examples, and a single running case rather than a live demo.
Outline (25 minutes + 5 minutes Q&A)
1. Why open weights and managed cloud inference (4 minutes): Compare closed APIs, local models, self-managed serving, and managed open inference.
2. Pattern 1, model qualification (4 minutes): Define quality gates and identify the optimal balance of quality, cost and latency.
3. Pattern 2, context design and prefix reuse (4 minutes): Implement stable prefixes, deterministic serialization, prefix caching, and request-level cache measurement.
4. Pattern 3, runtime routing (4 minutes): Select the fastest and most economical qualified model for each task, with fallback and escalation policies.
5. Pattern 4, targeted adaptation (4 minutes): Evaluate when adaptation changes the inference economics enough to justify its fixed costs.
6. Python reference architecture (3 minutes): Connect prompt construction, evaluation, routing, endpoints, fallbacks, and telemetry.
7. Decision framework and takeaways (1 minute): Apply the patterns in order and select the appropriate deployment model.
8. Token Factory and invitation (1 minute): Explore Nebius Token Factory as a managed implementation of the architecture and explain how attendees can try it.
9. Q&A (5 minutes).
pydata.org
PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R.
PyData conferences aim to be accessible and community-driven, with novice to advanced level presentations. PyData tutorials and talks bring attendees the latest project features along with cutting-edge use cases.
00:00 Welcome!
00:10 Help us add time stamps or captions to this video! See the description for details.
Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: github.com/numfocus/YouTubeVideoTimestamps

![Python in Climate Tech: Vehicle-to-Grid [PyCon DE & PyData 2026]
🔊 Recorded at PyCon DE & PyData 2026, 14.04.2026
https://2026.pycon.de/talks/QVLTKD/
🎓 Watch Christopher Sedlaczek-Bock explore how Python is bridging the gap between automotive and energy industries to scale Vehicle-to-Grid solutions for a zero-emission future.
Speakers:
Christopher Sedlaczek-Bock
Description:
Vehicle-to-Grid (V2G) technology addresses the volatility of renewable energy by utilizing electric vehicle (EV) batteries as distributed energy storage. In Germany, the EV fleet provides approximately 150 gigawatt-hours of capacity, which is two orders of magnitude larger than existing stationary storage. This capacity allows the grid to store overproduction from solar and wind sources and discharge energy during peak demand, reducing the need for power grid expansions and preventing the waste of renewable energy.
The approach distinguishes between V1G (unidirectional smart charging) and V2G (bidirectional charging and discharging). To commercialize this flexibility, individual vehicle assets are aggregated into larger blocks to meet the minimum capacity requirements of energy markets. Users define boundary conditions—including minimum and maximum state of charge and departure times—which create a polygon of charging flexibility. Within these constraints, optimization algorithms determine the most profitable times to buy or sell energy based on spot market prices and weather forecasts.
The technical architecture employs a hybrid language approach. Python handles the majority of the backend and optimization logic. However, because the Open Charge Point Protocol (OCPP) requires stateful WebSocket connections, Rust is used for the charger control layer to provide the multithreading and performance necessary to maintain thousands of concurrent connections. Hardware integration involves industrial Raspberry Pi-based controllers for dynamic load management. Measured data suggests that V2G cycling results in less than 1% additional battery degradation per year, making the service viable for users who receive financial bonuses for providing grid flexibility.
⭐️ About PyCon DE:
PyCon DE is the leading conference on open-source Python applications in AI and data science. It brings together industry professionals, researchers, AI and data science practitioners, and software engineering communities, providing a unique platform for collaboration, knowledge sharing, and innovation.
The PyCon DE & PyData 2026 conference delivered an exceptional experience, fostering stronger connections within the Python community while showcasing the latest advancements in artificial intelligence and data science. Attendees enjoyed a diverse and engaging program of talks, workshops, and networking opportunities, further establishing the conference as a premier event for Python, AI, and data science enthusiasts across Germany.
PyCon DE 2027 will take place in Heidelberg from 19 to 23 April 2027.
Follow us:
• Newsletter: https://2027.pycon.de/newsletter/
• LinkedIn: https://www.linkedin.com/company/pyconde
• X: https://www.x.com/pyconde
Links:
• Conference website: http://pycon.de
• Other sessions: https://2026.pycon.de/talks/
The conference was organized by
• Python Softwareverband e.V.: http://pysv.org
• Pioneers Hub gemeinnützige GmbH: http://pioneershub.org
in collaboration with NumFOCUS Inc.: http://numfocus.org
If you enjoyed this session, please like, and subscribe to our channel for more insightful talks and discussions.
Share this video with your network to spread the knowledge!
Hashtags:
#Python #PyConDE #PyData #OpenSource #AI #DataScience #MachineLearning #SoftwareEngineering #LLMs #Community #Sovereignty
Acknowledgements:
Special thanks to all the volunteers and sponsors who made this event possible.
About:
Python Softwareverband e.V.:
PySV is a non-profit that promotes the use and development of Python in Germany through events, education, and advocacy, fostering an open Python community.
Pioneers Hub gemeinnützige GmbH:
is a non-profit fostering innovation in AI and tech by connecting experts and promoting knowledge exchange through events and collaborative initiatives.
NumFOCUS Inc.
supports open-source scientific computing by providing financial and logistical support to key projects like NumPy and Jupyter, promoting sustainable development and collaboration.
www.pydata.org
PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R. Python in Climate Tech: Vehicle-to-Grid [PyCon DE & PyData 2026]](https://i.ytimg.com/vi/meJu96TGw5Y/mqdefault.jpg)


![Demystifying Agentic AI Using Small Language Models [PyCon DE & PyData 2026]
🔊 Recorded at PyCon DE & PyData 2026, 15.04.2026
https://2026.pycon.de/talks/YZM8TA/
🎓 Watch Serhii Sokolenko demystify agentic AI as he reveals how to build powerful, scalable data agents using Small Language Models and Iceberg tables—without the need for a GPU farm.
Speakers:
Serhii Sokolenko
Description:
Agentic AI utilizes language models as decisioning engines to perceive environments, make decisions, and execute actions to achieve specific goals. While large language models (LLMs) are often used for these reasoning loops, they are computationally expensive and contain redundant data. Small language models (SLMs), defined as models with 10 to 30 billion parameters that fit within 16 to 32 gigabytes of consumer RAM, provide a cost-effective, private alternative for agentic workflows.
Effective agents require four core capabilities: task decomposition, tool calling, glue code generation, and instruction following. The Salesforce xLAM-2 model, a 32-billion parameter open-source SLM created via supervised fine-tuning on synthetic function-calling data, demonstrates accuracy comparable to much larger proprietary models on the Berkeley function calling leaderboard.
A practical implementation stack for local experimentation includes xLAM-2 with 4-bit quantization, the Llama.cpp inference server for GPU acceleration on Apple silicon, and the LangChain framework for orchestrating agent logic. To prevent hallucinations and ensure data integrity, agents can be integrated with Apache Iceberg lakehouses to access verified business data. This approach allows developers to replace rigid directed acyclic graphs (DAGs) with flexible business rules and guardrails.
⭐️ About PyCon DE:
PyCon DE is the leading conference on open-source Python applications in AI and data science. It brings together industry professionals, researchers, AI and data science practitioners, and software engineering communities, providing a unique platform for collaboration, knowledge sharing, and innovation.
The PyCon DE & PyData 2026 conference delivered an exceptional experience, fostering stronger connections within the Python community while showcasing the latest advancements in artificial intelligence and data science. Attendees enjoyed a diverse and engaging program of talks, workshops, and networking opportunities, further establishing the conference as a premier event for Python, AI, and data science enthusiasts across Germany.
PyCon DE 2027 will take place in Heidelberg from 19 to 23 April 2027.
Follow us:
• Newsletter: https://2027.pycon.de/newsletter/
• LinkedIn: https://www.linkedin.com/company/pyconde
• X: https://www.x.com/pyconde
Links:
• Conference website: http://pycon.de
• Other sessions: https://2026.pycon.de/talks/
The conference was organized by
• Python Softwareverband e.V.: http://pysv.org
• Pioneers Hub gemeinnützige GmbH: http://pioneershub.org
in collaboration with NumFOCUS Inc.: http://numfocus.org
If you enjoyed this session, please like, and subscribe to our channel for more insightful talks and discussions.
Share this video with your network to spread the knowledge!
Hashtags:
#Python #PyConDE #PyData #OpenSource #AI #DataScience #MachineLearning #SoftwareEngineering #LLMs #Community #Sovereignty
Acknowledgements:
Special thanks to all the volunteers and sponsors who made this event possible.
About:
Python Softwareverband e.V.:
PySV is a non-profit that promotes the use and development of Python in Germany through events, education, and advocacy, fostering an open Python community.
Pioneers Hub gemeinnützige GmbH:
is a non-profit fostering innovation in AI and tech by connecting experts and promoting knowledge exchange through events and collaborative initiatives.
NumFOCUS Inc.
supports open-source scientific computing by providing financial and logistical support to key projects like NumPy and Jupyter, promoting sustainable development and collaboration.
www.pydata.org
PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R. Demystifying Agentic AI Using Small Language Models [PyCon DE & PyData 2026]](https://i.ytimg.com/vi/nk5BNz8v_9E/mqdefault.jpg)





